Skip to content

website: sticky JS-disabled warning + preview:website:watch - #34

Merged
okcodes merged 1 commit into
mainfrom
website-noscript-banner-and-watch-preview
Sep 6, 2026
Merged

okcodes merged 1 commit into
mainfrom
website-noscript-banner-and-watch-preview

Conversation

@okcodes

@okcodes okcodes commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two related follow-ups from #32/#33:

1. The no-JS banner is now sticky and more prominent. It previously scrolled away with the page — but this is the one warning on the site that matters most: the whole point of the page is the console demo, and a visitor with JS off who can't get it to open would reasonably read that as a bug rather than expected behavior. It's position: sticky now, with a <noscript>-scoped <style> that sets Nav's <header> to position: static — otherwise both elements fight over the sticky top: 0 spot while scrolling and visually overlap. Copy is punchier and tells the visitor what to do about it ("Enable it in your browser to try it").

2. Added pnpm preview:website:watch. preview:website (#33) is a one-shot build-then-serve. This rebuilds automatically on every change under website/src or website/index.html and keeps one vite preview running — scripts/watch-preview.mjs, a plain node:fs.watch loop with no new dependencies (no chokidar/concurrently), since a full rebuild here is well under a second. Still no hot reload — refresh the browser yourself after each rebuild — same trade preview:website already made, just automated.

Full reasoning for both in DECISIONS.md.

Test plan

  • Built and grepped dist/index.html — banner markup present, sticky/z-50 classes compiled by Tailwind.
  • Ran preview:website:watch, edited a source file, confirmed it rebuilt automatically and the running vite preview served the updated output.
  • pnpm run typecheck and pnpm run lint (oxlint, repo-wide) — no new warnings.
  • Reviewer: disable JavaScript in a browser, load the deployed/preview site, scroll, and confirm the banner stays pinned at the top and Nav no longer overlaps it.

🤖 Generated with Claude Code

The no-JS banner (added in #32) scrolled away with the page - not
acceptable for the one warning that matters most here, since the whole
site exists to demo the console and a visitor who can't get it to open
needs to know why. It's now position: sticky, with a <noscript>-scoped
<style> handing the sticky-top-0 spot to it instead of Nav's <header>
(which would otherwise fight it for that spot while scrolling). Copy is
punchier and points at the fix ("Enable it in your browser").

Also adds preview:website:watch, rebuilding the prerendered build on
every source change (scripts/watch-preview.mjs, plain node:fs.watch, no
new dependencies) and keeping one `vite preview` running - no hot
reload, refresh manually, same trade preview:website already made.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@okcodes
okcodes merged commit 9f74ea9 into main Sep 6, 2026
1 check passed
@okcodes
okcodes deleted the website-noscript-banner-and-watch-preview branch September 6, 2026 14:04
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