Repository navigation
REF: share Sessions approval hit testing and filtered selection - #99
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the consolidation of approval hit testing and filtered session selection.
No open issues 🎉
What changed in this PR
This pull request consolidates Sessions approval hit testing and filtered session selection logic, reducing duplication while preserving existing UI behavior, focus handling, confirmation flows, dismissal state, drafts, and accounting.
Changes:
- Adds shared frame-local approval-button hit testing across detail modes.
- Shares filtered session selection between navigation and dismissal.
- Adds regression coverage for hit-test boundaries, filters, focus, drafts, watermarks, and accounting.
| File | Description |
|---|---|
internal/ui/monitor_selection_test.go |
Tests filtered selection, navigation, dismissal, drafts, watermarks, and accounting. |
internal/ui/monitor_profile.go |
Removes the superseded profile-specific hit-testing helper. |
internal/ui/monitor_context.go |
Reuses shared hit testing for full-detail and split-row controls. |
internal/ui/monitor_context_modes.go |
Reuses shared hit testing for expanded inline approvals. |
internal/ui/monitor_buttons_test.go |
Tests button geometry, visible-label boundaries, and confirmation-slot behavior. |
internal/ui/monitor_approval.go |
Adds the shared approval-button hit-testing helper. |
internal/ui/model.go |
Shares filtered session selection logic between navigation and dismissal. |
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
Finish the two small Sessions cleanup opportunities identified after #98: approval click geometry still repeated across detail modes, and navigation/dismissal independently built the same filtered session list. Share those rules to prevent future drift without changing the interface or widening the refactor into log scanning, scheduling or benchmark execution.
Changes
No user-visible feature, layout, colour, shortcut, API, web-interface, dependency or version changes. The local release binary is not replaced. The main-owned duplication baseline is not edited.
Measurements
Compared with main at
a955824, using its unchanged scanner and policy. All gated metrics are equal or lower, with no new production clone candidates:Production Go is 17 lines smaller; add 117 lines of regression tests without removing or weakening existing coverage. This is a modest consistency/maintenance improvement, not a binary-size or performance claim. Scanner spans are not unique removable LOC.
Validation
go test -race -cover -timeout 10m -skip '^TestLocalisedScreens$' ./....go vet ./...,go build -trimpath ./...andgit diff --checkpass.make screenshots-check.After merge and successful main CI, the existing main-only writer should automatically ratchet the baseline to these lower measurements.