Skip to content

feat(): update panel scroll for events#49

Merged
StuBehan merged 1 commit into
StackOneHQ:mainfrom
StuBehan:feat-panel-handling
May 20, 2026
Merged

feat(): update panel scroll for events#49
StuBehan merged 1 commit into
StackOneHQ:mainfrom
StuBehan:feat-panel-handling

Conversation

@StuBehan

@StuBehan StuBehan commented May 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Panel layout + scrolling fixes for the Events and Usage tabs: stop the
events list shifting left when the scrollbar appears, keep the selected
event in view, prevent the footer hint strip from reflowing, and give
the panel enough default/min width to actually fit the permission-event
footer. Also adds Up/Down keyboard scrolling on the Usage tab.

Changes

  • panel/Components.swiftThinScrollers now forces
    scrollView.scrollerStyle = .overlay, so the scrollbar floats over
    content instead of claiming layout width and shifting rows left (which
    is what users with "Show scroll bars: Always" in System Settings would
    otherwise see).
  • panel/Panel.swift (Events tab)
    • Wrap the events list in ScrollViewReader, tag each row with
      .id(event.id), and on selectedID change proxy.scrollTo(..., anchor: .center)
      with a 0.15s easeOut — arrow-key navigation now keeps the selection
      in view instead of letting it leave the viewport.
    • .frame(maxHeight: .infinity) on the ScrollView so it bounds itself
      to the panel's available area (mirrors the prior Usage fix); split
      vertical padding into 4pt top / 8pt bottom so the last row clears
      the footer.
    • EventRow title now has .lineLimit(1) + .truncationMode(.tail)
      so a long title can no longer wrap and inflate row height,
      distorting rows below it.
    • Footer always renders the Snooze hint (opacity 0.35 when the
      selected row isn't snoozable) so the strip never reflows as
      selection moves between event types. S is still wired to fire
      only on snoozable rows, so the dim state matches behavior.
  • panel/Panel.swift (panel sizing)
    • Default size 420×280 → 600×320 (panelDefaultSize).
    • Minimum 340×240 → 560×260 (contentMinSize + new
      panelMinWidth / panelMinHeight constants used by
      loadSavedPanelSize). Returning users with a smaller saved size
      get clamped up on next launch, so the permission-event footer
      always fits.
  • panel/Panel.swift (Usage tab)
    • Up/Down arrows now scroll the Usage ScrollView. SwiftUI doesn't
      expose a programmatic delta-scroll API, so scrollUsageBy walks
      the AppKit hierarchy via findScrollView(in:) and nudges the
      NSScrollView's clip view by 40pt, clamped to
      [0, docHeight - clipHeight].

Testing

  • swift build — clean.
  • make reload, then sent 6 mixed test events at the panel socket (3
    permission, 3 stop, including one with a long title and one with a
    long message). Verified:
    • Scrollbar appearance no longer shifts rows left.
    • Long title row truncates with ; rows below stay aligned.
    • Arrow-down past the visible area scrolls the selection into view;
      last row clears the footer fully.
    • Footer strip width is stable as selection moves between permission
      and stop rows; Snooze dims/un-dims rather than appearing/vanishing.
    • Cmd+1-4 and Cmd+← / Cmd+→ still cycle tabs.
    • On the Usage tab, Up/Down arrows scroll the quota tier list; Esc
      still hides; other keys remain swallowed.

Related issues

@StuBehan StuBehan merged commit 28ef097 into StackOneHQ:main May 20, 2026
4 checks passed
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