Skip to content

feat: one design for the pages around the player, shipped as page.css - #171

Merged
alekswebnet merged 3 commits into
mainfrom
feat/page-css
Nov 10, 2026
Merged

alekswebnet merged 3 commits into
mainfrom
feat/page-css

Conversation

@alekswebnet

@alekswebnet alekswebnet commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Closes #170.

The pages that hold the player outside the demo looked nothing like it: the verifier's preview in the browser's system styles, the extension's page a white page with the player on it. This ships the demo's page design with the player and has every page import it, so none can drift.

Changes

  • @missing-elements/h5p-offline-player/page.css, source in packages/player/page/, copied to dist/ by build-workers.mjs with mark.svg, the brand mark. It holds what moved out of the demo's player-page.css, verbatim: the tokens for light and dark, the base rules, the bar with the brand and its nav and actions, the icon button, buttons, the status strip with its badge and timer, the player's box while it loads, cards and messages. Two additions: .button beside button, so a link can be a button (the verifier's Download), and the bar's three-column grid applies to a bar with a nav (.topbar:has(nav)), so a bar of a brand and its actions keeps the actions at the end.
  • The demo imports it at the top of player-page.css (1113 → 721 lines) and keeps its own rules. The config aliases the package path to the source, as it does the element's, so the demo needs no build of the player for it.
  • The verifier's preview is now that page: the bar with the mark, the file name and a byline, Download as a button, the theme switch (the demo's pin-or-follow logic), the status strip with READY/ERROR, the message and the timer. Its texts, ids and the end-of-preview behaviour are unchanged; the file name stays the page's h1, and the live region is the message, not the strip with its timer.
  • The extension carries page.css and mark.svg with the player's files, and its page links the stylesheet: the player's box while it loads, and the page's colours follow VS Code's theme, which the webview reads from its body and passes to the page in the address and, when it changes, as a message the page takes only from its own webview. The bar above keeps VS Code's own theme colours.
  • Design notes in design/demo.md, design/verify.md, design/vscode.md, the files in design/layout.md, a section in docs/setup.md.

Testing

  • pnpm build: dist/page.css 13.5 kB, dist/mark.svg 12.9 kB.
  • Verifier: 9/9 preview tests pass, with new assertions: the file name as the page's only h1, #message as the only live region, a theme switched in one tab followed by another tab of the same preview (fails without the storage listener), /page.css served as text/css, /mark.svg as image/svg+xml, the bar sticky, the strip at data-state="ready" before Download is clicked; the existing download and end-of-preview checks still pass.
  • Extension: 30/30 Node tests pass, with new ones on the page linking /page.css and on VS Code's theme: from the webview's body classes (high-contrast light as light) to the address, to data-theme on the page's <html>, live by message, and refused from any other window or origin or as any other value (fails without the origin check). test:vscode (a downloaded VS Code) was not run.
  • Typecheck passes for the demo, the verifier and the extension.
  • The demo is unchanged: the built site, served with vite preview, against the live site, 7 pages × 2 widths × 2 themes, 42 selectors × 39 computed properties: 720 element snapshots, no difference in any colour, font, border, spacing or layout property. The only differences were load-timing ones (the player's box on xapi.html before and after ready, the Star count's width before and after its fetch), and a second run of those pages with a longer wait had 0 differences. The bundled CSS has the shared rules inlined and no @import left.
  • The preview page opened from this branch, light and dark, no console errors: rivers-of-europe-book-from-bundle.h5p · preview, the strip reads "READY · Close this tab to end the preview. · 0.5 s".

Not verified

The extension's page inside a real VS Code, light and dark. The change there is a stylesheet link and two body rules.

Release

The player gets a new export, so a minor: 1.6.0. The verifier's preview needs a player that ships /page.css, so its dependency moves to that version when it is published; the extension bundles its own copy of the player's files. The extension's CHANGELOG is written at its bump, as before.


Summary by cubic

Ships the demo's page design as a shared stylesheet exported by the player, so the verifier's preview and the extension's page look like the demo and none of them can drift from it.

Closes #170.

  • Adds @missing-elements/h5p-offline-player/page.css and dist/mark.svg, built from packages/player/page/ and serving the demo's tokens, bar, buttons, status strip, player box, cards and messages.
  • The demo imports the package path by alias to the source, the verifier's preview and the extension link the built file; the demo's own sheet keeps only its site-specific rules.
  • The verifier's preview is now the demo's page: sticky bar with the mark, the file name as the page's only h1, Download as a button, theme switch with the pinned choice shared across tabs, and a status strip whose live region is the message alone, not the timer.
  • The extension's page takes VS Code's theme, light or dark, in its address and as a message when it changes, rather than following the system's; its bar above keeps VS Code's own colours.
  • The player gets a new export, so the next release is a minor (1.6.0); the verifier's dependency moves to that version when published.

Written for commit 350b1b8. Summary will update on new commits.

View guided diff Turn on auto-fix

The demo's tokens and components move to packages/player/page/page.css, shipped in dist/ with the brand mark and imported by the demo (by alias, from the source), the verifier's preview and the extension's page, so the pages around the player look the same and cannot drift. The verifier's preview is now the demo's page: the bar with the mark, Download as a button, the theme switch, the status strip with its state, message and timer.

Closes #170.
@alekswebnet alekswebnet self-assigned this Nov 10, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 16 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread packages/verify/lib/preview.html Resolved
Comment thread packages/verify/lib/preview.html Resolved
Comment thread docs/setup.md Resolved
Comment thread packages/verify/lib/preview.html Resolved
Comment thread packages/vscode/src/page.mjs Resolved
…e extension's theme from VS Code

From the review of #171: the file name is the preview page's h1 again; the live region is the message alone, not the strip with its timer; a theme switched in another tab of the preview is followed, as the demo's theme.js does; the extension's page takes VS Code's theme, light or dark, in its address and as a message when it changes, rather than the system's; the docs show page.css through a bundler, not a node_modules path no site deploys.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 9 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread packages/vscode/tests/server.test.ts Resolved
The theme test asked only for dark, so a server that refused light would
have passed it (cubic, on #171). It now asks for both, and checks the setting
and <html>'s data-theme for each.
@alekswebnet
alekswebnet merged commit c28b52c into main Nov 10, 2026
9 checks passed
@alekswebnet
alekswebnet deleted the feat/page-css branch November 12, 2026 09:26
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.

One design for the pages around the player: the demo's, shared as page.css

1 participant