fix(website): open off-site links in a new tab#5474
Conversation
…ton props for external navigation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Website previewPreview URL: https://pr-5474-agenta-website-preview.mahmoud-637.workers.dev Built from |
Context
Clicking Docs, Changelog, Roadmap, Status, or a self-host link on the marketing site navigated away in the same tab, so the site was gone and the visitor had to hit back to return. Off-site destinations should open in a new tab and leave the marketing site behind them, which is how the live agenta.ai already behaves.
This branch also carries two smaller fixes that were already in progress: the footer social icons were pointing at the wrong glyphs, and the HowItWorks scroll section needed polish. All three are described below.
Changes
Off-site links open in a new tab
Button.astrogains anexternalprop. When the button renders as a link,externaladdstarget="_blank" rel="noopener"; as a<button>(no href) it does nothing.Before:
<Button href="https://agenta.ai/docs">Browse the docs</Button>→ same-tabAfter:
<Button href="https://agenta.ai/docs" external>Browse the docs</Button>→ new tabThe same
externalflag now drives the nav and footer link lists, which emittarget/relfrom it in both the desktop and mobile markup. Links flipped to external: the nav Docs link and the Resources dropdown (Changelog, Roadmap, and the hidden Tutorial), the footer Changelog and Roadmap (Docs and Status were already external), the two self-host chips in the OpenSource section (Docker Compose, Helm charts), and the 404 page's "Browse the docs" button. First-party routes (Pricing, Blog, internal pages) are untouched and still navigate in the same tab.Footer social icons
The repo's
social-*.svgfiles aren't named by platform, and the footer pointed at the wrong ones: LinkedIn rendered the Slack glyph and Slack rendered an OpenAI mark. There was no real LinkedIn icon in the repo. Added a LinkedIn SVG and remapped each platform to its actual glyph.Before:
/icons/social-2.svg(the Slack glyph)/icons/social-4.svg(an OpenAI mark)After:
/icons/social-linkedin.svg(new, real LinkedIn glyph)/icons/social-2.svg(the real Slack glyph)A comment now records which numbered file is which, since the filenames don't say.
HowItWorks scroll and nav pill
SECTION_VHconstant and dropped it from 500 to 320 (~67vh down to ~37vh of scroll per beat), so the six chat stages feel snappier.$0.00cost figures in the chat metadata to realistic numbers ($0.14 and $0.06).requestAnimationFrame, so the singlegetBoundingClientRectread happens at most once per frame.requestAnimationFrameloop (which ran every frame forever, even while idle) with a passive scroll/resize listener that coalesces into one rAF per frame and only writes the.nav-scrolledclass on an actual crossing of the 24px threshold.--nav-pill-insetfrom 24px to 12px so the floating pill sits closer to the top.Tests / notes
rel="noopener"is applied withoutnoreferrer, which keeps the referrer for our own docs analytics while still closing thewindow.openerhole.What to QA