TUI: replace mode-flag booleans with a single mode enum #2
Labels
No labels
needs-triage
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
arne/msg#2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The TUI model in
internal/tui/tui.gotracks UI state via five booleans plus one string field:Mutual exclusion is enforced only by the order of switch cases in
Update. As the TUI grows (e.g. multi-line compose, message-cursor mode, modal dialogs), illegal combinations become easy to introduce —composing && searching == trueis currently meaningless but representable.Proposal
Replace the booleans with a single
modeenum:Each mode owns its associated buffer (compose buffer, contact URL buffer, search query).
Updatedispatches onm.modeinstead of falling through a chain ofswitch{} case x:flags.Acceptance criteria
modefield replaces themUpdatedispatches viamode, not chained boolean checksmsg serve+msground trip from a peer)Context
Surfaced in the v1.0.0 self-review (issue #2 of that review, now an issue here for tracking). Not a v1 blocker; do post-ship.