Skip to content

✨ dashboard: toasts show a countdown bar timed to their auto-dismiss - #15231

Merged
clubanderson merged 1 commit into
v5from
feat/toast-countdown-bar
Oct 29, 2026
Merged

clubanderson merged 1 commit into
v5from
feat/toast-countdown-bar

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #15230

Every timed toast now draws a 2px countdown bar along its bottom edge that drains from full to empty over exactly its auto-dismiss window.

How the duration is wired: a new toastCountdownBar(el, ms, onExpire) helper creates the .toast-bar span, sets style.animationDuration = ms + 'ms' inline, and arms the single setTimeout(onExpire, ms) — so the bar and the dismiss timer always share one value. showToast routes the default (TOAST_DURATION_MS), the explicit autoDismissMs (e.g. the 10 s layout-reset undo), and the error-with-deadline paths through it; dismissToast(el, newMsg) (in-flight toast → result) does too. Sticky errors and persistent spinner toasts never call it and show no bar.

CSS: .toast gains position: relative; overflow: hidden (clips the bar to the toast radius; no size/layout change). @keyframes toast-bar-drain scales X 1→0 linearly; severity colour via --green/--red/--blue/--status-warn at 0.55 opacity; hidden under prefers-reduced-motion.

Tests: TestToastCountdownBarWiredToDismissTimer asserts the helper, every timed path in showToast/dismissToast, the absence on persistent toasts, and the CSS.

Verified in headless Chrome with a standalone harness: bars on timed toasts only, severity-coloured, none on sticky/persistent.

Every timed toast (success/info/warning, error with an explicit deadline,
and an in-flight toast resolved by dismissToast) now carries a 2px
.toast-bar along its bottom edge that drains from full to empty over the
same milliseconds the dismiss timer uses: toastCountdownBar arms both
the setTimeout and the bar's inline animation-duration from one value.
Sticky (error) and persistent (spinner) toasts show no bar. The bar is
absolutely positioned (no layout shift), takes the severity token at
reduced opacity, is clipped to the toast radius, and is hidden under
prefers-reduced-motion.

Fixes #15230

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 29, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign nicholasjackson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 29, 2026
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#15186 🐛 Activity Monitor: one coherent post-decision state for Let hive decide rows; 060 reviewed in CI / Review same files src/pkg/dashboard/static/index.html
#15122 🐛 Write-back containment: per-kind gate for every unsolicited GitHub write, with backfill guard same files src/pkg/dashboard/static/index.html
#15085 ✨ Activity Monitor: Adopt now and Reroute to another clanker for PRs waiting on a contributor's clanker same files src/pkg/dashboard/static/index.html
#15228 ✨ tracker: waiting-on chip shows human or bot icon instead of text qualifier same files src/pkg/dashboard/static/index.html
#15104 🐛 Activity Monitor: Rebase, then merge as maintainer; fixer owns parked conflicting PRs; dismiss self-inflicted changes_requested same files src/pkg/dashboard/static/index.html
#15200 🐛 fix: tracker history column wears a history mark, not a ✓ same files src/pkg/dashboard/static/index.html
#15134 🐛 Delegated decision on a capability gap: model the blocker, stop the un-park/re-park loop, name the missing App permission same files src/pkg/dashboard/static/index.html
#14807 ✨ dashboard: stream Job pod logs in the terminal pane for sandbox.runtime: job agents same files src/pkg/dashboard/static/index.html
#15208 🐛 fix: decidePR answers capability-gap, not adopt-supersede, for heads the App cannot adopt same files src/pkg/dashboard/static/index.html
#15206 🐛 Activity Monitor: delegated adopt-supersede reports executing → adopted/could-not-adopt, routes workflow-path to the workflows blocker, re-adoption survives the mutation journal same files src/pkg/dashboard/static/index.html
#15223 ✨ Soak countdown on every soak pill, with the live timer on hover same files src/pkg/dashboard/static/index.html
#15219 🐛 fix: preserve human and owner PRs during delegated decisions same files src/pkg/dashboard/static/index.html

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson is auto-promoted for contributor-lane merging on this PR: the last 5 merged PRs by this author in this hive's repositories have no revert or sentinel-alert evidence. CI, reviewer verdict, diff fences, soak, holds and branch protection still apply.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Another agent tried to open a PR from scanner/fix-15230, but this PR already closes #15230. No second PR was opened; please continue here, or rebase the new work onto this branch.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the three timed-toast paths in index.html at this head. The bar and the dismiss timer are armed from one ms in toastCountdownBar (index.html:39790-39797), the persistent spinner branch keeps its TOAST_PROGRESS_MAX_MS safety timeout without a bar (:39817-39823), sticky errors only get a bar when autoDismissMs > 0 (:39830), and dismissToast(el, newMsg) sets textContent before appending the bar (:39857 then :39863), so the rewrite does not wipe it. Looks correct to me.

One side effect worth stating in the body, since the diff hides it: .toast previously had no position, so the absolutely-positioned .toast-close (index.html:3522, top:4px; right:8px) was anchored to the nearest positioned ancestor — #toast-container, which is position: fixed (:3490) — i.e. every sticky toast's × rendered at the container's corner, not its own. The new position: relative on .toast (:3499) moves the × into each toast. That is almost certainly an improvement, and overflow: hidden does not clip it at those offsets, but it is a visible change for stacked sticky errors that the title and changelog do not mention.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/human A person pushed this PR themselves dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/L Denotes a PR that changes 100-499 lines, ignoring generated files. stage/050-review-pending Review swarm requested; awaiting a verdict for the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ toast: countdown progress bar timed to auto-dismiss

1 participant