fix(desktop): keep the update-ready toast inside the main window#1987
Merged
Conversation
The "installed — restart to apply" toast laid its message and buttons out in a single horizontal row with no width cap, but the main window is only 330px wide, so the card overflowed the window's left edge and got clipped — cutting off the first letter of each wrapped line and squashing the buttons. Cap the card to the viewport width (max 24rem) and stack the actions below the message so it renders cleanly in the narrow window.
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
| // (never exceed the viewport) and stack its actions below the message | ||
| // rather than racing them on one line — otherwise the card overflows | ||
| // the window edge and gets clipped. | ||
| <div class="flex flex-col gap-2.5 px-4 py-3 rounded-xl border shadow-lg bg-gray-1 border-gray-4 text-gray-12 w-[min(24rem,calc(100vw-2rem))]"> |
There was a problem hiding this comment.
This works, but Tailwind arbitrary values with min(..., ...) (comma + nested parens) can be a little brittle in class scanners. Same behavior, a bit more readable:
Suggested change
| <div class="flex flex-col gap-2.5 px-4 py-3 rounded-xl border shadow-lg bg-gray-1 border-gray-4 text-gray-12 w-[min(24rem,calc(100vw-2rem))]"> | |
| <div class="flex flex-col gap-2.5 px-4 py-3 rounded-xl border shadow-lg bg-gray-1 border-gray-4 text-gray-12 w-[calc(100vw-2rem)] max-w-sm"> |
| > | ||
| Dismiss | ||
| </button> | ||
| <div class="flex gap-2 items-center"> |
There was a problem hiding this comment.
Minor: to avoid horizontal overflow if button labels get a bit longer (e.g. future copy changes), consider allowing the action row to wrap.
Suggested change
| <div class="flex gap-2 items-center"> | |
| <div class="flex flex-wrap gap-2 items-center"> |
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
The "update installed — restart to apply" toast rendered clipped and cramped in the main window: the first letter of each wrapped line was cut off ("Cap", "nightly", "has", "restart") and the button squashed to "Restart\nnow".
The toast laid its message and both buttons out in a single horizontal
flexrow with no width cap, but the main window is only 330px wide (windows.rs→Self::Main => (330.0, 395.0)). Pinned bottom-right, the card overflowed the window's left edge and the webview clipped it.The plain toasts elsewhere never hit this because they're short single lines. This one surfaced with the nightly channel, where the "installed, restart to apply" state actually shows up.
Fix
w-[min(24rem,calc(100vw-2rem))]— so it fits the 330px window (≈298px with clean margins) yet still caps at 24rem on wider windows. Mirrors the existing pattern inTrackManager.tsx.Restart now/Dismissbuttons below the message instead of racing them horizontally, so nothing wraps mid-word.CSS/JSX-only, scoped to the toast. No changelog/version-switcher changes.
Greptile Summary
This PR fixes the update-ready toast overflowing and clipping text in the 330 px main window. The change is CSS/JSX only and doesn't touch any update logic.
w-[min(24rem,calc(100vw-2rem))]to cap the card width to the viewport, giving ~298 px of usable space on the narrowest window while still allowing up to 24 rem on wider surfaces.flexrow toflex-colso the message text sits above a dedicated button row (flex gap-2 items-center), eliminating the mid-word line breaks and squashed button labels.Confidence Score: 5/5
Safe to merge — purely cosmetic Tailwind/JSX rearrangement with no changes to the install or relaunch logic.
The update, relaunch, and dismiss logic is byte-for-byte identical to the original. Only the wrapping divs and class strings changed. The w-[min(24rem,calc(100vw-2rem))] pattern is a well-established Tailwind idiom, and at 330 px the math (330 − 32 = 298 px) gives comfortable margins. Both button label combinations ("Restart now"/"Dismiss" and "Install and restart"/"Dismiss") fit inside the constrained row without risk of overflow.
No files require special attention.
Important Files Changed
Reviews (1): Last reviewed commit: "fix(desktop): keep the update-ready toas..." | Re-trigger Greptile