Skip to content

Fix compact sidebar rename and double-tap navigation - #5042

Merged
ymichael merged 2 commits into
mainfrom
bb/fix-mobile-rename-thread-and-focus-bugs-thr_4jwwrmqj5d
Oct 6, 2026
Merged

ymichael merged 2 commits into
mainfrom
bb/fix-mobile-rename-thread-and-focus-bugs-thr_4jwwrmqj5d

Conversation

@ymichael

@ymichael ymichael commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Compact sidebar rename actions replaced the row label with an inline input, making renaming depend on focus handoffs from the long-press menu. The desktop double-click gesture also ran on compact viewports, so double-tapping a thread could enter rename mode and consume navigation.

What changed

Compact menu rename now opens a shared rename dialog for threads, projects, sections, environments, and machines. It reuses the existing rename validation/save controller and touch-aware dialog focus behavior. Double-click rename is disabled on compact viewports, while desktop inline rename remains available. Rename sessions track inline versus dialog presentation, and hooks require the shared provider. No database, server/daemon wire, public SDK, or CLI changes.

How you verified

  • pnpm exec turbo run test typecheck --filter=bb-plugin-thread-list passed using Turbo's cache: 458 tests across 37 files, plus typecheck.
  • Regression coverage includes compact dialog save, failed save and dismissal, and double-tap navigation without inline editing.
  • pnpm start:worktree built successfully and started the optimized app and host daemon. Mobile manual sanity checking is pending user review.

AGENT GENERATED

ymichael and others added 2 commits October 6, 2026 09:50
On phones, Rename from the long-press menu turned the row into a
borderless inline input. After the keyboard was dismissed the input
stayed focused but looked like a normal row, and tapping it only
re-focused the input, so the row appeared stuck.

Compact menu renames now open a rename dialog rendered by
SidebarRenameProvider from the same rename session; desktop keeps
inline rename.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Double-tapping a title on a phone started the same inline editor that
traps focus once the keyboard is dismissed. On compact viewports a
double tap now leaves the row's normal tap behavior alone; rename stays
available from the long-press menu, which opens a dialog.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ymichael
ymichael merged commit b02281f into main Oct 6, 2026
41 checks passed
@ymichael
ymichael deleted the bb/fix-mobile-rename-thread-and-focus-bugs-thr_4jwwrmqj5d branch October 6, 2026 19:03
ymichael added a commit that referenced this pull request Nov 2, 2026
## Human comments

## What was wrong

Thread rename had three implementations: core's `ThreadRenameDialog`,
the thread header's own inline-or-dialog choice, and the thread-list
plugin's `SidebarRenameDialog`. Fixes such as #6119, #6364 and #5042
each landed in only some of them, so behaviour drifted. The default
dialog showed save errors as a toast, but the sidebar's showed them
inline. The empty-name messages differed. On narrow windows the
sidebar's Rename row button edited inline while its menu and the header
shortcut opened a dialog.

## What changed

- The plugin's dialog moves to shared-ui as `RenameSessionDialog` and is
published as a component registry item, so the forkable thread-list
plugin can keep importing it.
- `ThreadActionsProvider` owns one rename controller and renders that
dialog, replacing `ThreadRenameDialog`. Menus that have no editor of
their own use it.
- The thread header uses `useInlineRename`'s menu, shortcut and
double-click methods through that controller instead of reimplementing
the policy.
- `useInlineRename`'s `startEditing` follows the menu rule: a dialog on
a compact viewport or coarse pointer.

User-visible changes, all from removing the drift:
- The default dialog shows save errors in place instead of as a toast,
and says "Name cannot be empty." for an empty name.
- On narrow windows with a mouse, the sidebar Rename row button opens
the dialog.

No plugin SDK or host-daemon protocol changes. #5023 (`requestRename` in
the SDK) stays open.

## How you verified

- One presentation table (`inline-rename-presentation-cases`) runs
against both the thread header and the sidebar thread row. Reverting
`startEditing` to the old rule fails both.
- A new `ThreadActionsProvider` test covers the default dialog: a failed
save keeps it open with the error, and a retry saves and closes it.
- `turbo run typecheck lint test` passes for `@bb/app`, `@bb/shared-ui`,
`bb-plugin-thread-list` and `@bb/plugin-registry`. `node
scripts/check-plugin-forks.mjs plugins/thread-list` passes.
- I checked this in an isolated `pnpm dev` app in headless Chromium,
comparing the branch with origin/main on the same data:

| Entry point | Wide, mouse | Narrow, mouse | Narrow, touch |
| --- | --- | --- | --- |
| Header menu | inline | dialog | dialog |
| Header shortcut / command palette | inline | dialog | dialog |
| Header double-click | inline | inline | no rename |
| Sidebar menu (long-press on touch) | inline | dialog | dialog |
| Sidebar Rename row button | inline | dialog (inline on main) | hidden
|
| Sidebar double-click | inline | inline | navigates |

Everything matched main except the narrow-width row button. With a
forced 500 response, inline editing and both dialogs showed "Could not
save the name. Try again." and kept the draft (main's header dialog
showed a toast). An empty name showed "Name cannot be empty.". Saves
from the header dialog and the sidebar dialog persisted. A wide touch
screen gave dialog for the menu and shortcut, and no rename on
double-tap.

> AGENT GENERATED

Co-authored-by: Claude Opus 5.5 <[email protected]>
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