Skip to content

linux: close tab variants and 5 more action handlers#242

Merged
Jesssullivan merged 2 commits intomainfrom
sid/socket-surface-action-close-variants
Apr 19, 2026
Merged

linux: close tab variants and 5 more action handlers#242
Jesssullivan merged 2 commits intomainfrom
sid/socket-surface-action-close-variants

Conversation

@Jesssullivan
Copy link
Copy Markdown
Owner

Summary

  • Expand CLOSE_TAB to support all three ghostty close modes:
    • THIS — close current tab (existing behavior)
    • OTHER — close all tabs except current
    • RIGHT — close all tabs to the right of current
  • Add TOGGLE_TAB_OVERVIEW stub (returns false until AdwTabOverview widget is added)
  • Add TOGGLE_WINDOW_DECORATIONS — toggle CSD via gtk_window_set_decorated
  • Add MOUSE_OVER_LINK — set pointer cursor when hovering clickable links
  • Add PROGRESS_REPORT — store shell integration progress (OSC 9;4) on Panel
  • Add SCROLLBAR — accept scrollbar state (rendering deferred)
  • Add progress_state/progress_value fields to Panel struct

Action coverage: 34 of ~45 ghostty runtime actions.

Test plan

  • CI passes on all distros
  • Nix flake check passes

- Close tab modes: THIS (current), OTHER (all but current), RIGHT
  (all tabs right of current). Previously only closed current tab.
- Add TOGGLE_TAB_OVERVIEW stub (needs AdwTabOverview widget)
- Add TOGGLE_WINDOW_DECORATIONS (toggle CSD via gtk_window_set_decorated)
- Add MOUSE_OVER_LINK (pointer cursor on hoverable links)
- Add PROGRESS_REPORT (store shell integration progress on Panel)
- Add SCROLLBAR (accept scrollbar state, rendering deferred)
- Add progress_state/progress_value fields to Panel struct

Action coverage: 34 of ~45 ghostty runtime actions.
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 19, 2026

Greptile Summary

This PR expands the CLOSE_TAB handler to cover all three ghostty close modes (THIS/OTHER/RIGHT) and adds five new action handlers: TOGGLE_WINDOW_DECORATIONS, MOUSE_OVER_LINK, PROGRESS_REPORT, SCROLLBAR (no-op), and TOGGLE_TAB_OVERVIEW (stub). The Panel struct gains progress_state/progress_value fields, and previous review concerns (sentinel type, SCROLLBAR return value, Wayland log warning) have all been addressed.

Confidence Score: 5/5

Safe to merge; only a single P2 defensive-programming suggestion remains.

All prior P1 findings from the thread are resolved. The one new finding (unclamped @intcast in handleProgressReport) is P2 — it only triggers if libghostty delivers an out-of-spec value > 255 for an OSC 9;4 field defined as 0–100, which is not expected in practice.

No files require special attention.

Important Files Changed

Filename Overview
cmux-linux/src/app.zig Adds handleCloseTab with all three close modes, handleToggleTabOverview/WindowDecorations stubs, handleMouseOverLink cursor update, handleProgressReport, and handleScrollbar no-op. Logic is correct; minor P2 unclamped intCast in handleProgressReport.
cmux-linux/src/workspace.zig Adds progress_state and progress_value (?u8 = null) fields to Panel struct. The previous i8 sentinel concern has been resolved with an idiomatic optional type.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[onAction callback] --> B{action.tag}
    B --> C[CLOSE_TAB]
    B --> D[TOGGLE_TAB_OVERVIEW\nstub → false]
    B --> E[TOGGLE_WINDOW_DECORATIONS\ngtk_window_set_decorated]
    B --> F[MOUSE_OVER_LINK\nset pointer cursor]
    B --> G[PROGRESS_REPORT\nstore on Panel]
    B --> H[SCROLLBAR\nno-op → false]

    C --> C1{close mode}
    C1 -->|THIS| C2[closeWorkspace current]
    C1 -->|OTHER| C3[close all ≠ current\nreverse iterate]
    C1 -->|RIGHT| C4[close current+1 to end\nreverse iterate]

    G --> G1[find Panel by widget]
    G1 --> G2[panel.progress_state = report.state]
    G2 --> G3[panel.progress_value = clamp 0-100]
Loading

Reviews (2): Last reviewed commit: "fix: address Greptile P2 findings on PR ..." | Re-trigger Greptile

Comment thread cmux-linux/src/workspace.zig Outdated
Comment thread cmux-linux/src/app.zig
Comment thread cmux-linux/src/app.zig
- Use ?u8 instead of i8 sentinel for progress_value (idiomatic Zig)
- Return false from handleScrollbar (don't suppress libghostty fallback)
- Log Wayland CSD caveat in handleToggleWindowDecorations
@Jesssullivan Jesssullivan merged commit f56f0a7 into main Apr 19, 2026
23 of 27 checks passed
@Jesssullivan Jesssullivan deleted the sid/socket-surface-action-close-variants branch April 19, 2026 14:58
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.

1 participant