feat(): update panel scroll for events#49
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.swift—ThinScrollersnow forcesscrollView.scrollerStyle = .overlay, so the scrollbar floats overcontent 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)ScrollViewReader, tag each row with.id(event.id), and onselectedIDchangeproxy.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 itselfto 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.
EventRowtitle now has.lineLimit(1)+.truncationMode(.tail)so a long title can no longer wrap and inflate row height,
distorting rows below it.
Snoozehint (opacity 0.35 when theselected row isn't snoozable) so the strip never reflows as
selection moves between event types.
Sis still wired to fireonly on snoozable rows, so the dim state matches behavior.
panel/Panel.swift(panel sizing)panelDefaultSize).contentMinSize+ newpanelMinWidth/panelMinHeightconstants used byloadSavedPanelSize). Returning users with a smaller saved sizeget clamped up on next launch, so the permission-event footer
always fits.
panel/Panel.swift(Usage tab)expose a programmatic delta-scroll API, so
scrollUsageBywalksthe AppKit hierarchy via
findScrollView(in:)and nudges theNSScrollView'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 (3permission, 3 stop, including one with a long title and one with a
long message). Verified:
…; rows below stay aligned.last row clears the footer fully.
and stop rows; Snooze dims/un-dims rather than appearing/vanishing.
still hides; other keys remain swallowed.
Related issues
—