Commit Graph

29 Commits

Author SHA1 Message Date
Brian Fertig 83075c8791 Add user profile page with name and photo support
- New `/profile` page lets users set first/last name and upload a
  profile photo (resized to 256x256 JPEG server-side via sharp, stored
  as a data URL in Postgres since the container FS is ephemeral)
- Sidebar user block now shows the profile photo (or initial-letter
  fallback) and display name, and links to `/profile`
- Migration adds `firstName`, `lastName`, `avatar` columns to User and
  backfills them from the legacy `name` field; seed updated to match
- Bump Next.js server-action body limit to 11 MB so avatar uploads up
  to the 10 MB cap aren't silently rejected with a 413
- Expose Postgres port on the host in docker-compose for local tooling
2026-08-30 11:24:05 -06:00
Brian Fertig f21b12182c Add responsive mobile layout for the app shell and board
- Replace the fixed min-width horizontal-scroll shell with a stacked
  mobile layout (h-dvh) that keeps the desktop three-column layout at md+
- Add MobileTopBar with hamburger menu, brand, and theme toggle reachable
  without opening the drawer
- Convert SideNav into shared content plus a left-sheet hamburger drawer;
  close on navigation link tap, backdrop, or Escape
- Make the board swipeable on mobile: one lane per screen via snap paging,
  with a CategoryChips rail that tracks the active lane (IntersectionObserver)
  and glides to it on tap; lanes go full-width below md
- Turn the Scheduled panel into a bottom dock bar + bottom sheet on mobile
  (keeps overdue/today urgency badges), desktop aside unchanged at md+
- Compact board chrome for phones: icon-only Summary/View buttons, smaller
  title/padding, full-width AddCategoryLane as a snap page under empty state
- Allow tall dialogs to scroll within dvh so edit forms and the AI summary
  stay usable on small screens; make admin user table horizontally scrollable
- Support configurable ThemeToggle menu side/align so it opens downward in
  the mobile top bar instead of off-screen
- Add CDP-based screenshot script and reference shots for mobile/tablet/desktop
2026-08-29 22:42:33 -06:00
Brian Fertig f66c7731d1 Add per-project theme assignment with scoped theming
- Extract theme constants (THEMES, THEME_CLASSES, DARK_SURFACES) into a new
  framework-free lib/themes.ts so server and client code share one source of
  truth; re-export from theme-provider for backward compatibility.
- Add nullable `theme` column to Project (Prisma migration + schema), plus
  ProjectThemeSchema validation and a setProjectTheme server action.
- Introduce a ThemeScope context in the provider: a subtree can temporarily
  override the global preference via useThemeScope().setScope(name); the
  scoped theme wins for resolvedTheme/DOM while active, then lifts on cleanup.
- Render an inline no-FOUC script (themeSwitchScript) on project pages that
  applies the theme class before first paint and leaves a data-project-theme
  marker the provider reads at hydration.
- Add ProjectThemeScope component that sets/clears the scope from live
  ProjectsContext state, so picking a new theme updates instantly without
  waiting for the server re-render.
- Add ProjectThemePicker dropdown (Default + light/dark options) rendered
  beside the project title in the kanban board header.
- Wire optimistic setProjectTheme into ProjectsContext with rollback and
  error toast on failure.
- Update use-dark-theme hooks to read resolvedTheme from context instead of
  resolving locally, so they reflect scoped themes correctly.
2026-08-29 22:07:10 -06:00
Brian Fertig fca66959c2 Fix vaporwave glitch band clipping the progress pie badge
- Move overflow:hidden off the group card onto a dedicated .vw-glitch-clip
  overlay so the card can stay overflow-visible and the corner progress
  pie is no longer cropped by the card or its rounded corner.
- Add overflow-x-clip to CategoryLane so badges that poke past the card's
  right edge are discarded instead of spawning a stray horizontal scrollbar.
- Nudge TodoProgressPie to -right-2.5 and give the "N/N done" label pr-2.5
  so both clear each other within the lane's 10px margin without spilling.
2026-08-29 18:29:10 -06:00
Brian Fertig 7fcfcbdb5b Polish blueprint, vaporwave, and notebook theme visuals
- Add animated "APPROVED" stamp on completed to-do rows in the
  blueprint theme, and a red-pen checkmark reveal in the notebook
  theme (with reduced-motion fallback)
- Move vaporwave scanlines above content, speed up the roll, and add
  the striped synth sun, outrun floor grid, and palm silhouettes as
  fixed scenery behind the lanes
- Rework the notebook theme so lanes read as ruled paper pages and
  group cards as slightly tilted post-its with hand-cut borders
- Add data-category-lane attribute to CategoryLane for scoping the
  new lane-level styles
2026-08-29 16:12:22 -06:00
Brian Fertig bb4e8b5558 Updated Theme Colors 2026-08-28 14:50:06 -06:00
Brian Fertig 7c407f49f8 Added AI Summary 2026-08-28 14:25:57 -06:00
Brian Fertig 15bfcfa064 Additional changes to the Cyberpunk theme, to make it even more cyberpunk. 2026-08-28 13:34:08 -06:00
Brian Fertig 304d750ec5 Reminders and Notifications -- on scheduled to dos 2026-08-28 13:19:25 -06:00
Brian Fertig 80176636b7 New themes 2026-08-28 12:24:52 -06:00
Brian Fertig be6926c027 Two new extra-detailed themes: Cybperpunk and Blueprint 2026-08-28 11:33:57 -06:00
Brian Fertig 5e23a984e1 Added more themes 2026-08-28 09:00:31 -06:00
Brian Fertig cb52dfe545 Improve quick-add UX and fix visual clipping in board cards
- Let the quick-add dialog target any group via a new group dropdown,
  instead of always defaulting to the first group
- Only clip category lane content while it's actively collapsing, so
  it no longer crops a card's hover lift/top stroke at rest
- Raise the progress pie badge's z-index so it isn't cropped by the
  next card overlapping its corner
2026-08-25 14:24:34 -06:00
Brian Fertig 70838b121d Add debugging tools and dark-theme surface detection for theme QA
- Add .cdp/*.cjs scripts for CDP-driven headless Edge testing of theme
  switching, console errors, and login flows, plus a vendored
  next-themes beta package used during investigation
- Add components/theme/use-dark-theme.ts to treat "ocean" as a dark
  surface alongside "dark" for card colors and markdown color-mode
- Add shots/ screenshots captured while verifying theme behavior across
  pages and breakpoints
2026-08-25 13:36:47 -06:00
Brian Fertig b6b1690fdd Redesign UI theming, typography, and board polish
- Replace next-themes with a custom ThemeProvider supporting four
  themes (Default, Sunset, Dark, Ocean) since next-themes' no-FOUC
  script tag breaks under React 19 dev warnings
- Swap Geist fonts for Inter/Figtree/JetBrains Mono for a friendlier
  display face and add a shared isDarkTheme/colorModeFromTheme helper
  so components stop reading next-themes directly
- Add per-color "soft"/"softDark" tints in lib/colors.ts so group
  cards carry a calm hue-tinted fill instead of a generic gray
- Restyle nav, board lanes, group cards, empty states, and page
  headers with heading font, tighter spacing, and rounded-2xl surfaces
- Add lane "open to-dos" counts, board summary stats, and a quick
  "+ To-do" action targeting the first available group
- Hide the Scheduled panel below sm and give the app shell a minimum
  width with horizontal scroll instead of crushing the board
- Fix DropdownMenuLabel to self-wrap in a Menu.Group (Base UI requires
  the context) and wrap the admin role Badge trigger in a native button
2026-08-25 13:06:53 -06:00
Brian Fertig 084d458335 Implement hold-on-complete animations for smooth item dismissal 2026-08-24 15:22:07 -06:00
Brian Fertig 938f59d10d compact todo groups: ride the "+" on the last visible row
In compact layout the add-to-do menu no longer takes a row of its
own — it now renders inline on the last visible to-do, saving one
line per group. A compact group is guaranteed to have at least one
visible to-do (CategoryLane hides it otherwise), so there's always
a row to attach it to; a defensive fallback keeps the "+" reachable
in the off chance that invariant ever changes. Non-compact layout
(popover, AI add, archive, progress pie) is unchanged.
2026-08-19 09:33:11 -06:00
Brian Fertig 171ec92b74 Add 3D flight world, board view switcher, and quick-add to-dos
3D scene:
- Build a procedural world from seeded waypoint segments (per-segment
  step/turn/altitude params) joined into kink-free Catmull-Rom curves,
  using ghost points so boundaries stay smooth; world and textures are
  derived from the session seed for consistency.
- Carve the flight corridor out of the terrain (gaussian dip plus a
  height floor 32u below the path) and add city districts with instanced
  buildings driven by seeded glowing-window textures, plus tunnel
  segments rendered as textured tubes with light strips.

Board UI:
- Add a ViewSwitcher to the kanban header and a board view provider.
- Compact group cards place an inline "+" on the last visible to-do row
  (shrink-0, so it sits at the row's right edge) that opens the new
  TodoCreateDialog, alongside the existing AI-assisted creation flow.

Scheduled panel:
- Collapsed rail replaces the corner overdue dot with badges stacked
  below the calendar icon: overdue (destructive, ping ring) and
  due-today (neutral, calmer pulse). Today's count is a separate filter
  that excludes already-completed occurrences, unlike the overdue count.
2026-08-19 09:23:05 -06:00
Brian Fertig 6cfd244b41 # Conversation Summary
## Conversation Overview
A single user message. The user pasted a large, partially garbled/mangled unified diff of changes to a **Next.js self‑hosted board/to‑do web app** and asked the assistant to *"Generate a concise and descriptive git commit message for the selected code changes. The message should summarize the changes made, their purpose, and any relevant context. Do not edit any files, just provide the commit message as output."* No assistant reply has been produced yet.

## Subject of the Diff (what the changes do)
The diff introduces two related **AI features** plus shared AI plumbing:

1. **Per‑group "Status Update" feature**
   - New `components/board/status-update-dialog.tsx` — a dialog that generates a group status update, supports a follow‑up chat list (`ChatMessageList`, `MarkdownPreview`), copy‑to‑clipboard, and calls `converseAboutGroupStatus(group.id, next)`.
   - `components/board/group-card.tsx` (modified) — imports `ClipboardList` + `StatusUpdateDialog`, adds `statusUpdateOpen` state, and a **"Status Update"** dropdown item gated on `aiConfigured`.
   - New `lib/actions/group-status-ai.ts` (`"use server"`) — backing server action(s) incl. `converseAboutGroupStatus`.

2. **"Global Chat" feature**
   - New `lib/actions/global-chat.ts` (`"use server"`) — `sendChatMessage(messages: ChatMessage[])`: free‑form Q&A across every board the user owns (Home + all Projects). Re‑fetches/re‑serializes context each turn; uses `requireUserId()`, `getAllGroupsForUser()`, `formatAllGroupsForPrompt()`, and a shared `callChatCompletion` helper. Includes a `SYSTEM_PROMPT_HEADER` instructing the model to answer only from provided context.

3. **Shared AI context/formatting layer**
   - New `lib/ai/context.ts` (`server-only`) — `formatAllGroupsForPrompt`, truncation with hard caps: `NOTE_CHAR_CAP=4,000`, `DETAILS_CHAR_CAP=300`, `TOTAL_CHAR_CAP=60,000`. Comment notes single‑user scale (no RAG; whole dataset goes into the prompt, capped by these limits).
   - New `types/ai.ts` — `AiGroupContext` interface (group + scope label + category + archived flag + todos). **Deliberately includes archived groups** so historical questions are answerable.
   - `lib/board.ts` (modified) — new `getAllGroupsForUser(userId)` using one Prisma query with `categoryAccessFilter`, flattening all categories/groups/todos (unlike `getBoard`, it does **not** filter archived groups).

## Key Technical Details
- Stack: Next.js, React, Tailwind, shadcn‑style UI (Dialog/Button), `MarkdownPreview`/`ChatMessageList`.
- `"use server"` server actions; `"server-only"` context module; Prisma ORM; `requireUserId()` auth; `categoryAccessFilter` access control.
- A shared `callChatCompletion` helper is referenced (handles provider errors, 401/403 API‑key rejection, empty/invalid JSON responses) — its full definition is not cleanly visible in the pasted diff.
- The pasted diff/file contents contain visible corruption (broken lines, garbled characters), but the feature intent is clearly discernible.

## User Request (deliverable)
Produce **only** a concise, descriptive git commit message (no file edits). The expected message should summarize: adding per‑group AI "Status Update" + a global cross‑board "Chat", along with shared AI context formatting (`lib/ai/context.ts`, `types/ai.ts`, `getAllGroupsForUser`) and new server actions (`global-chat.ts`, `group-status-ai.ts`). A representative phrasing would be something like: *"Add AI status updates per group and a global chat across all boards, backed by shared AI context formatting."*

## Current State / Next Steps
- No assistant response exists yet.
- Next step is to emit the commit message as plain text output (no code/file changes).
2026-08-19 08:35:00 -06:00
Brian Fertig eb32aee653 Add scheduled (recurring) to-dos, AI to-do generation, and in-place building upgrades
- Scheduled to-dos: new ScheduledTodo + ScheduledTodoCompletion models
  (owner-XOR-project ownership like Category, per-occurrence completion
  so a recurring to-do tracks done state per calendar date), recurrence
  built server-side from validated parts via rrule-utils, CRUD +
  occurrence-toggle server actions, add/edit dialog, and a collapsible
  Scheduled side panel (overdue / today / upcoming) with UTC-safe
  date-key formatting.
- AI to-dos: group-level AI dialog (lib/actions/todo-ai.ts) that chats
  then proposes a finalize list of to-dos; editable proposals and bulk
  add via BoardProvider.addTodos; speech recognition gains better error
  handling (network/firewall message, error logging).
- Building upgrades: new `upgradesFrom` rule — Nuclear Power Plant can
  replace a friendly Energy Generator and Advanced Metal Generator a
  Mass Generator (same tile + footprint, per TALogic.findUpgradeTarget),
  crediting a 50% refund of the replaced building's OWN cost;
  compileRules validates the references, topperFrame gets a generic
  spinning-glyph fallback in TAArt.
- Movement rework: pushOutOfObstacles replaces the hard tile-snap with a
  damped circle-vs-tile overlap push, and pathfinding routes at exact-fit
  clearance instead of +1 padding (fixes corner grinding/stalling).
- New map m06 "Annihilation" (medium, snowfields, Klaxon skill 5, seed
  90123 — pre-vetted for early-economy balance).
- Tests: upgrade placement (ownership, type match, exact footprint,
  refund, army-less fallback), obstacle routing/settling, corridor
  moves; sprites.md updated for upgradesFrom and toppers.
2026-08-17 15:03:13 -06:00
Brian Fertig 088da63de2 feat: add "Ask AI" dialog for groups with voice input
Introduce GroupAiDialog component allowing users to chat with an AI assistant to generate or refine group notes.
Add useSpeechRecognition hook wrapping the Web Speech API for microphone support.
Implement converseAboutGroup server action to handle the AI conversation loop, supporting iterative questioning and final note generation.
Extract joinApiUrl helper in lib/ai-settings.ts for consistent endpoint URL construction.
2026-08-12 15:48:05 -06:00
Brian Fertig aa6a2e1cfd feat: add AI provider config and todo completion timestamps
- Add `AiSettingsCard` component and server actions for configuring an
  OpenAI-compatible AI endpoint (e.g. OpenWebUI) from the admin panel
- Introduce `AiSettings` Prisma model with masked API key display and
  connection testing UI
- Track `completedAt` on todos with a migration and backfill for existing
  completed items
- Surface `createdAt`, `updatedAt`, and `completedAt` in the todo edit
  dialog via a new `formatDateTime` utility
- Update `TodoDTO`, `getBoard`, `createTodo`, `toggleTodo`, and the board
  context to carry and optimistically update timestamp fields
- Add `Select` UI component built on `@base-ui/react`
2026-08-12 15:01:54 -06:00
Brian Fertig 4708e00a04 feat(board): introduce Projects as isolated boards
- Add Project model with owner-based access and cascade delete
- Restructure Category to belong to either Home (userId) or a Project (projectId), enforced by DB constraints and access filters
- Scope all board operations (create, update, delete, reorder) to the correct board context using `categoryAccessFilter` and `projectAccessFilter`
- Replace hardcoded `revalidatePath("/")` with dynamic `boardPath()` for proper cache invalidation
- Add `ProjectsProvider` and `ProjectsNavSection` for project sidebar navigation
- Make KanbanBoard accept `projectId` and `title` props to render Home or Project boards
- Extract `getBoard()` utility to centralize board data fetching
- Refactor group/todo/notes actions to derive board context from category membership rather than trusting caller input
2026-08-12 12:57:41 -06:00
Brian Fertig ce1d540444 Adjustment to Drag and Drop hitbox on Group Cards 2026-08-12 11:36:07 -06:00
Brian Fertig 37631df620 Completion Pie Charts 2026-08-12 11:24:43 -06:00
Brian Fertig 5a681bd444 Created different Authorization types 2026-08-12 11:02:40 -06:00
Brian Fertig 8639f9986c V1 Changes 2026-08-11 16:37:01 -06:00
Brian Fertig 0d7336858c Adjustments to Drag and Drop features, as well as theme features 2026-08-11 13:26:10 -06:00
Brian Fertig 9a1aad6ed0 first commit 2026-08-11 13:10:00 -06:00