Skip to content

fix(panel): restore the committed width and keep focus on pane switch - #147

Open
pratikbuilds wants to merge 1 commit into
corbitsdev:mainfrom
pratikbuilds:claude/i142-panel-ba05e1
Open

pratikbuilds wants to merge 1 commit into
corbitsdev:mainfrom
pratikbuilds:claude/i142-panel-ba05e1

Conversation

@pratikbuilds

Copy link
Copy Markdown
Collaborator

Summary

Two fixes in useResizable and PanelContent (findings 15 and 16).

  • 15, drag teardown: a drag that ends without a release (a new press on the handle, or the hook unmounting) now drops the preview and puts back the committed --resizable-width, so the CSS width and controlled state cannot diverge. The reset moves from commit into the drag's teardown, which every end path runs. Pointercancel and lost capture still commit the preview.
  • 16, pane switch: hiding a keepMounted pane that holds focus moves focus to the panel before the browser applies inert, instead of letting it fall to the page.

Not in scope: without keepMounted, the hidden pane unmounts and focus still falls to the page. That behaviour is unchanged from main.

Verification

  • bun run check
  • bun run test:e2e, with the new pane-switch case in e2e/panel.spec.ts (the notes fixture gains an "Open draft" button to focus)
  • New drag-abort cases in use-resizable.test.ts

Closes #142

A drag that ends without a release (a new press on the handle, or the hook
unmounting) now drops the preview and puts back the committed
`--resizable-width`, so CSS and controlled state cannot diverge. The drop
moves from `commit` into the drag's teardown, which every end path runs.
Pointercancel and lost capture still commit the preview, as before.

Hiding a keep-mounted pane that holds focus now moves focus to the panel
before the browser applies `inert`, instead of letting it fall to the page.

Addresses corbitsdev#142 findings 15 and 16.
@corbits-triage

corbits-triage Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Triage: Fail

@pratikbuilds, please address the following:

  • mixes unrelated changes, not part of fix(panel): restore the committed width and keep focus on pane switch

Triage will request changes.

@corbits-triage corbits-triage Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Triage requests changes:

  • Focused: mixes unrelated changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Follow-ups from the conversation PR review

1 participant