Skip to content

fix(sidebar): stop delaying every click in the sidebar - #258

Open
barto95100 wants to merge 2 commits into
the-ora:mainfrom
barto95100:contrib/sidebar-click-delay
Open

barto95100 wants to merge 2 commits into
the-ora:mainfrom
barto95100:contrib/sidebar-click-delay

Conversation

@barto95100

Copy link
Copy Markdown

Summary

Every click in the sidebar (selecting a tab, a space, a pinned tab…) was handled about half a second late.

The double-click gesture that zooms the window (.onTapGesture(count: 2) in SidebarView) wrapped the whole sidebar. A single tap inside a view that also has a double-tap gesture must wait for the double-click interval before SwiftUI knows it is not a double click, so every tab selection waited too. Measured with timestamps: the state change and redraw take ~2 ms after the tap is recognized; the wait is entirely before it.

  • The double click now sits behind the content (DoubleClickToZoomWindow, a background with the gesture), so it only catches clicks on the sidebar's empty space and no longer delays the controls.
  • The tab list now fills the sidebar's height (GeometryReader + minHeight), so the empty space under the last tab still zooms the window on a double click, as before.
  • Window dragging is unchanged.

Type of Change

  • Bug fix
  • Design/UX improvement

Screenshots / Recordings (if applicable)

Not visual: clicks now respond immediately.


AI Assistance Disclosure

Code written with Claude (AI) under my direction; I reviewed and tested every change on macOS.


Checklist

  • Code builds successfully on macOS 14+
  • All tests pass locally
  • Code follows Ora's formatting and linting standards
  • No new warnings or errors
  • Descriptive title and summary provided
  • Screenshots attached if applicable
  • Related issues linked below

Related Issues

None (found while working on the sidebar).


Additional Notes

Tested on macOS 26:

  1. Selecting tabs and spaces responds immediately.
  2. Double click on empty sidebar space (top, bottom, under the last tab) zooms / unzooms the window.
  3. Double click on a tab does not zoom the window.
  4. Dragging empty sidebar space still moves the window.

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change affects click and window-zoom behavior in the sidebar.

The PR appears safe to merge with a non-blocking regression in double-click zoom below the tabs.

Findings

  1. P2 Empty-space zoom stops working ▶

Summary

Moves the sidebar’s double-click gesture behind its controls to avoid delaying single clicks.

  • Sidebar controls respond right away while empty-space double clicks still zoom the window.

Reviews (1) · Last reviewed commit: "fix(sidebar): stop delaying every click ..." · Reviewed by Greptile

onAddNewTab: addNewTab
)
.frame(minHeight: scrollArea.size.height, alignment: .top)
.modifier(DoubleClickToZoomWindow())

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Empty-space zoom stops working

The new DoubleClickToZoomWindow inside ContainerView reads a nil window, so double-clicking below the tabs does nothing. NSPageView creates this content in a separate NSHostingView. The closure in SidebarView passes environment objects but not the custom \.window value, which defaults to nil.

Pass window into the hosted content explicitly so this gesture can call toggleMaximized().

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch: the spaces' pages are hosted in their own NSHostingView by NSPageView, so \.window may be nil there. The gesture now zooms the window the double click happened in (NSApp.currentEvent?.window), with the environment value as a fallback. Tested: double click under the last tab zooms the window, in every space.

This branch has not been deployed

No deployments
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