fix(compact-bar): forward wheel to exact focused pane - #20
Conversation
Replace compact-bar wheel-to-switch-tabs with coordinate-aware scroll actions aimed at the focused terminal pane. Resolve focus per client, use the current pane geometry, and leave plugin or empty targets untouched so terminal mouse protocol, alternate-screen fallback, and normal scrollback continue through the existing core path. Add focused unit coverage, record the behavior change in the changelog, and keep the classic tab-bar unchanged. Authored-By: codex <agents@vetcoders.io> session_id: 01a01c6a-1eac-7761-b669-d95c024963cd time: 2026-08-21T21:28:06+02:00 runtime: codex
There was a problem hiding this comment.
An organization admin can view or raise the cap at claude.ai/admin-settings/claude-code. The cap resets at the start of the next billing period.
Once the cap resets or is raised, reopen this pull request to trigger a review.
|
🤖 Hi @m-szymanska, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
Apply rustfmt to the source-manifest-dir expression introduced at the current develop tip. The formatting and Ubuntu test jobs both stop at this shared precheck before exercising the compact-bar change. Authored-By: codex <agents@vetcoders.io> session_id: 01a01c6a-1eac-7761-b669-d95c024963cd time: 2026-08-21T21:31:29+02:00 runtime: codex
There was a problem hiding this comment.
Pull request overview
This PR updates the compact-bar plugin so mouse wheel events over the one-row chrome no longer switch tabs, and instead forward a coordinate-aware scroll action into the currently focused terminal pane for the current client. This aligns wheel behavior with user expectations (scroll continues uninterrupted) while relying on Zellij’s existing scrollwheel handling to preserve mouse-reporting TUIs, alternate-screen fallback, and normal scrollback behavior.
Changes:
- Replace compact-bar wheel-to-tab-switching with wheel forwarding to the focused terminal pane via
Action::Scroll{Up,Down}At. - Track the latest
PaneManifestin plugin state to compute a safe “center of focused terminal content” target coordinate. - Add unit tests covering coordinate selection and edge cases (plugin-only focus / empty content surfaces), and add the needed
zellij-utilsdependency.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| default-plugins/compact-bar/src/main.rs | Stores PaneManifest and forwards wheel events to the focused terminal using coordinate-aware scroll actions; adds tests for the new behavior. |
| default-plugins/compact-bar/Cargo.toml | Adds zellij-utils dependency for Position. |
| CHANGELOG.md | Documents the compact-bar wheel behavior fix. |
| Cargo.lock | Locks the new dependency edge for zellij-utils. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8227a06134
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
default-plugins/compact-bar/src/main.rs:655
forward_scroll_to_focused_panedrops wheel events whenpane_manifestdoesn't yet contain the focused pane (eg early startup / stale manifest). That can make scrolling over the compact bar intermittently do nothing. Consider falling back toget_pane_info(focused_pane_id)to compute a content-center position when the manifest lookup fails, so wheel forwarding remains reliable.
fn forward_scroll_to_focused_pane(&self, scroll_up: bool) {
let Ok((_, focused_pane_id)) = get_focused_pane_info() else {
return;
};
let Some(position) = focused_terminal_content_center(focused_pane_id, &self.pane_manifest)
Add a pane-id-bound mouse-scroll plugin contract carrying a content-relative position and line count. Route it synchronously to the tab containing that exact pane, preserving mouse-aware TUI events, alternate-screen arrows, and ordinary scrollback without coordinate hit testing or active-tab races. Use the focused terminal cursor from compact-bar, with a content-center fallback, and cover plugin API roundtrips plus exact local mouse coordinates. Authored-By: codex <agents@vetcoders.io> session_id: 01a01c6a-1eac-7761-b669-d95c024963cd time: 2026-08-21T20:47:03Z runtime: codex
Query PaneInfo for the exact focused PaneId at wheel time instead of depending on the latest PaneUpdate snapshot. This removes the early-startup and stale-manifest no-op window while retaining the pane-id-bound routing contract. Authored-By: codex <agents@vetcoders.io> session_id: 01a01c6a-1eac-7761-b669-d95c024963cd time: 2026-08-21T20:52:38Z runtime: codex
|
Follow-up |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
zellij-utils/src/plugin_api/plugin_command.rs:1483
- Same as
MouseScrollUpInPaneId: decodingpositionviatry_into()will silently wrap/truncate negative or oversizedint64values coming from a plugin. This new plugin->host API should reject out-of-range positions explicitly before creating the internalPosition.
let position = payload
.position
.ok_or("MouseScrollDownInPaneId requires a position")?
.try_into()?;
Reject negative or unrepresentable content-relative mouse coordinates before constructing Position from the plugin protobuf payload. Cover both scroll directions and all line/column range boundaries. Authored-By: codex <agents@vetcoders.io> session_id: 01a01c6a-1eac-7761-b669-d95c024963cd time: 2026-08-21T21:10:00Z runtime: codex
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d64396a4de
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Require WriteToStdin for pane-targeted mouse scroll commands and stream alternate-screen key writes instead of allocating one vector per requested line. Extend the faux-scroll integration test to cover the pane-ID path. Authored-By: codex <agents@vetcoders.io> session_id: 01a01c6a-1eac-7761-b669-d95c024963cd time: 2026-08-21T21:48:13Z runtime: codex
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fd2e051b93
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
bbd4c22 to
77b1718
Compare
Reject pane-targeted mouse-scroll requests above 100 lines at both serialization and host decoding boundaries. Document the limit and cover both directions plus the accepted boundary. Authored-By: codex <agents@vetcoders.io>
77b1718 to
bdc031e
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bdc031ed69
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Clamp large compact-bar wheel deltas to the shared host limit, revalidate stale cursor positions against current pane dimensions, and refresh the bundled plugin artifacts and checksum receipt. Authored-By: codex <agents@vetcoders.io>
|
Final verification for
All review threads are resolved. The installed Vibecrafted runtime and active sessions were not modified. |
Summary
WriteToStdinfor third-party callers because the contract can synthesize terminal inputWhy
The product compact-bar is a non-selectable one-row chrome surface, but it consumed wheel input to switch tabs. Moving the pointer across the top row therefore interrupted scrolling in the active Codex or shell pane.
The initial coordinate-only implementation reused ScrollUpAt and ScrollDownAt. Review correctly identified that this could hit an overlapping pinned or floating pane, race with a tab switch because run_action dispatches on another thread, and use an arbitrary point in a mouse-aware TUI. The final implementation binds the event to the exact PaneId and local cursor position before it enters the screen queue.
Verification
Runtime note
The locally built binary and WASM were not projected into the installed Vibecrafted runtime, so the active user session remained untouched. Runtime mouse behavior should be smoke-tested in an isolated session before release.
Known develop CI debt
The current develop tip contains stale snapshots from the earlier Quick cmd key change from Super+k to Shift+Super+period. The compact-bar tests pass in the No Web run, but the shared zellij-utils snapshot suites fail afterward:
zellij-utilstest jobs on Windows, macOS, and Ubuntu: the same 2 KDL snapshots plus 4 stale setup snapshots9a07c5938,fb979323f) against snapshots last synchronized by31dfa9353Updating the six
zellij-utilsgenerated snapshots alone is roughly 3,200 lines of churn; the E2E snapshots are a separate existing chrome drift. Both are deliberately kept out of this focused behavior PR. These failures are inherited from base configuration/chrome versus snapshot mismatches rather than introduced by this diff.Additional CI flake observed
The final pre-hardening SHA Ubuntu build and runtime triage passed. On two earlier attempts, the Ubuntu build itself also passed. Its post-build runtime process-boundary triage failed twice for different timing-sensitive reasons: attempt 1 received empty/non-JSON pane inventory for
Needs attention; attempt 2 timed out waiting for aNewTabacknowledgement in a headless transcript scenario. Cleanup passed in both receipts, and the same Ubuntu build+triage job passed on the preceding PR SHA6294ccb26. No mouse-scroll or plugin-API test failed in these attempts. This is recorded as CI instability rather than patched into this focused PR.