Skip to content

toast-v1.7.0

Choose a tag to compare

@github-actions github-actions released this 03 Dec 09:27
· 5 commits to main since this release
c47475a

New: the @cloudlet/toast/guide subpath, which lets your app hold the Toaster's Island with its
own content, such as the steps of a product tour, while notifications wait in the stack and open
after it. The root entry does not load it, and nothing changes for an app that does not use it:
upgrade from 1.6.0 in place. Published to npm as latest (npm install @cloudlet/toast); this
section takes in the trial prerelease 1.7.0-rc.1 (2026-12-02, npm next) and the change made after
it.

Since 1.7.0-rc.1

  • IslandGuideContent.ref names the guide for agents apart from label: toasterAgent reports
    the Island as held by guest: { ref } with this ref (else the label), so a guide can point
    agents at its own record on the bridge while screen readers keep reading its label. A nonempty
    string; anything else is refused as invalid-input. In 1.7.0-rc.1 the label named both.

The Island guide

  • useIslandGuide(controller?) from @cloudlet/toast/guide (the provider's controller when called
    without one) returns show(content, options?), hide(), active, frame and subscribeFrame.
    The content is data, not a component: title, body, counter (a short position such as 2/5),
    actions (id, label, variant primary, quiet or default, disabled, role),
    pending, label (the landmark's name), ref (its name for agents), and the callbacks
    onAction(id) and onDismiss() (Escape inside the guide; the guide stays until hide()). Each show takes the whole step and replaces the previous one.
  • The Toaster draws the guide in its own theme in place of the stack: a dot, the title, the counter
    in monospace figures at the end of the row, the text and a row of buttons (a quiet one at the
    start, the rest at the end), with no close button. A title without text or buttons draws a compact
    pill, for a tour's last word. New CloudletPart names reach its parts through classNames:
    guide, guide-header, guide-title, guide-counter, guide-body, guide-actions and
    guide-action; its badge takes badge. The host carries data-guide meanwhile.
  • show answers { status: 'shown' }; { status: 'waiting', reason: 'no-host' } when no Toaster
    of the controller is mounted (the guide holds the Island and appears once one mounts); or
    { status: 'rejected' } with occupied (another useIslandGuide holds the Island: one guide per
    controller), no-controller, disposed or invalid-input (also an invalid-input diagnostic).
    A callback that throws is reported as a callback-error diagnostic. hide(), or unmounting the
    component that holds the hook, gives the Island back.
  • frame is where the guide comes to rest, in viewport pixels, and changes with the content or the
    layout, not per frame. subscribeFrame(listener) follows the shape as it is drawn: the frame at
    once, then on every animation frame in which it moves, outside React, so a pointer or an outline
    can follow the guide without a render per frame. It returns the function that stops listening.

Notifications while the guide is there

  • Notifications still arrive into the stack and the guide's badge counts them, but none opens the
    Island, even with attention: 'open': the attention queue waits for the guide as it waits for a
    busy person. After hide() the waiting notification opens after the attention delay, as after
    any interaction.
  • Showing a guide collapses an open Island; the controller's snapshot reports the Island collapsed
    and the stack presenting its newest notification, so time budgets run by their own rules. While
    the guide covers the stack, the presented notification is not read and its time stands still.
  • toasterAgent (@cloudlet/toast/agent) reports the Island as held (guest, named by the
    guide's ref, else its label, when it has one), and refuses an agent's open and show with "A tour is in
    progress in the Island". The controller's public API and the root entry's types do not change.

Motion

  • The guide moves as the Island does. With an empty stack it grows out of a dot in the Island's
    place; with notifications waiting it opens out of the stack's pill. A new step springs to its new
    size on interruptible springs (a quick change continues from the current shape and speed), and its
    title, counter and text blur-swap. hide() folds it back into the pill, or into the Island that a
    waiting notification opens, or into the dot when the stack is empty.
  • A waiting guide's counter (pending) pulses; the badge springs in and out on the shape's corner;
    the stack's flight to a new position carries the guide. Under reduced motion nothing moves in
    space: the shape is at its end at once and content changes its opacity for 80 ms, without blur.

Keyboard and screen readers

  • The guide is a landmark (role="region") named by its label, else its title, and aria-busy
    while pending. Tab reaches it in its place on the page; F6 or Shift+F6 jumps to its primary
    button (else its first enabled one) and, pressed again inside the guide, back to where focus came
    from. Without a guide F6 is left to the browser.
  • Focus never moves into the guide on its own: show(content, { focus: true }) asks for it once,
    for a guide the person has just asked for, such as a tour started by a button.
  • An action with role: 'next' or role: 'back' (at most one of each) answers the arrow keys
    while focus is in the guide: → presses next and ← presses back in a left-to-right document,
    mirrored in RTL, never a disabled button.
  • A step that arrives or changes its title, counter or text is read as "title. counter. text" in
    the Toaster's polite live region. hide() with focus in the guide returns focus to where it was
    before it entered the guide.