Skip to content

core: toasts are drawn on the window's material - #664

Merged
foxnne merged 1 commit into
mainfrom
core/dialogs-material
Oct 19, 2026
Merged

foxnne merged 1 commit into
mainfrom
core/dialogs-material

Conversation

@foxnne

@foxnne foxnne commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

Toasts now use the window material, the same way dialogs, tooltips and menus do. Before this, they ignored the material setting.

Every toast fizzy raised went through dvui.toast. Its default display is dvui's own label: a capsule in the theme's fill, whatever the material (#621, #632) was set to. The maintainer saw this on the "Save or close your changes first" prompt that opening a tape over unsaved work raises. The same applies to every other dvui.toast in the app (18 call sites). The two update toasts (app/update/update_notify.zig) painted their own plain capsule as well.

  • core.dialogs.toast(src, opts): raises a toast with fizzy's display in place of dvui's default. A toast that names its own displayFn keeps it. All 18 callers in src/editor/ (Demo, TapeTabs, DocumentIo, Editor, FileTypeSettings, KeptDocuments) and app/update now call it, and none call dvui.toast directly.
  • core.dialogs.toastDisplay: draws the message on toastSurface. It was already in core but unused.
  • core.dialogs.toastSurface(wd, fade) + toastOptions: the surface a toast sits on. It reuses the tooltip's glass routine: dialogFrost (Liquid Glass / frost / blur at the dialog style), or with the blur off (transparent, none) the plain dialogFill, with the floating surfaces' shadow ring. The frost uses the toast's own fade animation as its form, so it fades in with the text. The update toasts draw on it too.

This PR does not decide whether the demo's unsaved-work prompt should exist (that is automation/tape-own-stage). It only changes how the prompt is drawn.

SDK impact

  • None
  • Core-only or additive: reaches plugins at the next SDK release (new core.dialogs functions, no boundary change)
  • Fingerprint moved
  • SDK release

Verified

  • macOS: two new tests in core/dialogs.zig (rooted from core/sizing_tests.zig):

    • every toast is routed through toastDisplay, and a toast's own display is kept;
    • toastSurface queues a frost with the blur on and none with it off.

    I also ran one quiet sandbox, with an unsaved untitled document, and called fizzy.demo.tour. The toast appeared as Liquid Glass with windowMaterial liquid, with the panel header showing blurred through it. With none it was the plain dialog fill with the surface shadow.

  • Windows:

  • Linux: CI

Gates run locally: check-fmt, build, test, test-integration (81/81 steps), check-web, test-sdk-version, check-tests-reached.

  • Web: check-web only

Review (code-review, medium)

Fixed: the toast box now deinits before the animator gives back its size, so a dismissed toast frees its row the same frame. The margin now leaves room for the shadow ring, since dvui's toast window is cut to its content. Left as is: a dylib toast frosts through its own copy of the backdrop, as dylib tooltips already do. dvui.toast itself still draws dvui's label for any new caller that bypasses core.dialogs.toast. Changing dvui's default display belongs in the fork if we want it.

Follow-ups

  • core.dialogs.saveCompleteToastDisplay and Editor.drawSaveToasts have no caller that adds a toast to save_toast_subwindow_id, so they are dead code. Left for a separate cleanup.

🤖 Generated with Claude Code

Every toast fizzy raised went through `dvui.toast`, whose default display is dvui's own
label: a plain theme fill whatever the window material (#621, #632) said. The demo's
"save or close your changes first" prompt is one of them. `core.dialogs.toast` now raises
every toast with `core.dialogs.toastDisplay`, which lays the message on `toastSurface`: the
same glass a tooltip or a dialog is (`dialogFrost`: Liquid Glass, frost, blur), or with the
blur off (`transparent`, `none`) the plain `dialogFill`, with the floating surfaces' shadow.
The update toasts draw on the same surface.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@foxnne
foxnne force-pushed the core/dialogs-material branch from 0de7e02 to b2edd79 Compare October 19, 2026 19:59
@foxnne
foxnne marked this pull request as ready for review October 19, 2026 19:59
@foxnne
foxnne enabled auto-merge October 19, 2026 19:59
@foxnne
foxnne added this pull request to the merge queue Oct 19, 2026
Merged via the queue into main with commit a4abd17 Oct 19, 2026
11 checks passed
@foxnne
foxnne deleted the core/dialogs-material branch October 19, 2026 20:19
foxnne added a commit that referenced this pull request Oct 19, 2026
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.

1 participant