feat(tui): notification bar, confirmation dialogs & text input basics #54
No reviewers
Labels
No labels
area:agents
area:ai
area:config
area:dashboard
area:design
area:design-review
area:devtools
area:entities
area:gallery
area:generate
area:image
area:infra
area:meta
area:model-browser
area:navigation
area:presets
area:security
area:sessions
area:settings
area:sharing
area:test
area:ux
area:webhook
area:workdir
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/loom!54
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "tui/notifications-42"
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?
Summary
Seventh PR in the loom-tui stack. Wraps up the spec §8 UX polish layer so subsequent screen tickets can rely on real notifications, confirmations, and text-input primitives.
Stacks on #53. Closes charles/loom#42. Completes Phase 1 of the loom-tui roadmap (#47).
What's in
components::notification—Level(info/success/warn/error),Notification { level, message, created_at },NotificationQueuewithpush/tick/dismiss_current/current/render. Lifetime isDuration::from_secs(5), driven offInstantdeltas so tests can forge past-timestampscomponents::confirm—ConfirmRequest(title, body, confirm/cancel labels,default_confirm),ConfirmOutcome::{Confirmed, Cancelled},render(frame, area, &request). HelperConfirmRequest::destructiveforcesdefault_confirm = falsecomponents::text_input::TextInput— single-line editor withCtrl+A(cursor start),Ctrl+E(cursor end),Ctrl+U(clear),Ctrl+W(delete word left),Backspace/Delete/Left/Right/Home/End/printable chars. Unicode-safe char/byte indexingAppAction::Notify(Notification)/ConfirmOutcome(ConfirmOutcome)— screens push notifications viactx.notify(n); confirm overlay writes its outcome viaAppAction::ConfirmOutcomewhichAppstores inlast_confirmOverlayKind::Confirm(ConfirmRequest)—App::push_overlayconstructs aConfirmOverlayaround the requestConfirmOverlayinapp.rs—y/Y→ Confirmed,n/N/Esc→ Cancelled,Enter→ default answer, every other key swallowed (modal)App::renderreserves a 1-row notification slot above the status bar when the queue has a current entry;compute_layoutgrew a fourthshow_notificationparameter and returnsAppLayout { sidebar, main, notification?, status }process_eventcallsnotifications.tick(Instant::now())onEvent::Tickandnotifications.dismiss_current()on any key press, matching spec "auto-dismiss after 5 s or on next keypress"Tests (12 new, 44 total)
AppAction::Notifyrouted through drain_actions lands in the queueConfirmedonyandCancelledonEsc/defaultEnterreturnsCancelledCtrl+Uclear,Ctrl+Wword delete,Ctrl+Acursor start, Left/Right boundsNotes
components::notification,components::confirm,components::text_inputare#![allow(dead_code)]at module level — they're library surfaces consumed by later screen tickets (Notification::success,success/errorlevels,ConfirmRequest::destructive,TextInput::set_text). Module-level allow keeps reviews focused instead of peppering the file with per-item attributeslast_confirmpoll-based API is intentionally minimal. A subscription model (one-shot channel per prompt) can grow later once multiple concurrent confirmations become a thingPhase 1 complete
This PR closes out Phase 1 of the loom-tui roadmap (#47). The foundations — crate scaffold, event loop, configurable keybinds, config file, navigation chrome, command palette, notifications/confirms — are all in place. Phase 2 is image rendering (#12 #13 #14 #15), which I'll start on next stacked atop this branch.