Repository navigation
feat: one design for the pages around the player, shipped as page.css - #171
Merged
Merged
Conversation
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.
Contributor
There was a problem hiding this comment.
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
…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.
Contributor
There was a problem hiding this comment.
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 inpackages/player/page/, copied todist/bybuild-workers.mjswithmark.svg, the brand mark. It holds what moved out of the demo'splayer-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:.buttonbesidebutton, 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.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.h1, and the live region is the message, not the strip with its timer.page.cssandmark.svgwith 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/demo.md,design/verify.md,design/vscode.md, the files indesign/layout.md, a section indocs/setup.md.Testing
pnpm build:dist/page.css13.5 kB,dist/mark.svg12.9 kB.h1,#messageas the only live region, a theme switched in one tab followed by another tab of the same preview (fails without the storage listener),/page.cssserved astext/css,/mark.svgasimage/svg+xml, the bar sticky, the strip atdata-state="ready"before Download is clicked; the existing download and end-of-preview checks still pass./page.cssand on VS Code's theme: from the webview's body classes (high-contrast light as light) to the address, todata-themeon 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.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 onxapi.htmlbefore 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@importleft.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.
@missing-elements/h5p-offline-player/page.cssanddist/mark.svg, built frompackages/player/page/and serving the demo's tokens, bar, buttons, status strip, player box, cards and messages.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.Written for commit 350b1b8. Summary will update on new commits.