Skip to content
This repository was archived by the owner on Oct 21, 2026. It is now read-only.

feat(web): switch the sidebar between provider profiles - #32

Merged
donnes merged 3 commits into
mainfrom
t3code/profile-switcher
Sep 28, 2026
Merged

donnes merged 3 commits into
mainfrom
t3code/profile-switcher

Conversation

@donnes

@donnes donnes commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

People who work for several companies keep a provider profile per company, but the sidebar mixed every company's threads together.

  • A profile switcher above the thread list scopes threads, drafts and the project filter to one profile, all profiles, or projects without one ("Unassigned", only when some exist). Hidden until a profile exists.
  • Each profile counts threads waiting on you (approvals, questions, failures, unread completions); a dot on the switcher flags work waiting in other profiles.
  • New profile.showAll / profile.select.1-9 keybindings (default Mod+Alt+0–9), rebindable in Settings → Keybindings.
  • The sidebar follows the project you open: a thread from another profile (notification, search, link) or another project for a draft switches to its profile. Picking a profile by hand while a thread is open sticks.
  • Profile resolution lives in @t3tools/client-runtime/state/profile-scope so web and mobile agree; profiles merge across environments by id. The choice is stored per device.

Upstream files touched only at small seams marked Fork (profiles) (Sidebar.tsx, AppSidebarLayout.tsx), plus the keybinding contract/defaults and one package export.

Verification: vp test run packages/client-runtime/src/state/profileScope.test.ts apps/web/src/profileScope plus keybinding tests; web typecheck; exercised in a dev build with seeded profiles (switching, counts, shortcut, follow rule).

Screenshots (demo data)

Before After
Sidebar before Sidebar scoped to Acme

Profile menu with waiting counts and shortcuts:

Profile menu

Stack (review bottom-up):

  1. Usage keybinding sort order
  2. Sidebar profile switcher
  3. Icon-rail sidebar
  4. Settings → Profiles
  5. Mobile profile filter (this PR: 2)

Done by Claude Opus 5.5 (1M context) in Claude Code, running in T3 Code.

🤖 Generated with Claude Code

@github-actions github-actions Bot added size:XL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Sep 28, 2026
Base automatically changed from t3code/usage-keybinding-order to main September 28, 2026 20:33
donnes and others added 3 commits September 28, 2026 17:33
People who work for several companies keep a provider profile per company, but the sidebar mixed
every company's threads together.

- A profile switcher above the thread list scopes threads, drafts and the project filter to one
  profile's projects, all profiles, or projects without one ("Unassigned", only when some exist).
  It stays hidden until a profile exists.
- Each profile shows how many threads wait on the user (approvals, questions, failures, unread
  completions); a dot on the switcher flags work waiting in other profiles.
- `profile.showAll` and `profile.select.1-9` keybindings (default Mod+Alt+0-9) pick a profile in
  menu order and can be rebound in Settings → Keybindings.
- The sidebar follows the project you open: a thread from another profile, via notification,
  search or link, or another project for a draft, switches to its profile. Picking a profile by
  hand while a thread is open sticks.
- Profile resolution lives in `@t3tools/client-runtime/state/profile-scope` so web and mobile agree;
  profiles merge across environments by id. The choice is stored per device.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Review fixes for the sidebar profile switcher:

- A project grouped across environments can have members in different profiles; choosing it now
  intersects its members with the active profile instead of showing other profiles' threads and
  drafts.
- The follow rule tracks the route's thread or draft as well as its project, so opening another
  thread of the same project from search or a notification switches back after a manual choice.
  A manual choice still holds until the next navigation.
- Profile scope values are tagged (`profile:<id>`), so profiles named "All" or "Unassigned" no
  longer collide with the special scopes. The stored choice moves to a v2 key.
- "Unassigned" with no unassigned projects left resolves to all profiles, matching the menu,
  without forgetting the stored choice.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Knip flagged four exports used only inside their own modules at this layer: the shared
`resolveProjectProviderProfileId`, `profileScopeOfProject` and `projectMatchesScope`, and the
switcher's `ProfileAvatar`. The shared test also imports with the `.ts` extension the
client-runtime package's typecheck requires.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@donnes
donnes force-pushed the t3code/profile-switcher branch from 1f5665c to 027b05a Compare September 28, 2026 20:33
@donnes
donnes enabled auto-merge (squash) September 28, 2026 20:34
@donnes
donnes merged commit 3a18b21 into main Sep 28, 2026
15 checks passed
@donnes
donnes deleted the t3code/profile-switcher branch September 28, 2026 20:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size:XL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant