Skip to content

fix(desktop): keep the update-ready toast inside the main window#1987

Merged
richiemcilroy merged 1 commit into
mainfrom
fix/update-ready-toast-width
Jul 7, 2026
Merged

fix(desktop): keep the update-ready toast inside the main window#1987
richiemcilroy merged 1 commit into
mainfrom
fix/update-ready-toast-width

Conversation

@richiemcilroy

@richiemcilroy richiemcilroy commented Jul 7, 2026

Copy link
Copy Markdown
Member

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 flex row with no width cap, but the main window is only 330px wide (windows.rsSelf::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

  • Cap the card to the viewport width — 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 in TrackManager.tsx.
  • Stack the Restart now / Dismiss buttons 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.

  • Adds 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.
  • Changes the root flex row to flex-col so 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

Filename Overview
apps/desktop/src/routes/(window-chrome)/new-main/index.tsx Layout-only fix for the update-ready toast: switches container to flex-col with a viewport-capped width so the card stays within the 330px main window, and moves buttons into their own horizontal row below the message.

Reviews (1): Last reviewed commit: "fix(desktop): keep the update-ready toas..." | Re-trigger Greptile

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.
@cursor

cursor Bot commented Jul 7, 2026

Copy link
Copy Markdown

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.

@richiemcilroy richiemcilroy merged commit c2be05f into main Jul 7, 2026
18 of 20 checks passed
// (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))]">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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">

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