Skip to content

Share fullscreen image drawing across backends - #27

Merged
merefield merged 4 commits into
masterfrom
codex/deduplicate-fullscreen-image
Nov 9, 2026
Merged

merefield merged 4 commits into
masterfrom
codex/deduplicate-fullscreen-image

Conversation

@merefield

@merefield merefield commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Changes

  • Share fullscreen row centring, pane, footer and incremental redraw between Kitty and symbol backends. Preserve backend-specific redraw loops and the raw Sixel path.
  • Share arrow and wheel selection across Topics, Search and Notifications. Keep pagination and activation in each view.
  • Share responsive label tier selection between tabs and footer controls.
  • Centralise PM username normalisation, self-exclusion and deduplication, with a regression test for fallback order.

Verification

  • Formatting, go vet ./..., go test -race ./... and the CLI build passed.
  • The trusted duplication check passed against master. exact-50 dropped from 8 matches to 3 and exact-100 dropped from 1 to 0.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@merefield
merefield merged commit 80a0d11 into master Nov 9, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants