Skip to content

fix(studio): sidebar shortcut hint, wizard cache invalidate, collapsed +#40

Merged
mroops0111 merged 1 commit into
masterfrom
fix/studio-sidebar-and-wizard-invalidate
Jun 15, 2026
Merged

fix(studio): sidebar shortcut hint, wizard cache invalidate, collapsed +#40
mroops0111 merged 1 commit into
masterfrom
fix/studio-sidebar-and-wizard-invalidate

Conversation

@mroops0111

Copy link
Copy Markdown
Owner

Three latent regressions from the multi-remote workspace PR (#13, 2026-06-07) that surfaced together today when someone tried to use the wizard and G-chord shortcuts after the merge.

Bugs

  1. G-chord shortcut hint hidden by pending count (Sidebar.tsx)
    Clarify / Proposals / History rows lost their G C / G P / G H kbd hint as soon as pending count went above zero, because both badges shared one slot under a count === 0 guard.

  2. Wizard mutation doesn't invalidate per-remote workspace list (CreateWorkspaceWizard.tsx)
    onSuccess only invalidated the legacy ['workspaces'] key. Sidebar moved to per-remote ['workspaces-at', remoteId] when remotes shipped, so newly-scaffolded workspaces stayed invisible until hard reload.

  3. No `+` button when sidebar collapsed and remote already has workspaces (Sidebar.tsx)
    The Plus icon rendered only in two paths: expanded header, and collapsed-with-zero-workspaces. The third (collapsed-with-workspaces) was empty — the most common state of all. Discord's rail keeps an always-visible `+` per server group; matches that pattern.

Fixes

  1. Render the kbd alongside the count badge instead of in place of it.
  2. Add a second `invalidateQueries({ queryKey: ['workspaces-at'], exact: false })`.
  3. Append an icon-only `+` at the end of each remote's collapsed workspace list, scoped to that remote via `onOpenAdd(remote)`.

Test plan

  • `pnpm typecheck` green
  • `pnpm lint:fix` clean
  • Verified in browser: `G C` / `G P` kbd visible, collapsed `+` per-remote visible, scope correct
  • Wizard cache invalidate: visually confirm next workspace creation by opening another via Wizard

Three latent bugs introduced by the multi-remote workspace PR (#13,
2026-06-07) that only surfaced once someone tried to use the wizard
or G-chord shortcuts post-merge:

1. Sidebar.tsx: G-chord shortcut hint (G C / G P / G H / ...) was
   hidden by the pending-count badge because the two shared one render
   slot under a `count === 0` guard. Render both side by side instead;
   pending counts and shortcut affordance are independent signals.

2. CreateWorkspaceWizard.tsx: `onSuccess` only invalidated the
   legacy `['workspaces']` query key. The sidebar moved to per-remote
   `['workspaces-at', remoteId]` keys when remotes shipped but the
   wizard mutation wasn't updated, so newly-scaffolded workspaces
   didn't appear until a hard reload. Add the second invalidate.

3. Sidebar.tsx: when collapsed and a remote already had workspaces,
   the `+ Open workspace` button rendered nowhere — only the
   non-collapsed header and the collapsed-empty paths had it. Append
   an icon-only `+` at the end of each remote's collapsed workspace
   list (matches the Discord rail pattern where the add-server `+`
   is always visible in icon-only mode).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the bug Something isn't working label Jun 15, 2026
@mroops0111 mroops0111 merged commit 293e277 into master Jun 15, 2026
6 checks passed
@mroops0111 mroops0111 deleted the fix/studio-sidebar-and-wizard-invalidate branch June 15, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant