Commit Graph

9 Commits

Author SHA1 Message Date
Brian Fertig a849293bd0 Add account linking and per-account theme persistence
- Profile page gains a Request Account Link form, plus sections for pending requests (create / deny / deny-and-block), confirmed linked accounts (toggle / remove), and blocked requesters (allow requests)
- Toggle signs the browser in as the linked account using a single-use 60-second switch token minted server-side after link verification, so the target's password is never needed; a new "account-switch" Credentials provider in auth.ts consumes the token atomically to prevent replay
- Theme preference now stored on the User profile row (new `theme` column) and applied from the root layout's no-FOUC script before first paint, so each account keeps its own look across toggles and devices; anonymous visitors keep the old localStorage behavior
- New Prisma models: AccountLinkRequest, AccountLink, AccountLinkBlock, AccountSwitchToken with composite uniques, self-link check constraint, and cascade deletes
2026-08-30 13:28:55 -06:00
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 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 7c407f49f8 Added AI Summary 2026-08-28 14:25:57 -06:00
Brian Fertig 304d750ec5 Reminders and Notifications -- on scheduled to dos 2026-08-28 13:19:25 -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 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 8639f9986c V1 Changes 2026-08-11 16:37:01 -06:00
Brian Fertig 9a1aad6ed0 first commit 2026-08-11 13:10:00 -06:00