feat(notice): show full toast text by default, top-right position, hover-pause dismiss - #558
Open
northwang-lucky wants to merge 1 commit into
Open
feat(notice): show full toast text by default, top-right position, hover-pause dismiss#558northwang-lucky wants to merge 1 commit into
northwang-lucky wants to merge 1 commit into
Conversation
northwang-lucky
force-pushed
the
notice-hover-expand
branch
from
August 20, 2026 11:19
835ae3b to
0acfbdc
Compare
…ht, hover-pause dismiss - Toasts render expanded by default: pre-line preserves embedded newlines and long lines wrap within max 620px instead of truncating with an ellipsis - Toasts move from top-center to the top-right corner; right edges stay pinned (flex-end on both the wrapper and the shelf column) and widths extend leftward - Content taller than the 500px cap scrolls inside the text area (thin scrollbar); the type dot stays pinned at the top and does not scroll - Hover no longer drives layout (an earlier hover-to-expand approach could enter an enter/leave flicker loop when the expanded toast narrowed and ejected the cursor); hover now only pauses the dismiss timer via setNoticeHover/onHoverChange - The dismiss countdown is a true pause: elapsed time is accrued via remainingMs/startedAt refs and the timer resumes from the remaining time; it resets whenever the oldest visible notice changes - Each toast opts back into pointer events: the floating wrapper is click-through by design (pointer-events: none), so hover events never reached the toast itself - Entrance animation fill changed from both to backwards: its 60px keyframe would otherwise stick after the animation ends and permanently clamp expanded toasts - Type indicator dot is top-aligned with the first text line on multi-line toasts; font size reduced from 18 to 14
northwang-lucky
force-pushed
the
notice-hover-expand
branch
from
August 20, 2026 13:20
0acfbdc to
59d7e8d
Compare
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.
Problem
Extension notifications (the floating
NoticeShelftoasts) currently:nowrap + ellipsisspan inside a fixed 60px / max-620px container gives users no way to read the full text (e.g. pi-fff's multi-field health report).lines.join("\n"), butwhite-space: nowrap/normalfolds every\ninto a space, so structured output renders as one run-on line.Changes
Toasts show their full text by default (
components/ChatWindow.tsx,NoticeShelf):white-space: pre-line+word-break: break-word: embedded\nare preserved and long lines wrap within the existingmax-width: min(100%, 620px)instead of truncating.max-height: 500remains as a safety cap for pathological messages.justify-content: flex-endon the wrapper,align-items: flex-endon the shelf column), so each toast's right edge stays pinned and its width extends leftward as content grows.transformOriginfollows the new anchor (top right).Hover pauses the dismiss timer (
hooks/useAgentSession.ts):setNoticeHover(id); while any notice is hovered, no expiry timer runs. Elapsed time is accrued viaremainingMs/startedAtrefs, so the countdown resumes from the remaining time instead of restarting at 5s. The timer resets whenever the oldest visible notice changes.Two latent blockers fixed along the way:
pointer-events: "none"), which meant hover events never reached the toast itself; each item now opts back in withpointer-events: "auto"(the rest of the overlay stays click-through).notice-shelf-inentrance animation ran withfill: bothand itstokeyframe pinsheight/min-height/max-height: 60px— a completed forwards-fill animation keeps winning over inline styles and would have clamped expanded toasts forever. Fill is nowbackwards(entrance visuals unchanged).Note: an earlier iteration of this PR implemented hover-to-expand instead. It was dropped because expanding changed the toast's width (
fit-contentshrinks once text wraps), which could eject the cursor and cause an enter/leave flicker loop. Always-expanded has a stable hover area and is simpler; hover now only controls the dismiss timer.Behavior
…\npre-line)Testing
tsc --noEmitclean,npm run lintclean.next dev) with pi-fff's 7-line health notice: toast renders fully expanded at the top-right by default, survives well past 5s while hovered, and the countdown resumes and completes after the mouse leaves.Known accepted edge: when more than
MAX_NOTICESare queued, an incoming notice can still force the oldest one out even while hovered (pre-existing queue-overflow behavior, unchanged).