Repository navigation
REOPEN-F7: a hidden sidebar icon button registers its tooltip when it first shows (stacked on #33112) - #33113
Conversation
…OPEN-F7, red) A reopened window's sidebar makes 5 icon buttons per workspace row, hidden until hover, and each made its icon image at init: about 4 ms of the profiled window build before the first frame (profile 8, SidebarIconButton.renderIcon). These tests fail at the base: a hidden button, or one in a hidden row, already has its image.
…t at init (REOPEN-F7) Each workspace row makes 5 icon buttons (close, audio, pin, tree fold, more) that stay hidden until the pointer is on the row; each made its template image (an NSImage with a bitmap per scale) at init. Profile 8 (cmux19, job 72f71795): SidebarIconButton.renderIcon about 4 ms and the buttons' own layout 2 ms of the window build before the first frame. renderIcon now returns while the button is hidden or in a hidden row. It runs when the button shows (viewDidUnhide, also sent for an ancestor), joins a window, lays out, or is asked its intrinsic size. An icon, label or symbol change on a hidden button draws when it shows. The look does not change: a shown button has its image before it draws. The shared glyph bitmaps (#32481) stay as they are. Sidebar-Look: no visual change
…ws (REOPEN-F7, red) Each workspace row's hover-only buttons registered their themed tooltip (a tracker in the tooltip table, a tracking area) at init, before the first window frame: about 1 ms profiled (profile 8). Fails at the base: a hidden button already has its tracker.
…ws (REOPEN-F7) Each workspace row's hover-only icon buttons put a tracker in the tooltip table and a tracking area on themselves at init, before the first window frame (TooltipTracker.setWhole, about 1 ms profiled in profile 8), though a hidden button cannot be hovered. applyToolTip registers the label as the themed tooltip once the button shows (unhide, also of an ancestor, or joining a window). Until then it sets only the VoiceOver help, so a hidden button still has its help. A tooltip already registered follows a label change at once. Sidebar-Look: no visual change
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
web and size checks: green Shipped in:
|
This comment has been minimized.
This comment has been minimized.
… placeholder The green step 6bc3ff4c failed: a hidden button's image read as a 1 x 1 NSImage, the same object in every test. AppKit answers a button that has no image of its own with a shared placeholder, so image == nil never held. The test now counts an image as the icon only when it is at least 2 points wide. Sidebar-Look: no visual change
…wn state (green step 1844f51d) aShownButtonHasItsImageInAWindowAndWithoutOne failed at d567840: a button outside a window, asked its intrinsic size, kept AppKit's 1 x 1 placeholder image, because the check was image == nil and a button with no image of its own answers that placeholder. A stack or a constraint reading that size would size the button 1 x 1. The check is now renderedSize == 0 (no icon made yet). Sidebar-Look: no visual change
…f7-lazy-button-image
…tip reads back with no window (review P1, red) Review of #33113 at e2c9ba9: showPriority sets the Priority bell's themedToolTipShortcut on a sidebar that may have no window yet. With the deferred registration, TooltipTracker.setWhole(nil, shortcut:) returned early and the shortcut was lost (SidebarIconMeaningTests. thePriorityBellNamesItsDotAndKeepsTheShortcutApart fails too). These tests fail at e2c9ba9. The earlier tests now check the tooltip tracking area, not the tracker table: the deferred part is the hover tracking, not the text. Sidebar-Look: no visual change
… only its tracking area (review P1) Review of #33113 at e2c9ba9 (P1): showPriority sets the Priority bell's themedToolTipShortcut on a sidebar that may have no window yet. The deferred registration made TooltipTracker.setWhole(nil, shortcut:) return early, so the bell lost its shortcut, and themedToolTip read nil before the button showed (SidebarIconMeaningTests.thePriorityBell...). Now the tracker always records the text and the shortcut. Only the hover tracking area waits: NSView.defersThemedToolTipTracking (opt-in; only SidebarIconButton sets it, the 127 other themedToolTip users do not change) keeps the area off while the view is hidden or has no window, and themedToolTipCanShow() adds it when the button shows (viewDidUnhide, viewDidMoveToWindow, and now viewDidMoveToSuperview, the review's P3: a move from a hidden to a shown superview in the same window). VoiceOver's help is set with the text, as before. Sidebar-Look: no visual change
It shows only on hover of an expanded pinned row (layoutPin through setHoverShown, which unhides a hidden view the same way), and the row's first layout hid it anyway. Hidden at init, it makes no image before the first frame, as the close, audio and tree fold buttons. Sidebar-Look: no visual change
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
|
Review (subagent opus): SHIP at 9c4e4b7
|
…f7-lazy-button-tooltip # Conflicts: # Packages/macOS/CmuxNext/Sources/CmuxNextSidebar/Views/SidebarIconButton.swift
|
Review (subagent opus): SHIP at 1845245 |
…le (fixes base red from #33113) (#34033) #33113 added super.viewDidMoveToSuperview in SidebarIconButton (an NSButton). NSButton inherits it from NSView. Probed with check-objc-selectors.py --probe --write. Agent-Session: https://cmux.com/deeplink/agent?id=aid-d750cf10922c785efa64 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Was stacked on #33112, which merged at 14:43Z; feat-cmux-next is now merged in (head 1845245).
REOPEN-F7. Profile 8 (cmux19, job 72f71795e8b896e2f54c5ad4) puts
TooltipTracker.setWhole(a tracker in the tooltip table and a tracking area) at about 1 ms (profiled) of the window build. It ran at init for every row's hidden hover-only icon buttons, which cannot be hovered while hidden.Fix: the tooltip's text and shortcut are recorded at once, as before; only the hover tracking area waits.
NSView.defersThemedToolTipTracking(opt-in; onlySidebarIconButtonsets it, the other 127themedToolTipusers do not change) keeps the tracking area off while the view is hidden or has no window, andthemedToolTipCanShow()adds it when the button shows (viewDidUnhide,viewDidMoveToWindow,viewDidMoveToSuperview). VoiceOver's help is set with the text.Review at e2c9ba9 found a P1 in the first version (it deferred the whole registration): the Priority bell, whose shortcut
showPrioritysets while the sidebar may have no window, lost its "⌥⌘K" (SidebarIconMeaningTests.thePriorityBellNamesItsDotAndKeepsTheShortcutApart). Fixed at 2e8574d. No look change (Sidebar-Look: no visual change).Gain
Gain: 108-112 fewer tooltip tracking areas per launch (the same 4 hidden icon buttons per workspace row; 24-25 rows plus 3 spare rows in the realistic launch). Count tests:
SidebarIconButtonLazyTooltipTestsred on base (steps c2a86828, 6270511b), green on head (step 0b2c0164). Time gain 1-4 ms main-thread CPU, under the bench's noise (measured together with #33112); no regression (A/B cmux21, 20 launches per arm). Accepted under the HOT PATH AUDIT rule (handoff/hot-path-audit/README.md item 3).Testing
aShortcutSetBeforeTheButtonShowsIsKept,theTooltipReadsBackBeforeAWindowAndTracksOnlyOnceShownon e2c9ba9): step 6270511b7b2d10eb40ae5335 failed as expected (text and shortcut nil before the button shows).SidebarIconButtonLazyTooltipTests: a hidden button has no tracker but has its VoiceOver help; it gets its tooltip when shown; a label change while hidden shows the new label;showsLabelToolTip = falseregisters none.ThemedTooltipTestsstill passes (no AppKittoolTip, help equals the label).Review
Review subagent: SHIP at 9c4e4b7 (comment 6601489848), after its P1 at e2c9ba9 was fixed. After #33112 merged, feat was merged in (conflict in SidebarIconButton.swift only, the #33112 lines next to this PR's): SHIP at 1845245 (comment 6607407510); the 3 changed files are byte-identical to 9c4e4b7.
Observed / Not run
Changelog
none