update review tab UX/introduce shift+mousewheel for scrolling

This commit is contained in:
Emil Lerch 2026-06-10 10:57:25 -07:00
parent 860d690090
commit 14f55afb28
Signed by: lobo
GPG key ID: A7B62D657EF764F8
3 changed files with 912 additions and 267 deletions

View file

@ -593,11 +593,27 @@ pub const App = struct {
switch (mouse.button) {
.wheel_up => {
self.wheelBy(-3);
// shift+wheel scrolls the viewport (look-around,
// no cursor change). Plain wheel routes through
// `wheelBy` which prefers the active tab's
// `onCursorMove`/`onWheelMove`. We pick shift
// (not ctrl) because ctrl+wheel is the
// near-universal "zoom" gesture in browsers and
// editors bending that to "scroll" would
// confuse muscle memory.
if (mouse.mods.shift) {
self.scrollViewportBy(-3);
} else {
self.wheelBy(-3);
}
return ctx.consumeAndRedraw();
},
.wheel_down => {
self.wheelBy(3);
if (mouse.mods.shift) {
self.scrollViewportBy(3);
} else {
self.wheelBy(3);
}
return ctx.consumeAndRedraw();
},
.left => {

View file

@ -456,16 +456,10 @@ pub const tab = struct {
return true;
}
/// Mouse wheel: always scroll the viewport, never move the
/// cursor. Keeps wheel-as-look-around and cursor-as-pointer
/// distinct. The framework falls through to viewport scroll
/// when this returns false.
pub fn onWheelMove(state: *State, app: *App, delta: isize) bool {
_ = state;
_ = app;
_ = delta;
return false;
}
// No `onWheelMove`: by omitting it, wheel events fall through
// to the framework's `onCursorMove` path. Wheel moves the
// cursor like j/k. PageUp / PageDown / Home / End scroll the
// viewport.
/// Pre-empt key handler. Called by the framework BEFORE
/// global keymap matching runs. When portfolio is in a

File diff suppressed because it is too large Load diff