Skip to content

Sidebar user switcher + brand v3 + spec audit#11

Merged
ndemarco merged 4 commits intomainfrom
feat/dev-user-selector
Apr 24, 2026
Merged

Sidebar user switcher + brand v3 + spec audit#11
ndemarco merged 4 commits intomainfrom
feat/dev-user-selector

Conversation

@ndemarco
Copy link
Copy Markdown
Owner

Summary

Four commits on this branch, loosely independent but all sitting on the dev-personas foundation.

  • User switcher (f6b49bc). Sidebar-bottom account affordance with popover, persona submenu (dev-only), inline sign-out. Three canonical dev personas (Drew / Sam / Jules) seeded into a shared Bench org (pro plan) — the migration-seeded default org repurposed. Dev-impersonate authorize is now lookup-only for preset personas; free-form emails still fall back to solo-org provisioning. DEV_PERSONAS centralized in web/lib/auth/dev-personas.ts and consumed by seed, /login, and the switcher.
  • Brand refresh (85af8fc). Tag-drop logo replaces the pin-drop monogram in the sidebar + favicon. Accent nudged from #ff6600#ff6a1a (the dark-mode variant, slightly hotter for navy contrast).
  • Items page fetch hardening (aec5668). fetchItems no longer silently blanks the UI on a failed response. 401 → redirect to /login?next=<path>. Other errors → keep last-known items + categories + show a red "Showing cached data — " banner with retry.
  • Spec audit (2da3a61). Agent-driven prune of specification/ against the code: ~1400 lines of shipped behavior removed, load-bearing design rationale and open questions kept. Four new specs (Specify phase): taxonomy-synonyms.md, measure-family.md, item-graphics.md, user-menu.md. Two consolidations (item-maintenance.mditem-management-design.md, storage-definition-design.mdstorage-model.md). ai-collaboration-poc-to-production.md renamed to ai-collaboration-notes.md — it's a meta essay, not a product spec. CLAUDE.md spec index regenerated. v3 UI-kit handoff bundle landed at ui_kits/.

Test plan

  • cd web && npm run dev against local Docker Postgres (docker-compose.dev.yml).
  • /login renders three dev personas — Drew, Sam, Jules — with role + platform-admin badges.
  • Sign in as Drew. Sidebar-bottom switcher shows avatar + name + Pro · Member. Click → popover with Settings / Appearance (disabled) / Keyboard shortcuts (disabled) / dev persona submenu / Sign out.
  • Dev-block persona submenu lists all three personas; current is marked; clicking another triggers signIn("dev-impersonate", …) and the page reloads as that user.
  • As Sam: Sidebar shows Admin role badge. As Jules: shows Platform admin badge and the Platform admin row appears in the menu above Settings.
  • /items renders 20 global items in The Bench org.
  • Click a category filter — categories list stays populated (does NOT blank to "No categories"). Items refilter.
  • Delete the authjs.session-token cookie in devtools; reload /items — redirects to /login?next=/items... (no silent blank).
  • Favicon + sidebar monogram both show the tag-drop silhouette.
  • Accent color on buttons / active nav / focus ring is #ff6a1a.
  • npx tsc --noEmit --skipLibCheck clean.
  • Spot-check specification/ — all cross-refs resolve; CLAUDE.md spec index under 150 lines and matches the directory.

Notes

Four new specs are not yet implemented. Each carries a Status block and open questions. user-menu.md is marked Partially shipped — avatar + sign-out live; dev switcher shipped; Settings routes forward-looking.

Branch name (feat/dev-user-selector) predates the scope creep; the user switcher work grew into brand, items fix, and spec cleanup. Split into focused commits for review.

NickyDoes added 4 commits April 23, 2026 20:04
- Centralize DEV_PERSONAS in web/lib/auth/dev-personas.ts; consumed
  by seed, login page, and UserSwitcher.
- Seed script renames the migration-seeded `default` org to `bench`
  (The Bench, plan=pro) and provisions Drew (member), Sam (admin),
  Jules (member, isAdmin platform admin) with correct memberships.
- Dev-impersonate authorize now lookup-only for preset personas;
  fallback to solo-org provisioning for free-form emails.
- New sidebar-bottom UserSwitcher (client) + UserSwitcherShell
  (server) — popover trigger, persona submenu gated by devMode,
  inline sign-out. Appearance + keyboard-shortcuts rows shipped as
  disabled stubs.
- Sidebar accepts a `footer` slot so the shell mounts cleanly.
- Login page DEV_USERS trimmed to the 3 canonical personas with
  role + platform-admin badges.
- README + CONTRIBUTING: dev setup uses local Docker Postgres
  (never remote), `.env.local`, `db:migrate` + `db:seed` steps.
- Sidebar monogram swapped to the v3 tag-drop logo.

orgs.plan enum extended to include "pro" (prior: free/paid only).
Per the v3 design-kit delta:
- App favicon (web/app/icon.svg) → tag-drop silhouette
- Tailwind `--color-accent` bumped from #ff6600 to #ff6a1a
  (the dark-mode variant, slightly hotter for contrast on navy)
- Tag-drop SVG + favicon copied to web/public for direct refs

Sidebar monogram update came in with the previous commit since it
shares the Sidebar.tsx footer-slot edit.
Previous behavior silently wrote [] to items/categoryCounts when
the API returned a non-success payload (e.g. {"error":"unauth"}
with status 401 after a stale session). Categories panel and items
grid both blanked with no signal.

Now:
- Check res.status. On 401, push to /login?next=<current path>.
- On any other non-OK, keep last-known items + categories in state
  and surface a red-banner "Showing cached data — <msg>" with a
  Retry button at the top of FilterPanel.
- Only write state when the response is OK and has the expected
  shape (Array.isArray guards).
Agent-driven audit of specification/ against the code — prunes
sections that only described shipped behavior, keeps load-bearing
design rationale + open questions. ~1400 lines pruned, ~180 added.

New specs (all Specify phase, not implemented):
- taxonomy-synonyms.md — aspect/parameter aliases for cross-trade
  vocabulary. Canonical-display-only, item-entry authoring path.
- measure-family.md — unit-aware value equivalence (TPI ↔ pitch,
  inch ↔ mm, °C ↔ °F). Storage canonical-only; entry/search
  converts. Pairs with synonyms for the full cross-trade story.
- item-graphics.md — per-item SVG wireframe for fast visual scan
  in the grid. Text column, sanitized on save, currentColor.
- user-menu.md — sidebar-bottom account affordance. Partially
  shipped; dev-persona + settings structure forward-looking.

Consolidations:
- item-maintenance.md folded into item-management-design.md
  (UC-4/5/7/8 + cross-cutting).
- storage-definition-design.md folded into storage-model.md
  (continuous-dim UI + resolved questions).
- ai-collaboration-poc-to-production.md renamed to
  ai-collaboration-notes.md — it's a meta essay, not a product spec.

Pruned (sections that only described shipped UI behavior):
- deployment.md §Future work — reduced to a pointer at
  auth-roadmap.md
- storage-navigator-design.md — ~75% cut, kept vocabulary, undo
  rationale, provisional/co-storage concepts
- storage-definition-design.md — fully folded (see above)
- item-management-design.md — kept load-bearing decisions +
  deferred list; dropped shipped layout prose
- taxonomy-management-design.md — kept access model + deletion
  policy; dropped shipped layout
- interface-type-management.md — kept invariants; dropped shipped
  CRUD flow
- location-tracker-ux-issues.md — filed done items to "Shipped"
- item-maintenance.md — removed shipped UC-1/2/3/6 (now in
  item-management-design.md)

CLAUDE.md spec index regenerated to match the new file list (21
entries, was 13).

UI kit v3 bundle landed at ui_kits/ for future design handoffs —
includes the WhereTF design system (colors/type tokens, logo
assets, icons, marketing + app kits, chat transcripts).
@ndemarco ndemarco merged commit c00ba7a into main Apr 24, 2026
2 of 3 checks passed
@ndemarco ndemarco deleted the feat/dev-user-selector branch April 24, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant