Repository navigation
Share fullscreen image drawing across backends - #27
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are identified, and the refactoring is covered by a regression test while preserving backend-specific rendering and view-specific pagination and activation behavior.
No open issues 🎉
What changed in this PR
This PR removes duplicated UI logic in internal/ui so the Kitty and symbol image backends, the Topics, Search and Notifications lists, the tab and footer label layouts, and the private message (PM) user lookup share one implementation each. Behaviour should stay the same, and the Sixel path and each view's pagination and activation logic stay where they were.
Changes:
- Fullscreen image drawing (row centring, pane, footer and incremental redraw) moves into one helper. Each backend keeps its own redraw loop and render view key.
- Arrow and wheel selection moves into one helper used by Topics, Search and Notifications.
- Responsive label tier selection moves into one helper used by tabs and footer controls. PM username normalisation, self-exclusion and deduplication are centralised, and a new test covers the fallback order.
| File | Description |
|---|---|
| internal/ui/ui.go | Topics list uses the shared selection helper. PM username handling uses one addName closure for all fallback sources. |
| internal/ui/ui_test.go | Adds a regression test that checks the PM username fallback order and normalisation. |
| internal/ui/text.go | Adds the shared labelTier type and chooseLabelTier helper for responsive labels. |
| internal/ui/tabs.go | Tab rail uses the shared label tier type and selection helper. |
| internal/ui/search_notifications.go | Search and Notifications use the shared selection helper. Pagination and activation stay in each view. |
| internal/ui/images.go | Fullscreen image and Kitty paths call one drawFullscreenImage helper, with different view keys. |
| internal/ui/controls.go | Footer control layout uses the shared label tier type and selection helper. |
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.
Changes
Verification
go vet ./...,go test -race ./...and the CLI build passed.master.exact-50dropped from 8 matches to 3 andexact-100dropped from 1 to 0.