Repository navigation
Extras: notify, transient toasts and a persistent notice stack - #382
Merged
Merged
Conversation
Both consumers hand-build a toast slot and a notice stack (#347). The notify feature gives them one widget on core's public API: - The queue is the application's: `notifications(key, &[Notice])` takes `Option::as_slice` for a slot a new notice replaces, or a `Vec` for a stack, newest nearest the anchor. Expiry, the ×, Esc and actions come back through `on_dismiss(app, id, Dismissed)` and `on_action`. - `Lifetime::Dwell(Duration)` per stack, on egui's clock: the library keeps only each visible id's dwell, ticked by a pure `Dwell` (the tooltip's pattern), and books a repaint for the next expiry. It holds while the pointer is over the stack, focus is inside it, or the window is in the background. A new id starts afresh; an expired notice fires once. - Esc dismisses a notice only while focus is inside it, remembered across the pass in which egui drops the focus for the Esc. - Toasts show a × only with `closable()`; `UntilDismissed` notices always do. Actions are buttons and leave the notice up. - The stack is a named `Status` node with a polite live region (`NodeHandle::live`), in a `Band::Popup` overlay that takes no focus, never dismisses itself and passes outside presses through, so it sits above dialogs and stays clickable. - `ScreenAnchor` plus a `Distance` inset is a thin constructor of core's `Placement::edge(..).align(..)` with an inset window boundary; the rect is the existing `placed.overlay(key).rect()`. The look is a private default derived from the core style (the menu's popover surface at sonner's sizes) until the render round picks the NotifyStyle; no shadcn values and no entrance motion yet. Part of #347. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKe8zfqGfVMCSC5L3up
This was referenced Nov 18, 2026
Open
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AJYxo4YJZUXcPJ1bHdAHKy
Owner
Author
|
Approved by the user after the notifications trial (2026-11-19). GitHub's required checks pass on the branch merged with current main. Merging. |
samitbasu
added a commit
that referenced
this pull request
Nov 20, 2026
#382 added notify's tests on the old rig, using Rig::observe, which this branch deleted as unused. Like badge, hover_anchored, hover_card and refused, notify stays on the rig for now, and observe comes back for it. Outcomes: 2386, none failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LesfK54UWq1haPSEr9X22o
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.
Part of #347. Stacked on #369 (
NodeHandle::live). Until #369 merges, this diff also shows that PR's commit (src/builder.rs,tests/it/interaction.rs).This is PR 2 of the design note's split: the
notifyfeature ofeggshell-ui-extras, built only on core's public API, following the decisions comment.The look is not final. The cards use a private default taken from the core style (the menu's popover surface at sonner's sizes), and the action and × buttons use the style's default variant.
NotifyStyle, its shadcn values behindeggshell-ui-shadcn/extrasand an example come in PR 3, after the user picks from the render round.API for review
Behaviour
app.toast.as_slice()(anOption) means a new notice replaces the old one; aVecstacks them. The newest notice sits nearest the anchor. The library never adds or removes notices; it calls the handlers.Durationdwell on egui's clock, computed by a pureDwell::tick(now, length, Hold)(unit-tested), and a repaint is booked for the next expiry.Expiredonly once.closable()is set, and always shown onUntilDismissednotices. Its name is "Dismiss: ".Role::Statusnode withlive(Polite).Band::Popupoverlay withFocus::None,DismissOn::NeverandOutside::PassThrough. It sits above an open dialog and still takes clicks.Placement::edge(side).align(..)insideBoundary::Window.inset(Sides::all(inset)). The rect comes from the existingplaced.overlay(key).rect().Tests (
tests/it/notify.rs, through the rig, stepped clock)a_toast_expires_after_its_dwell_on_the_stepped_clocka_running_dwell_books_a_repaint_for_its_expiry: idle page →Duration::MAX; with a toast → the remaining dwellthe_dwell_holds_while_the_pointer_is_over_the_stackthe_dwell_holds_while_focus_is_inside_and_while_the_window_is_in_the_backgrounda_replacement_keeps_one_toast_and_starts_its_own_dwella_persistent_notice_never_expires_and_newest_sits_nearest_the_top_anchoresc_dismisses_a_notice_only_while_focus_is_inside_itthe_close_button_dismisses_its_noticea_toast_has_no_close_button_unless_askedan_action_button_runs_on_action_and_leaves_the_notice_upa_stack_is_a_polite_status_region_by_its_namethe_stack_follows_its_inset_and_its_rect_is_queryablea_notice_floats_above_an_open_dialog_and_takes_the_pointernotify::dwellunit tests: counting down, holding and resuming, a clock that goes backKnown gaps (core-side, not changed here)
Behaviour changes
None. The feature is new and opt-in.
cargo xtask ci: exit 0 on this head, merged with current main. One earlier full run segfaulted in thescreenshotsstep (lavapipe, SIGSEGV) while the machine was under load. The same step passed 4/4 standalone and 3/3 throughxtask ciwith the other steps skipped, and the rerun of the full CI exited 0.The UI trial waits for PR 3, where the look lands.
🤖 Generated with Claude Code