Skip to content

Migrate panel resize to pointer events - #4784

Closed
btli wants to merge 10 commits into
omnigent-ai:mainfrom
btli:pollux/touch-p0-resize-panel
Closed

Migrate panel resize to pointer events#4784
btli wants to merge 10 commits into
omnigent-ai:mainfrom
btli:pollux/touch-p0-resize-panel

Conversation

@btli

@btli btli commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Part of #4790

Related issue

N/A — implements TR-6, TR-7, and TR-9 from the touch interaction specification.

Summary

  • Migrates useResizablePanel from window-level mouse events to captured pointer events so mouse, touch, and pen resize the shared right-side panels.
  • Aborts cleanly on pointer cancellation, capture loss, and unmount; ignores concurrent pointers; preserves keyboard resizing, width persistence, desktop gating, and iframe shielding.
  • Returns touch-action: none plus an invisible 44px cross-axis hit target entirely through handleProps, without consumer changes.

ELI5: The resize strip now holds onto the first finger or stylus that grabs it, keeps receiving movement even when the pointer crosses other content, and lets go safely if the browser cancels the gesture.

pointerdown -> capture first pointer -> pointermove updates width
                                 |-> pointerup persists width
                                 |-> cancel/capture loss cleans up
second pointer -----------------------> ignored

Test Plan

  • npx -y -p node@22 -p pnpm@11.15.1 -c 'node --version && pnpm --version && pnpm install --frozen-lockfile'
  • cd web && npx -y -p node@22 -c './node_modules/.bin/vitest run src/hooks/useResizablePanel.test.tsx && ./node_modules/.bin/tsc -b'
  • Mutation check: restored the old mouse-only hook while retaining the new tests; 5 tests failed for pointer capture, pointer cancellation, capture loss, first-pointer-wins, and touch affordances. Restoring the implementation returned the suite to 8/8 passing.
  • Staged pre-commit hooks passed, including web Prettier, oxlint, and TypeScript type check. The all-files run passed every hook except pyrefly, which discovered zero Python files because this worktree lives under the parent repo's ignored .worktrees directory.

Demo

Workspace-panel seam touch-drag validated live on foldable and tablet — smooth tracking, clamps, persistence; adjacent content scroll unaffected.

Type of change

  • Bug fix
  • Feature
  • UI / frontend change
  • Refactor / chore
  • Docs
  • Test / CI
  • Breaking change

Test coverage

  • Unit tests added / updated
  • Integration tests added / updated
  • E2E tests added / updated
  • Manual verification completed
  • Existing tests cover this change
  • Not applicable

Coverage notes

Focused hook tests cover pointer capture and release, cancellation, capture loss, concurrent pointer arbitration, persistence timing, and returned touch affordances.

Changelog

Resize right-side panels with touch or a stylus using a larger, easier-to-grab handle.

Signed-off-by: Bryan Li <bryan.li@gmail.com>
@github-actions github-actions Bot added the size/L Pull request size: L label Aug 14, 2026
btli added 2 commits August 13, 2026 19:17
Signed-off-by: Bryan Li <bryan.li@gmail.com>
Signed-off-by: Bryan Li <bryan.li@gmail.com>
Signed-off-by: Bryan Li <bryan.li@gmail.com>
@github-actions github-actions Bot added size/XL Pull request size: XL and removed size/L Pull request size: L labels Aug 14, 2026
btli added 3 commits August 14, 2026 04:27
Signed-off-by: Bryan Li <bryan.li@gmail.com>
Signed-off-by: Bryan Li <bryan.li@gmail.com>
Signed-off-by: Bryan Li <bryan.li@gmail.com>
@btli

btli commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

Tribunal attestation (automated multi-engine review): CLEAN

Both blocking engines (codex + claude_code) attested head dc874c369 after 5 review rounds. Final seam geometry: 6px outward sliver (clear of the transcript scrollbar thumb band), 8px inward annex (stops at FilesPanel's own px-2 padding), 12px coarse / 10px fine reserved gutter — 26/24px effective touch targets, matching the pattern attested on #4780/#4781/#4786. All findings fixed, none dismissed; budget caps pinned by mutation-verified guard tests. Full record in .pollux/review-ledger.md.

Signed-off-by: Bryan Li <bryan.li@gmail.com>
btli added 2 commits August 14, 2026 09:17
Signed-off-by: Bryan Li <bryan.li@gmail.com>
Signed-off-by: Bryan Li <bryan.li@gmail.com>
@btli
btli marked this pull request as draft August 15, 2026 14:15
@btli btli closed this Aug 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Closed. If you want to pick this back up, comment /reopen. GitHub only lets maintainers press the Reopen button, so this command does it for you. It needs the source branch to still exist.

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

Labels

size/XL Pull request size: XL waiting-for-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants