Skip to content

[codex] Add compact right panel swipe gesture#493

Closed
harveyfullstack wants to merge 21 commits into
ymichael:mainfrom
harveyfullstack:bb/add-left-swipe-gesture-thr_6waaekx8i9
Closed

[codex] Add compact right panel swipe gesture#493
harveyfullstack wants to merge 21 commits into
ymichael:mainfrom
harveyfullstack:bb/add-left-swipe-gesture-thr_6waaekx8i9

Conversation

@harveyfullstack

Copy link
Copy Markdown

Summary

Adds a compact-viewport left swipe gesture for the right panel, matching the existing mobile left-pane swipe affordance. The gesture is shared by thread detail and root compose, and routes through the same open actions as the existing right-panel buttons so root compose still creates/reveals a new tab when needed.

Validation

  • pnpm exec turbo run test --filter=@bb/app -- src/views/RootComposeSecondaryContent.test.tsx src/views/thread-detail/ThreadDetailSecondaryContent.test.tsx
  • pnpm exec turbo run typecheck --filter=@bb/app
  • pnpm exec eslint apps/app/src/components/secondary-panel/useCompactSecondaryPanelSwipeOpen.ts

Full pnpm exec turbo run lint --filter=@bb/app still fails on existing unrelated app-wide lint errors outside this change.

harveyfullstack and others added 21 commits July 3, 2026 16:49
Codex's generic "warning" channel carries internal, unactionable notices
(e.g. plugin hook-config parse failures). bb classified it as coverage
"unknown", so the dev build surfaced each as a raw provider/unhandled row.
Reclassify to "noise" and drop it at the source. Structured configWarning
and deprecationNotice keep their handled path and still render.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add an `annotation` PromptInput variant (path + line range + quoted code +
comment) and carry it end to end: domain schema + shared text renderer,
all provider adapters (codex/claude/acp render to text; pi lowers to text),
draft state mapping, and the shared timeline projector + DTO. UI layers
(composer chip, timeline chip, selection popup, touch fix) follow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add addAnnotation/removeAnnotation to the draft store, an AnnotationsConfig
+ AnnotationPreview chip tray in the promptbox, and thread the config plus
the submitted-draft annotations through the new-thread and follow-up
composers so pending annotations render as chips and are sent on submit.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add ConversationAnnotations and thread row.annotations through the timeline
into the user message bubble, so sent line-range comments render as chips
beside attachments.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Open a comment box on line-range drag release (fixing the touch case where
the menu only opened via a hover-only gutter button), lift it above the
soft keyboard, and route the range + comment into the composer as a pending
annotation via a small composer context — no prop threading through the
diff/secondary-panel stack.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The comment box is a text field the user types into, not a transient menu:
drop the scroll-to-dismiss (touch drag-select's settle-scroll fired right
after open, closing it instantly) and let Radix autofocus the textarea
natively instead of a deferred manual focus. Make the persisted-draft
annotations field optional so parse round-trips omit an empty array.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Re-applies the hook/started + hook/completed noise reclassification (the
earlier standalone branch was reverted; only the generic-warning fix reached
main). Codex hook lifecycle is the user's local plumbing, not thread content.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two real causes, both proven in a touch-emulated browser repro:
- The secondary-panel diff/code renders via FilePreview, a second
  usePierreLineSelectionActions caller that was never wired to the
  annotation composer, so onSelectionAnnotate was undefined there and the
  legacy add-to-chat menu showed instead of the comment box. Wire it.
- On touch the diff sits inside a vaul modal drawer that aria-hides
  everything outside its subtree, so the comment popover portaled to
  <body> rendered but was hidden. Portal it into the drawer (transform is
  none once settled, so viewport anchoring stays correct).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The visibility reclassification only stops new turns; rows persisted as
provider/unhandled before it still render in dev. Filter codex hook/started,
hook/completed, and generic warning provider/unhandled rows at the timeline
projection so old threads read clean too.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
With the soft keyboard open, a plain tap on the popover buttons first
blurred the textarea, closed the keyboard, and reflowed the box out from
under the finger, so the click never landed. Fire the actions on
pointerdown with preventDefault so they run before the blur/reflow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Root cause (touch-only, confirmed by investigation): the comment popover
autofocused its textarea, opening the soft keyboard, and useSoftKeyboardInset
then repositioned the box via live collisionPadding — so the button moved out
from under the finger before pointerdown resolved. Fixes:
- Suppress autofocus on coarse pointers (mirrors the drawer shell's guard),
  so touch opens the box without the keyboard/reflow; tap to type.
- Buttons use onMouseDown+preventOverlayTriggerSelection + onClick (the
  TimelineSelectionMenu pattern) so focus/keyboard stay put and the tap lands.

Design-system reuse pass:
- SelectionAnnotationPopover now uses the shared Textarea and Button
  primitives and preventOverlayTriggerSelection instead of hand-rolled markup;
  content class mirrors the shared PopoverContent tokens.
- Annotation chips (composer + timeline) match the sibling AttachmentPreview /
  ConversationAttachments chip styling (border-border bg-surface-recessed),
  dropping invented values.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The anchored popover was fundamentally fragile on touch: autofocusing the
textarea opened the soft keyboard, and the live keyboard-inset repositioning
moved the buttons out from under the finger, so a tap on Add to chat landed
on the textarea instead ("tap consumer"). On coarse pointers, render a stable
bottom sheet fixed to the drawer bottom and lifted by the keyboard inset as a
single unit — autofocus works and the buttons stay put. Desktop keeps the
anchored popover. Both share one AnnotationCommentForm (shared Textarea/Button).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…cripts

[codex] Add worktree lifecycle scripts
Soft keyboards have no Esc/Tab/Ctrl/arrow keys, so the terminal was
hard to drive on phones. Render a coarse-pointer-gated key row below the
terminal that sends the raw PTY bytes a hardware key would, fed through
xterm's input() so it reuses the existing onData -> socket path.

The bar tracks the soft-keyboard inset via visualViewport and pads up to
ride above the keyboard; the terminal's ResizeObserver refits into the
remaining space. No top border since the panel already draws a divider.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@harveyfullstack harveyfullstack marked this pull request as ready for review July 4, 2026 07:20
@harveyfullstack

Copy link
Copy Markdown
Author

Closing this because it was intended for harveyfullstack/bb, not ymichael/bb. The changes have been merged into harveyfullstack/bb:main.

@harveyfullstack harveyfullstack deleted the bb/add-left-swipe-gesture-thr_6waaekx8i9 branch July 4, 2026 08:05
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