Skip to content

Open recent thread actions on hold - #4813

Merged
ymichael merged 3 commits into
mainfrom
bb/open-thread-actions-on-recents-long-press-thr_bhfr2v3qnd
Oct 5, 2026
Merged

ymichael merged 3 commits into
mainfrom
bb/open-thread-actions-on-recents-long-press-thr_bhfr2v3qnd

Conversation

@ymichael

@ymichael ymichael commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Mobile home recent rows only offered navigation and hierarchy toggling, with no long-press thread actions. Opening a drawer during a hold also lets the release click land on the new backdrop, dismissing the menu immediately when the row sits above it.

What changed

Wrap mobile recent rows in the shared long-press menu and reuse the existing thread actions and section-move lifecycle. While a long-press menu is open, capture the pending release click across its portals; a fresh pointer or keyboard interaction clears suppression. Releasing a hold keeps the drawer open, while short taps still navigate and movement, early release, and cancellation abort the hold. Recent rows disable native text selection during Safari holds. Story fixtures supply the actions provider. No public API, CLI, daemon protocol, or data changes.

How you verified

Both the row and backdrop-release regressions fail before their fixes. Turbo runs pass 50 focused tests across recents, thread actions, long-press menus, and composer actions; app lint and typecheck pass. Final-head actual-app Chromium touch emulation covers hold/release without navigation, correct-thread Pin persistence, movement/scroll/pointer cancellation, early release, short taps, dismissal/repeated holds, mouse click/hold, context menu, and keyboard Enter. Trusted Maestro gestures in iOS Simulator Safari cover hold/release, repeat/dismiss, short tap, and swipe cancellation. Physical iPhone input was not tested.

Final head: 9a65a2d. All 34 final-head CI checks completed: 31 passed, 3 skipped. An isolated optimized review build is running at https://ymichael--23903.getbb.app/. Choose New thread, then hold a labelled [Seeded QA] recent row. The canonical reviewer handoff is maintained in the owning BB thread storage.

AGENT GENERATED

@ymichael
ymichael merged commit 3a55ed1 into main Oct 5, 2026
34 checks passed
@ymichael
ymichael deleted the bb/open-thread-actions-on-recents-long-press-thr_bhfr2v3qnd branch October 5, 2026 16:33
ymichael added a commit that referenced this pull request Oct 9, 2026
…5275)

## Human comments

## What was wrong

When the sidebar row layer moved into the thread-list plugin (#4036),
about seventeen components were copied instead of moved. The app and the
plugin each kept a copy, and the copies drifted: different touch delays,
a release-click fix only in the app, extra rename features only in the
plugin, and a fourth confirm dialog in the tasks plugin. Separately,
bb's core `sidebar.collapsed*` UI preferences were left behind when the
plugin migrated its own preferences. The app kept writing all six, only
`sidebar.collapsedThreads` still had a reader (mobile recents), and that
made recents' collapse state sync across devices by accident.

## What changed

Three commits. Each component now has one home, placed by the rule now
written down in `docs/forkable-plugins.md` ("What belongs in
shared-ui"):

1. **Shared presentation primitives go to `packages/shared-ui` and the
plugin registry.** These are `use-dialog-state`,
`use-drag-click-suppression`, `use-reorder-dnd`,
`use-sidebar-reorder-dnd`, `sortable-motion`, `compact-long-press-menu`,
`action-menu-items`, `confirm-delete-dialog`, `rename-dialog`,
`inline-rename`, `inline-rename-editor`, `sidebar-visibility-customize`,
`sidebar-customize-panel`, `sidebar-row-classes`,
`sidebar-hover-actions`, `context-selection` and
`thread-list-empty-state`. Where the app and the plugin need different
behaviour, the difference is a prop:
- Each side passes its own touch sensor: the app's drawer-aware one, and
the plugin's 500 ms long-press one from #4329.
   - The app renders the inline rename editor through its lazy split.
   - `MachineRenameDialog` uses the shared `RenameDialog` shell.
- The tasks plugin's `ConfirmDialog` is replaced by
`ConfirmDeleteDialog`, which gains `className`, `size` and
`confirmDisabled` props.
2. **The thread status glyph is host-rendered through the SDK.** The app
still draws the glyph in the palette, related threads and mobile
recents, so the host now exposes it as `experimental_ThreadStatusGlyph`
(`indicator`, `archived`, `rowStatus`, `hideIdleDraftLabel`, `size`),
and the plugin deletes its copy. The plugin still resolves the indicator
itself, which lets it fold in collapsed children and drafts.
- The SDK test fake exposes the requested indicator as data attributes.
- Glyph rendering tests moved to the app's `ThreadStatusGlyph.test.tsx`.
   - SDK bumped to 0.6.36; the thread-list SDK floor is now 0.6.36.
- Added an `api_to_audit.md` entry and the Plugin Guide surface symbols.
3. **Mobile recents keeps its collapse state on the device.** It is
stored in local storage under `bb.mobileRecents.collapsedThreads`.
`useMobileRecentsThreadReveal` replaces the app's sidebar reveal hook
and keeps the one behaviour recents used: navigating to a thread, or a
thread becoming unread, opens its collapsed ancestors. The six
`sidebar.collapsed*` keys leave the UI preference registry, the demo
server and `docs/configuration.md`. The server already ignores stored
rows for unknown keys. The thread-list migration no longer reads them.

No server/daemon wire changes. Net −1,769 non-test lines (+399 generated
registry JSON).

**User-visible differences:**
- The plugin's long-press menus now swallow the click that follows a
long press (#4813), as the app's already did.
- `MachineRenameDialog` now returns focus to the opener after closing.
- Tasks confirm dialogs clear their content while closing.
- Mobile recents collapse no longer syncs across devices, and starts
expanded once per device.
- An install that has not started bb since 2026-09-21 loses its old
sidebar collapse state.

## How you verified

Ran with `pnpm exec turbo run typecheck lint test` on the touched
packages:

| Package | Tests |
|---|---|
| app | 5,640 |
| thread-list | 451 |
| tasks | 412 |
| db | 615 |
| client-core | 279 |
| domain | 220 |
| plugin-sdk | 368 |
| plugin-build | 165 |
| plugin-api-docs | 73 |
| demo-server | 15 |
| plugin-registry | 1 |

All pass. The server UI preferences test file also passes (18 tests).

- **Lint:** 0 errors.
- **Typecheck:** clean, except one error that already fails on main from
#5098 (`lazySecondaryPanelComponents.tsx:287`), in a file this PR does
not touch.
- **Fork check:** `pnpm check:plugin-forks plugins/thread-list
plugins/tasks` passes.
- **SDK version guard:** `check-plugin-sdk-version.mjs` passes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

> AGENT GENERATED

---------

Co-authored-by: qa <qa@x>
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