Repository navigation
perf(welcome): own the toolbar and search in AppKit - #4415
Merged
Merged
Conversation
datlechin
marked this pull request as ready for review
November 23, 2026 01:43
datlechin
enabled auto-merge (squash)
November 23, 2026 01:43
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
NSToolbar: New Connection and New Group (NSToolbarItem), View Options (NSMenuToolbarItem, built when it opens) and Search (NSSearchToolbarItem), in the places SwiftUI put them..searchable,.toolbarandsceneBridgingOptions. Panes, rows, sheets and alerts stay SwiftUI.NSSplitViewItemAccessoryViewControlleron macOS 26 and later, a bar at the top of the list pane with a separator before 26. Built when the first tag turns on.NSTextSuggestionsDelegate); choosing one filters by the tag and clears the text. In today's Release build on macOS 27.0.1, typing a tag name suggests nothing. On 13 and 14 tags come from View Options. Tokens inside the field are gone: AppKit has no public API for them.sceneBridgingOptionsis 14+, so the bridged items never reached the window there.WelcomeViewModel.searchTokens([WelcomeTagToken]) becomestagFilterIds: [UUID]plus a publishedtagFilterthat the bar and the glyph render.WelcomeToolbarTestsis rewritten (theWelcomeWindowsubclass that re-fixed a SwiftUI-installed toolbar is gone, and its two tests with it);WelcomeViewModelTestsfollows the rename, andtestDeletingTheLastTaggedConnectionDropsItsTokenFromTheSearchis nowtestDeletingTheLastTaggedConnectionDropsItsTagFilter.New Connection, ButtonNew Group, MenuButtonView Options, none with an identifier; the search field keepswelcome-toolbar-search. A tag toggle in the bar is a CheckBox.ConnectionSeedtakes preset tag ids.Measurements
apple/scripts/release/build.sh app arm64 --unsigned.TABLEPRO_UI_TEST_SANDBOXseeded with 50 connections in groups with tags. Interleaved, random order per round, one discarded warm-up each, n=10 per side, load1 4.3 to 6.7. LaunchTracer (TABLEPRO_LAUNCH_TRACE=1) for stages; main-thread and process CPU read at thefirstFramePresentedmark.applicationCreated(NSApplication.shared, before any code this PR touches) is +64 ms in this run. With the copy order swapped (load 22 to 35, n=5) that gap shrank to 21 ms while the new build still used less main-thread CPU and 1.15 billion fewer instructions; an arm64-thinned copy of the old build (load 30 to 48, n=10) gave -42 ms main-thread CPU. The window build and CPU numbers are this change; the early gap is launch environment.Per run, load1 at launch
Screenshots
Two tag filters on (production, testing). Before: tokens in the search field, set from View Options. After: the bar above the list, set by typing each tag and picking its suggestion.
Test plan
WelcomeToolbarTests,WelcomeTagSuggestionsTests,WelcomeTagFilterBarTests: toolbar order, labels and Icon Only; View Options sort, tags, Match, Clear Filters and the filled glyph; search field and query in step; Return focuses the list; suggestions on 15+; the bar's toggles, Any/All, Clear Filters, and the bar coming and going on the split item.WelcomeConnectionListUITests.testTheToolbarFiltersByTagAndSearchesTheList: View Options by label, a tag filter shows the bar and hides untagged rows, clicking the tag removes it, Cmd-F into the toolbar search, typing narrows, Return selects the first match.