Repository navigation
Make the overlay's presentation lifecycle and the font and caret measurement states explicit - #941
Merged
Merged
Conversation
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
FuJacob
force-pushed
the
cleanup/presentation-2
branch
2 times, most recently
from
November 23, 2026 02:11
c9fa568 to
2f1f2f1
Compare
FuJacob
force-pushed
the
cleanup/presentation-2
branch
from
November 23, 2026 03:19
2f1f2f1 to
946e498
Compare
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
Replaces the loose flags, optionals and parallel collections that encoded state machines in the presentation layer with explicit types, so the legal states are the only representable ones. Observable behavior is unchanged.
OverlayControllertracked what is on screen and what is being held back from it in five fields (state,inlineSession, a show token,panelHeldForCapture,heldPresentationText) that every entry point reset by hand. They are now one pure value,OverlayPresentationLifecycle: a presentation (hidden / inline with its session / card) plus an optional hold (caret lag, or a pixel read that may have taken the panel down). Every show and hide retires the hold in one transition, an inline session exists only while an inline ghost is presented, and a late pixel read can land only if nothing was asked of the overlay since.stateandheldPresentationTextare derived from it, so theSuggestionOverlayControllingcontract is the same.PixelCaretLocatorexposes onestatus(of:)(unknown / capturing / measured / failed) instead of two probes the controller combined, keeps "waiting on a capture" and "failed" as one entry per request, and carries the failure as a typed reason instead of a mutable string that the debug dump re-derived.TypefaceProgress(unmatched(misses:)/matched(record)) withwantsMatchandadvancedas its transitions.HostFontRegistry's two index maps, no-fonts set and trust-verdict map are one per-bundle state (untrusted / no fonts / indexed);HostBundledFontRegistry's names map and scanning set are one per-bundle scan state.Tests: transition tests for the lifecycle value, the first tests that drive a real
OverlayControllerthrough show, hold, advance and hide, status tests for the locator, and a miss-counting test for typeface progress. The existing calibrator typeface tests are repointed atTypefaceProgress.Validation
swiftlint lint --strict --quiet: cleanxcodegen generate: committed project matchesproject.yml(only the new files are added)python3 -m unittest discover -s scripts/tests: passedxcodebuild build-for-testingthenxcodebuild test-without-building(scheme Cotabby, Debug, macOS):Executed 3012 tests, with 37 tests skipped and 0 failures (0 unexpected)on the final commit. That is 30 more than main at the same point: the new lifecycle, controller, locator-status and typeface-progress tests.Not verified by a live run: the pixel-capture hold needs Screen Recording and a host that exposes a union-run paragraph, so that path is covered by the pure lifecycle tests rather than through the real controller.
Linked issues
None
Risk / rollout notes
Cotabby.xcodeprojis regenerated for one new source file and two new test files.TypefaceEvidence.verdictdrops a branch that could not be reached: a switched family that still fits every long sample is already returned by the check above it.ClickAwayMonitor(added in Share the overlay layer's capture, panel and palette code and remove its dead seams #934) gains thenonisolated deinit {}that the repo's other stored-property@MainActorclasses carry. One is released every time the emoji picker or macro preview closes, so its deinit must not go through the back-deployed isolated-deinit shim that over-frees on macOS 15.tearDown.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no actionable regression was found.Summary
The PR replaces related flags and collections with explicit states for overlay presentation, caret measurements, and font matching.
No actionable issues were found. macOS tests and live panel behavior were not run in this Linux environment.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD Show[Show suggestion] --> Retire[Retire previous hold] Retire --> Caret{Caret ready?} Caret -->|No| Hold[Hold requested text] Caret -->|Yes| Present[Present inline text or card] Hold --> Result[Pixel read returns] Result --> Current{Ticket still current?} Current -->|Yes| Show Current -->|No| Ignore[Ignore old result] Hide[Hide overlay] --> Clear[Retire hold and hide panel]Reviews (4) · Last reviewed commit: "Make the presentation layer's implicit s..." · Reviewed by Greptile