Skip to content

fix(sidebar): keep the hover peek under a drag and for keyboard focus - #3074

Merged
devswha merged 4 commits into
mainfrom
fix/sidebar-peek-drag
Nov 5, 2026
Merged

devswha merged 4 commits into
mainfrom
fix/sidebar-peek-drag

Conversation

@devswha

@devswha devswha commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #3070, the follow-up to #3067 (Settings → Appearance → Show the sidebar on hover, opt-in, off by default).

 useSidebarPeek
-  sidebar element learned from pointerenter            (keyboard-only use skipped the hold check)
+  sidebarRef on the <aside>
+  hold while a row is dragged in it (dragstart/dragend), and after a drop on it until the pointer moves
-  hold for a row menu anchor in the sidebar
+  hold for any menu/popover in the sidebar (the usage popover) or a menu it opened (anchor aria-haspopup + aria-expanded)
 Escape
-  refused whenever a field in the sidebar had the focus (an empty filter kept the peek forever)
+  an open menu or dialog anywhere, or a field whose Escape does something (rename, filter with words), takes it first;
+  an empty filter's Escape hides the peek

Why the drag broke it: Chromium fires pointercancel and pointerleave on the <aside> when a native drag starts, so the close grace started mid-drag. After a drop it reports no pointer position until the next move, so a drop on the sidebar holds the peek until that move; the move then either re-enters it (pointerenter) or leaves it with the grace already running.

Validation

  • scripts/sidebar-peek-demo-regression.ts gains two steps, each failing first:
    • a filter focused by keyboard on a fresh page, before the pointer entered the sidebar, holds the peek, and Escape in the empty filter then hides it (fails on main: hidden after the grace, and Escape never hides it);
    • a workspace row dragged inside the peek keeps it under the drag and after the drop (fails without the drag hold: "kept under a drag").
  • bun scripts/sidebar-peek-demo-regression.ts: PASS at 1280 and 390, dark and light.
  • bun test src/lib/sidebarPeek.test.ts pass; bun run check fast pass (typecheck, build, unit 12400 pass / 0 fail).
  • Not run locally: bun run check full and the rest of the browser lane (CI).

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 42f4a9a and ee07ec7.

Files selected for processing: 6

  • DESIGN.md
  • changelog.d/sidebar-hover-peek-drag.md
  • docs/development.md
  • scripts/sidebar-peek-demo-regression.ts
  • src/App.tsx
  • src/lib/sidebarPeek.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@devswha

devswha commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

Review summary (omo + Codex Terra xhigh). Verdict CLEAR at 7106973.

Fix round (8dedcb3), from the first review's reproduced MEDIUM: when the peek hides with the focus in it (an empty filter's Escape), the focus now goes to the sidebar toggle instead of falling to the page; the regression asserts it (failed first). Escape now yields only to a modal dialog, a menu/popover the focus is in or on, or a sidebar field whose Escape does something; the drag flag is also cleared by a drop/dragend reaching the window.

Remaining, all LOW and unreproduced (left as notes, no follow-up issue):

  • A palette-opened temporary filter, emptied, closes itself and the peek on the same Escape (only with the always-on filter turned off).
  • A right-click row menu takes the focus on the next frame; an Escape before that frame closes both the menu and the peek.
  • If a dragged agent row unmounts mid-drag and the drop is cancelled, the drag flag may stay set until Escape or a toggle click.
  • A row dragged out of the peek to split the pane keeps the peek over part of the drop area for the drag.
  • The hook's new rules are covered by the Playwright demo regression, not by hook-level unit tests.

Validation at 7106973 (merge with main): bun run check fast pass (unit 12410 / 0 fail); bun scripts/sidebar-peek-demo-regression.ts PASS at 1280 and 390, dark and light.

@devswha

devswha commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

Local merge gate (owner-approved): bun run check fast passed at this head (12416/0), omo CLEAR at this head, threads resolved, merges cleanly; failing-first regression steps pass at 1280/390 light/dark. Fixes #3070 (follow-up of #3067). Merged without waiting for GitHub CI.

@devswha
devswha merged commit 0dfc06e into main Nov 5, 2026
10 of 11 checks passed
@devswha
devswha deleted the fix/sidebar-peek-drag branch November 5, 2026 22:11
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.

Sidebar hover peek hides while a row is dragged in it

1 participant