Skip to content

feat(site): add pre-release docs banner on main.videojs.org#1575

Open
R-Delfino95 wants to merge 5 commits into
videojs:mainfrom
R-Delfino95:docs/pre-release-banner
Open

feat(site): add pre-release docs banner on main.videojs.org#1575
R-Delfino95 wants to merge 5 commits into
videojs:mainfrom
R-Delfino95:docs/pre-release-banner

Conversation

@R-Delfino95
Copy link
Copy Markdown
Collaborator

@R-Delfino95 R-Delfino95 commented May 20, 2026

Summary

Adds a top banner to the main.videojs.org branch deploy so users who land on pre-release docs (via search engines, shared links, etc.) know they're not on the stable site. The banner links back to videojs.org and is intentionally non-dismissible. Follows the standard pattern used by React, Vue, and Svelte.

Closes #1306.

Changes

  • New PrereleaseBanner.astro component — renders only when isPrereleaseSite(Astro.site) returns true, so no markup is shipped on videojs.org or deploy previews. Non-dismissible by design.
  • consts.ts — Added PRERELEASE_URL and the isPrereleaseSite() helper.
  • astro.config.mjs — Now imports PRODUCTION_URL and PRERELEASE_URL from src/consts.ts instead of hardcoded strings, so there is a single source of truth for both hostnames.
  • Base.astro — Imports and renders <PrereleaseBanner /> above <LegacyBanner />.
  • Pre-release hostname rename — Updated astro.config.mjs, README.md, CLAUDE.md, and sentry.server.config.ts from next.videojs.org to main.videojs.org to match the chosen subdomain.

Accessibility

  • Banner container uses role="region" with aria-label="Pre-release documentation notice".
  • Reuses the same color tokens as the legacy banner, so contrast in light/dark themes is consistent.

Notes for reviewers

  • The pre-release banner stacks on top of the legacy banner on main.videojs.org. Both serve different audiences so I left them both visible — happy to hide the legacy one on the pre-release host if preferred.
  • The hostname is centralized in PRERELEASE_URL in src/consts.ts. If the pre-release subdomain moves, that's the only place to update (the config imports from there directly).

Test plan

  • pnpm astro check — 0 errors, 0 warnings
  • pnpm test — 397/397 passing
  • Local smoke: BRANCH=main pnpm dev — banner appears, links to videojs.org
  • Local smoke: pnpm dev (default) — banner does NOT appear
  • Local smoke: CONTEXT=production pnpm dev — banner does NOT appear
  • Verify in dark mode

Render a dismissable top banner on the main.videojs.org branch deploy
that warns users they're viewing pre-release docs and links back to the
stable site at videojs.org. The banner is gated by isPrereleaseSite()
at build time, so no markup ships to production or deploy previews.

Split the shared banner-dismissed CSS variant and localStorage key in
two (legacy-banner-dismissed, prerelease-banner-dismissed) so each
banner can be dismissed independently.

Also rename the pre-release host from next.videojs.org to
main.videojs.org in astro.config.mjs, the README, and the Sentry
comment to match the chosen subdomain.

Closes videojs#1306
@netlify
Copy link
Copy Markdown

netlify Bot commented May 20, 2026

👷 Deploy request for vjs10-site pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 1a2f5ce

@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

@R-Delfino95 is attempting to deploy a commit to the Mux Team on Vercel.

A member of the Team first needs to authorize it.

@R-Delfino95
Copy link
Copy Markdown
Collaborator Author

R-Delfino95 commented May 20, 2026

Hi @decepulis! Quick question.

Right now the pre-release banner stacks on top of the existing legacy banner ("Using Video.js v8 or earlier?") on main.videojs.org.
So on main.videojs.org both are visible (stacked), and on videojs.org only the legacy one shows.

Do you think that's fine as-is, or would you prefer to hide the legacy banner on main.videojs.org so only the pre-release one shows there? I went with the stacked option for now since the issue didn't ask to touch the legacy banner.

@decepulis
Copy link
Copy Markdown
Collaborator

Yeah stacked is fine! Maybe some minor visual distinction with a border or background color if you haven't already done that

@R-Delfino95
Copy link
Copy Markdown
Collaborator Author

Yeah stacked is fine! Maybe some minor visual distinction with a border or background color if you haven't already done that

Yes! This is how it looks right now:

image

@decepulis decepulis self-requested a review May 22, 2026 17:09
@decepulis
Copy link
Copy Markdown
Collaborator

This is looking really good.

One more change requested. Let's make this banner non-dismissible.

Remove the dismiss button, localStorage key, and CSS variant from the
pre-release banner. The banner must always remain visible on
main.videojs.org so users are never left unaware they're on pre-release
docs.
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c76e779. Configure here.

Comment thread site/src/consts.ts
@R-Delfino95
Copy link
Copy Markdown
Collaborator Author

This is looking really good.

One more change requested. Let's make this banner non-dismissible.

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Feature: Pre-release banner on next.videojs.org

2 participants