Skip to content

feat(gui): 60 FPS draggable sidebar divider with visual hover indicator - #48

Open
felipecm-br wants to merge 1 commit into
Blankeos:mainfrom
felipecm-br:feat/draggable-grab-column-hover
Open

felipecm-br wants to merge 1 commit into
Blankeos:mainfrom
felipecm-br:feat/draggable-grab-column-hover

Conversation

@felipecm-br

@felipecm-br felipecm-br commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR enhances the draggable sidebar divider with a visual grab column indicator and smooth 60 FPS mouse drag responsiveness.

Changes & Improvements:

  1. Visual Grab Column & Hover Feedback:

    • Computes a dedicated 1-column separator (grab_column) in normal horizontal layout between the sidebar panels and the main/diff panel.
    • Renders a clean separator (│) at rest matching border styles.
    • Highlights the entire separator column using theme.selected_bg and theme.accent when hovered or actively dragged.
    • Enables terminal mouse motion reporting via DEC 1003h (\x1b[?1003h) so hover states update cleanly when moving the cursor across the divider.
    • Restores terminal mouse mode (\x1b[?1003l) cleanly in both restore_terminal and the panic hook.
  2. 60 FPS Responsive Dragging:

    • In input_wait_timeout(), previously only asynchronous operations dropped the poll timeout to 16ms. During mouse drag resizing, it was constrained to 5 FPS (200ms) or 20 FPS (50ms).
    • Added self.sidebar_resizing to the 16ms condition so dragging gestures are smooth at ~60 FPS without triggering unnecessary Git state reloads.
  3. Tests & Formatting:

    • Added unit test grab_column_layout_and_resizing_timeout verifying the 1-char layout strip and the 16ms timeout during active drag.
    • All 372 unit tests passing; code formatted with cargo fmt.
screenrecording-2026-10-09_20-41-07.mp4

- Reserve a 1-column visual grab strip between sidebar and main panel in normal layout
- Highlight grab strip with theme selected_bg and accent color on mouse hover and drag
- Cap frame rate to 16ms (~60 FPS) in input_wait_timeout during active sidebar resizing
- Enable terminal mouse motion tracking (DEC 1003h) with safe teardown in restore_terminal and panic hook
- Add unit tests for grab_column calculation and 16ms resizing timeout
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