fix(desktop): pass shell hotkeys and pointer gestures through page panes

Merged
KI
3mo ago
+690-202

What & why

Page iframes swallow shell keyboard and pointer input. Forward configured shell shortcuts from focused host subframes to their window's renderer, sharing chord synchronization and replay with browser webviews. Activate page panes on frame pointer presses and share pointer passthrough during pane drags, resizing, and browser popovers.

The verification follow-up also fixes the narrow forwarding allowlist for both surfaces: split/layout actions, sidebar toggles, new terminal/browser tabs, close-tab, Changes, Quick Open, command palette, Resources, and New Workspace. Equalize and assigned directional pane-focus bindings are included. Document editing/find/reload shortcuts retain their existing handling. Tests cover remaps, unassignment, and platform-specific bindings.

How I tested it

  • Real app, matched worktree: renderer localhost:6825, CDP 9568; authenticated local session. Real CDP mouse input + native keyboard input, with focus, geometry, tab/pane counts, route, dialogs, console errors, and screenshots recorded.
  • Before/after for all 13 missing shell actions: failed from embedded content before this follow-up; passed afterward with IFRAME or WEBVIEW focused. Page split-right changed 2 → 3 panes and width 549.5 → 272.25 px. Browser splits changed 1 → 2 panes. Sidebar toggles changed/restored geometry. Creation/search/resource actions produced the expected tabs, dialogs, or routes.
  • Close-tab passed from both: browser 4 → 3 tabs; page 3 → 2, without closing the host window. Existing previous/next tab variants rechecked; earlier numbered-tab checks covered all nine targets.
  • Earlier pointer checks passed native pane drop, reverse drop, cancel, split/sidebar resize, oscillation/dwell and induced stalls; pointer passthrough returned to inactive after the gestures.
  • 65 focused tests pass / 150 assertions across BrowserManager, forwarding, pointer passthrough, and browser registry. Forwarding tests also pass with Linux and Windows platform detection (33 each; not native GUI certification).
  • bun run lint:fix, bun run lint, bun run typecheck --filter=@superset/desktop --filter=@superset/ui, bun run check:plugins, and git diff --check pass. No user-facing strings changed.

Remaining verification limits

  • Full desktop suite: 3583 passed, with the existing sidebar DnD React.createContext is not a function test-loading error on both Bun 1.3.11 and pinned 1.3.14. The sidebar suite passes 8/8 in isolation. Full monorepo rerun reached 21 successful tasks but failed in desktop on that error and a git-test timeout. This is not a full-suite-green claim.
  • Native zoom/edit E2E checks remain inconclusive; custom directional bindings/equalize/desktop split have unit coverage only. V2 has no reopen-tab handler; forwarding REOPEN_TAB supports the existing legacy handler, not a new v2 reopen feature.
  • Screenshots and detailed matrix are saved locally in .superset/reports/hotkey-verification.md and /tmp/pages-hotkey-pr.VGdA1K/. Refused/stale-target test attempts were excluded from accepted results.

Checklist

  • Conventional-commit title
  • Maintainers can edit this same-repository branch
  • Lint and changed-package typechecks pass
  • Before/after native keyboard verification for the repaired shell actions in both pane types
  • Full test suite / CI green
  • Complete native zoom/edit shortcut verification

Summary by CodeRabbit

  • New Features

    • Keyboard shortcuts now continue working when focus is inside embedded pages, webviews, iframes, or PDF content.
    • Embedded page interactions can automatically focus the active pane.
    • Pointer interactions pass through embedded content during supported gestures, including resizing, menus, and native dragging.
    • More workspace, pane, sidebar, browser, and command shortcuts are supported within embedded content.
  • Bug Fixes

    • Improved handling of forwarded keyboard shortcuts and pointer events across embedded content.
    • Prevented unsupported shortcuts from being unnecessarily intercepted.