Repository navigation
Fill Quick Access auto slots from used symbols too - #247
Merged
Merged
Conversation
A used emoji filled a Quick Access auto slot; a used symbol (→) never did. Auto-fill dropped every SYM_ key from usageCounts and resolved the rest only through the emoji database. It now keeps them and resolves them through SymbolsDatabase, as pinned symbol slots already did. While the Symbols trigger is off, used symbols stay out of the auto slots; a pinned symbol still shows. Symbols typed in full (`::arrow_right:`) were never recorded as used, so they could not reach a slot either. The exact-match symbol path now goes through recordUsage like the emoji one, which also feeds the search frequency boost and the symbol telemetry count. Resolving a symbol runs the CoreText sweep on first access, and the bare-`:` pill is built inside the event-tap callback. Search, the browser and byHexcode now share one sweep (SymbolsDatabase.all), and launch runs it on a utility queue when a pin, or with Symbols on a used symbol, needs it, so the first `:` doesn't wait on it.
2 tasks done
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
Symbols you use now fill Quick Access auto slots the way emoji do. Before, a used emoji like 🧀 appeared in the bare-
:pill, the browser's Quick Access section and the Settings slot grid, and a used symbol like → never did, however often it was inserted.Engine.recordUsagecounts a symbol inusageCountsunder its syntheticSYM_…hexcode (SYM_arrow_rightfor →).QuickAccess.resolvedPerSlotdropped everySYM_key from the auto-fill pool, and resolved the rest only through the emoji database, which has no symbols. It now keepsSYM_keys and resolves them throughSymbolsDatabase, as pinned symbol slots already did; a newQuickAccess.lookupserves pinned and auto slots. Existing users who insert symbols often will see those symbols take auto slots after updating.While the Symbols trigger is off, used symbols stay out of the auto slots, as the browser already hides its symbols section then. A pinned symbol still shows: pinning it was an explicit choice.
resolvedPerSlottakes the trigger state assymbolsEnabled.A symbol typed in full (
::arrow_right:) was never counted, so it could not reach an auto slot even with that fix. The exact-match symbol path now goes throughrecordUsagelike the emoji one. Those inserts now also raise the symbol's rank in search, as a picked symbol already did, and reach the symbol telemetry count, where they were missing.Resolving a symbol needs
SymbolsDatabase.byHexcode, built by a CoreText sweep on first access (about 130 ms, measured in a unit test). The bare-:pill is built inside the event-tap callback, so left alone, the first:after launch would hold that keystroke, and the pill, for the length of the sweep. Instead, search, the browser andbyHexcodenow share one sweep (SymbolsDatabase.all; each used to run its own), and launch runs it on a utility queue when a pin includes a symbol, or, with Symbols on, stored usage does. Users who never insert a symbol don't pay for it. A:typed before the warm-up finishes waits for it, no worse than before.Sources/Mojito/EmojiDB/QuickAccessStore.swift: auto-fill keepsSYM_keys while Symbols is on;lookup.Sources/Mojito/App/Engine.swift,Browser/EmojiBrowserViewModel.swift,Settings/QuickAccessSettings.swift: pass the Symbols trigger state to Quick Access.Sources/Mojito/EmojiDB/SymbolsDatabase.swift,FuzzyMatcher.swift,Browser/EmojiBrowserViewModel.swift,Debug/DebugReport.swift: one sharedall.Sources/Mojito/App/AppDelegate.swift: the launch warm-up;CLAUDE.mdsays to useall.Sources/Mojito/App/Engine.swift: exact-typed symbols record usage.Tests/MojitoTests/FavoritesBrowseTests.swift:resolvedAutoFillsUsedSymbols(a symbol used more often than an emoji takes the first auto slot) andresolvedSkipsUsedSymbolsWhenSymbolsOff(with Symbols off, a used symbol takes no auto slot and a pinned one stays).Test plan
scripts/run-tests.shpasses.resolvedAutoFillsUsedSymbolsfails: the slots contain only the emoji. Without the Symbols-off filter,resolvedSkipsUsedSymbolsWhenSymbolsOfffails: the used symbol takes an auto slot.:shows → in the Quick Access pill.