Skip to content

feat: add Shift+wheel horizontal scroll for wide tables#24

Merged
aydiler merged 1 commit into
mainfrom
feature/table-shift-wheel
May 24, 2026
Merged

feat: add Shift+wheel horizontal scroll for wide tables#24
aydiler merged 1 commit into
mainfrom
feature/table-shift-wheel

Conversation

@aydiler
Copy link
Copy Markdown
Owner

@aydiler aydiler commented May 24, 2026

Summary

PR #23 removed forward_wheel_to_horizontal_scroll to fix #22 (cursor-over-table nudging wide tables sideways during normal document scrolling). That also reverted the issue #4 ergonomic — wide-table horizontal scroll regressed to "grab the bottom scrollbar" only.

This change reintroduces the wheel→x redirect but gates it on the Shift modifier, so:

Shift matches the browser convention for horizontal scroll and doesn't collide with anything else in the doc scroller (Ctrl is already taken by zoom).

Changes

  • New helper forward_shift_wheel_to_horizontal_scroll in crates/egui_commonmark/.../pulldown.rs — identical edge-passthrough logic to the prior helper, plus a modifiers.shift early-return.
  • Wired into both the markdown-table and HTML-table call sites by capturing the ScrollAreaOutput.
  • Docs: KEYBOARD_SHORTCUTS, ARCHITECTURE, TARGET_METRICS, LESSONS, devlog 033.

Test plan

  • cargo fmt --check — clean
  • cargo check — clean (two pre-existing warnings unrelated to this change)
  • cargo clippy --all-targets — clean (same pre-existing warnings)
  • Manual: cursor-over-table + plain wheel scrolls the document past the table without horizontal nudge.
  • Manual: cursor-over-table + Shift+wheel scrolls the table sideways; edge pass-through hands the wheel back to the document at table edges.
  • Manual: Shift+wheel with cursor NOT over a table behaves normally (no-op for tables).

Note: the egui MCP bridge has no keystroke/modifier injection so Shift+wheel behavior can't be E2E-tested via Xvfb. Manual verification on real display required before merge.

Refs #4, #22, #23.

Restores the wheel-to-x table-scroll ergonomic from issue #4 but gates it on
the Shift modifier, so plain wheel still scrolls the document (#22) while
Shift+wheel becomes the explicit opt-in for sideways table scrolling.

`forward_shift_wheel_to_horizontal_scroll` mirrors the previously-removed
helper (PR #23) with one extra early-return on `modifiers.shift`. Edge
pass-through is preserved so Shift+wheel at the table's left/right edge keeps
moving the page.

Docs updated: KEYBOARD_SHORTCUTS, ARCHITECTURE, TARGET_METRICS, LESSONS,
devlog 033.
@aydiler aydiler merged commit 4cb865c into main May 24, 2026
2 checks passed
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.

Tables scroll slightly horizontally as you scroll past them.

1 participant