Repository navigation
fix(website): tooltip viewport clamp, preview asset serving, and site polish from review - #845
Conversation
🦋 Changeset detectedLatest commit: ae2f9e0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
🧹 Site preview for this PR was deleted (PR closed). |
[Medium impact] The PR appears safe to merge, with two non-blocking interaction fixes recommended. Findings
|
8a2e1a9 to
5a876e1
Compare
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
Root cause of the broken preview found and fixed in cf44622 (on this branch): Workers static assets are keyed by file path, and the preview worker serves its build at the root of its URL — but the HTML's base-prefixed references ( The workflow now copies the built tree into |
The bubble is horizontally centered on its (i) toggle, so a toggle near the viewport edge (e.g. the I/O card's tooltip on the homepage) opened half outside the screen and clipped. max-width bounds the width, not the position. On open — hover, tap or keyboard — the bubble now shifts horizontally to stay 12px inside the viewport, and re-clamps on resize. The shift is measured from the bubble's real rect after layout and removed on close.
Two Greptile P2s, both valid states the first clamp pass missed: - Tapping a tooltip closed it while the pointer stayed over it; :hover keeps the bubble visible but the close path cleared the shift, so an edge bubble jumped outside the viewport until re-hover. Re-clamp instead of clearing when :hover still matches. - The resize re-clamp matched only [open] bubbles; hover-only ones kept a stale shift across viewport changes. Match :hover too.
The bubble is centered by the stylesheet's translateX(-50%), so its rendered box spans anchor-w/2 .. anchor+w/2 — the first pass measured the untransformed rect and compared its raw edges, under-shooting by w/2: at an anchor 120px from the left edge a 260px bubble rendered from -10px (clipped) and the clamp never fired. The shift now starts from the rendered position; verified across 7 anchor/width/viewport cases including the reported one.
Workers static assets are keyed by file path: the preview worker serves dist/ at the root of its URL, so the built tree must exist AT /preview/<n>/ for the HTML's base-prefixed references to resolve. They did not — every asset request (/preview/845/_astro/*.css, /media/*.mp4) fell through the SPA fallback and returned the index page as text/html, which is why the preview rendered unstyled and read as broken even though the page HTML and its inline script were correct. After build + apply-base, the workflow now copies the tree into dist/preview/<n>/ (excluding the copy itself), so asset requests hit real files. Verified locally: dist/preview/845/_astro/index.*.css and index.html both exist; ~2x dist size, negligible for previews.
cf44622 to
528055a
Compare
Real-browser tracing on the preview caught a tip whose per-element listeners had silently not attached — no error, no markup difference, nothing to observe from outside. Attach everything at the document instead: toggle in the capture phase (it does not bubble), pointerover delegation for the hover path, click/keydown as before. Every current and future .info-tip is covered regardless of node replacement.
- /community: give the participate cards a real section head (numbering was jumping 01 -> 02 over an orphaned card grid) and renumber guides - hero: the headline now exists as real DOM text (was only baked into the film, invisible to search/screen readers), and the film has a pause control that survives the scroll observer's re-play - hero film re-rendered at 1080p from current film.ts (repo now advertises 25 NIPs; the shipped film said 24) - console: label the screenshots as a real console's first-run data (249/261 rejected, four failed deliveries are honest, not marketing) - honest advertising: align the copy with the warning the screenshot actually shows (advertised-vs-observed, both directions) - nav: Community link is in the shared NAV already — the /community header discrepancy was the base-prefixed pathname defeating isActive; strip the base before comparing. The Get-started CTA scrolls to the build block on /get-started instead of linking to the page you are on - get-started: note why the phases jump P0 P2 P4 P5 P7 (P1/P3/P6 are the agent's own steps) - community: fix 'schematics ,' space-before-comma - compress the section rhythm site-wide (clamp 80-140px -> 56-96px)
The I/O cell's nowrap command (and any wide nowrap child) forced the grid track's auto minimum past the viewport on phones — the page panned sideways at 390px. minmax(0, 1fr) on the single-column grids (bento, rail, gallery) lets children scroll internally instead.
At 1084px the 54px headline collided with the film frame's title bar. Smaller type, higher anchor — the frame chrome starts below it now.
Two review findings: the mobile drawer's same-page #build link scrolled with the drawer still covering the target — close it and reset the menu button first. And the film toggle now derives its label/aria-pressed from real playback state (play/pause events + initial sync), so under prefers-reduced-motion it offers Play instead of starting the film.
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
Tooltip viewport clamp (original scope)
The tooltip bubble is horizontally centered on its
(i)toggle, so a toggle near the viewport edge — e.g. the I/O card's tooltip on the homepage — opened half outside the screen and clipped.max-width: min(260px, calc(100vw - 32px))bounds the bubble's width but not its position.Fix: when a bubble opens (hover, tap or keyboard), a document-level delegated script measures its real rendered rect after layout and shifts it horizontally to stay 12px inside the viewport; the shift is removed on close and re-applied on resize. Delegation (toggle in capture phase,
pointeroverfor hover) came out of a real-browser trace that caught one tip whose per-element listeners had silently never attached — no error, nothing visible in markup.Preview asset serving (also in this PR)
PR-preview workers serve
dist/at the root of their URL, so base-prefixed asset requests (/preview/<n>/_astro/*.css) hit no file and SPA-fell-back toindex.htmlastext/html. The deploy workflow now copies the build intodist/preview/<n>/so every preview asset exists at its requested path. Preview comments also upsert (one comment per PR, flips to "⏳ rendering" during deploy).Site polish from Muse's external review
sr-onlyline. Also added a Pause/Play control on the hero film that survives the scroll observer's re-play.film.ts— the shipped one was 720p and said 24 NIPs; the repo advertises 25.Astro.url.pathnameincludes the deploy base, soisActive()silently failed for every non-root path (why /community's header looked different). The base is stripped before comparing. The Get-started CTA scrolls to the build block on /get-started instead of linking to the page you are already on.minmax(0, 1fr).Verification
All verified against the deployed preview (
nostream-web-pr-845.cameri.workers.dev/preview/845/) with a real browser:text/css, mp4 →video/mp4, unknown paths → SPA fallback.aria-pressedtracks), phase note, CTA self-scroll, comma typo — all checked in DOM.scrollWidth == innerWidth); the only remaining offscreen element is a closed tooltip's bubble, which is absolute-positioned and only appears on interaction.Also carries a changeset.