Sidebar user switcher + brand v3 + spec audit#11
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four commits on this branch, loosely independent but all sitting on the dev-personas foundation.
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 (proplan) — the migration-seededdefaultorg repurposed. Dev-impersonate authorize is now lookup-only for preset personas; free-form emails still fall back to solo-org provisioning.DEV_PERSONAScentralized inweb/lib/auth/dev-personas.tsand consumed by seed,/login, and the switcher.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).aec5668).fetchItemsno 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.2da3a61). Agent-driven prune ofspecification/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.md→item-management-design.md,storage-definition-design.md→storage-model.md).ai-collaboration-poc-to-production.mdrenamed toai-collaboration-notes.md— it's a meta essay, not a product spec.CLAUDE.mdspec index regenerated. v3 UI-kit handoff bundle landed atui_kits/.Test plan
cd web && npm run devagainst local Docker Postgres (docker-compose.dev.yml)./loginrenders three dev personas — Drew, Sam, Jules — with role + platform-admin badges.Pro · Member. Click → popover with Settings / Appearance (disabled) / Keyboard shortcuts (disabled) / dev persona submenu / Sign out.signIn("dev-impersonate", …)and the page reloads as that user.Adminrole badge. As Jules: showsPlatform adminbadge and the Platform admin row appears in the menu above Settings./itemsrenders 20 global items in The Bench org.authjs.session-tokencookie in devtools; reload/items— redirects to/login?next=/items...(no silent blank).#ff6a1a.npx tsc --noEmit --skipLibCheckclean.specification/— all cross-refs resolve;CLAUDE.mdspec 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.mdis 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.