Repository navigation
Speed up the Sessions locale hit-testing suite - #122
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain, and the changes address geometry caching and hit-testing regressions while preserving fresh validation for live input and approvals.
No open issues 🎉
What changed in this PR
This pull request speeds up the Sessions locale hit-testing suite by caching geometry during unchanged render and hit-test passes while preserving fresh passes for live input and approval validation.
Changes:
- Adds pass-local caches for dashboard, detail-control, approval-button, and monitor-area geometry.
- Updates locale hit-testing tests to reuse cached geometry across repeated cell checks.
- Adds regression coverage for approvals that disappear between hit-testing passes.
| File | Description |
|---|---|
| internal/ui/monitor_summary.go | Defines reusable pass-local geometry cache structures and size-keyed layout caching. |
| internal/ui/monitor_prompt_test.go | Reuses one hit-test pass for wrapped composer assertions. |
| internal/ui/monitor_efficiency_test.go | Adds geometry-equivalence and expired-approval regression tests. |
| internal/ui/monitor_detail_activity.go | Caches detail-control layout calculations during a geometry pass. |
| internal/ui/monitor_context.go | Creates fresh hit-test passes and reuses cached approval-button geometry. |
| internal/ui/monitor_approval_test.go | Reuses one hit-test pass for rendered approval target assertions. |
| internal/ui/model.go | Caches the base dashboard layout during a geometry pass. |
Review effort: Lite
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.
Why
The macOS v0.36.0 release localisation job timed out twice without reporting a failed assertion. The largest measured hotspots were approval-target checks and long wrapped-composer checks, which probe many cells in one unchanged frame for every locale. The release-only timeout adjustment is already on main and is not part of this PR.
Changes
Local measurements
Five runs on the same Linux checkout with race detection and coverage: approval rendered targets went from about 4.3 s to 1.4 s per run, and wrapped composer hit targets from 4.7 s to 1.0 s. GitHub CI will measure the effect on macOS and the complete locale matrix.
Verification