Repository navigation
Keep Move, label, and collection actions in compact modals - #671
WhiskeyTuesday wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The preservation test bypasses the root model, leaving viewport changes from modal help and the disappearing link footer untested, including whether scroll offset and link selection survive dismissal.
1 open issue
What changed in this PR
Replaces full-screen mail action pickers with compact overlays in HEY’s TUI, keeping the current list or thread visible.
Changes:
- Displays Move, label, and collection choices in scrolling modal menus.
- Adds label and collection filtering, wrapped subjects, and in-menu label creation.
- Adds regression coverage and documents the new interactions.
[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or rungh pr ready --undo.
Click "Ready for review" or rungh pr readyto reengage.
| File | Description |
|---|---|
internal/tui/move.go |
Renders Move choices using the shared modal frame. |
internal/tui/mail.go |
Separates underlying mail rendering from modal rendering. |
internal/tui/mail_test.go |
Updates label-picker width and help expectations. |
internal/tui/folders.go |
Adds filtering, overlay rendering, and label-input resizing. |
internal/tui/collections.go |
Adds filtering and overlay rendering for collection membership. |
internal/tui/collections_test.go |
Updates collection-picker help expectations. |
internal/tui/action_picker.go |
Introduces shared layout, subject selection, and filter helpers. |
internal/tui/action_picker_test.go |
Covers rendering, filtered targets, Unicode, creation, and resizing. |
docs/tui.md |
Documents modal navigation, filtering, and label creation. |
Review effort: Balanced
| offset := v.topicViewport.YOffset() | ||
| switch key { | ||
| case "v": | ||
| v.startMove() |
There was a problem hiding this comment.
Fixed in ce03e30, with root-model coverage in 9bf1f84. The new tests send the supported thread shortcuts (v and b) and Escape through model.Update, covering scrolling partway down and to the bottom, with and without a selected link whose destination wraps across footer rows. They check the viewport offset and logical link selection, and compare the complete rendered screen before and after dismissal. Separate root-model tests cover v, b, and n from the mail list and preserve its cursor.
These tests reproduced the same modal layout/scroll issue reported in #670, so this independent branch includes the same fix. TUI/mail tests and lint pass; offline PTY checks on the combined build also verified rendered-screen restoration for Move and labels.

Moving a thread or changing its labels or collections currently replaces the mail screen. These short actions now open compact, scrolling menus over the current list or thread, so the email stays visible and Escape returns to the same position.
Labels and collections support typing to filter, Backspace to edit, and Ctrl+U to clear. Current memberships remain marked, and label creation stays inside the menu. The thread subject wraps above the choices when there is room, with an excerpt used only when the subject is absent. Small terminals prioritize the actions.
Uses the existing modal infrastructure. Includes coverage for filtered mutation targets, empty results, Unicode and terminal controls, label creation, resizing a long name, and preserving the underlying screen and selection.
Validation after rebasing onto f6244d7: TUI tests,
make lint, andmake buildpassed.make testfailed onlyTestFindBareLinksPastRejectedPrefixesIsLinear; the same five-second assertion fails on unchanged upstream on this machine. Focused live checks on combined build 9da3f57 passed: label/Move overlays, complete wrapped subjects, label-creation cancellation, and moving the owned fixture with server readback. Label/collection membership mutations remain model-tested; the account had no existing choices.Summary by cubic
Moving a thread or changing its labels or collections opens a compact, scrolling menu over the current mail screen instead of replacing it, so the email stays visible and Escape returns to the same position.
Written for commit 9bf1f84. Summary will update on new commits.