layouts
All repositories: gitoria
8.6 KB
# MP — media player, first version (mobile first)Worker MP (Atlas). Mission: missions/MP-media-player.md (caramboleyo: "start a mobile first layout for a media player in components andlayouts"). Branches: `mp-player` in both repos, worktrees under /media/STORAGE/claude-scratch/atlas/MP/. NOT merged, NOT deployed, NOT pushed.## What was built**components.hybriel.worldapi.org, commit dd003e5 (branch mp-player)**- `components/media-player/media-player.hl` — the player, pure Hybriel (no JavaScript file): the browser's own `<video>` / `<audio>`element plays; the component draws its own controls around it. Video is 16:9 letterboxed (`object-fit: contain`); audio shows a coverimage (`cover`) with the title and artist. Controls, all at least 44 px (the play / pause one 52 px, the largest): a seek bar you dragwith a finger (pointer events, `setPointerCapture`, `touch-action: none`; the played part in the accent, the buffered part lighter,a thumb dot; the whole strip is a 44 px touch area with a thin visible bar), back 10 s, play / pause (two icons toggled by a class, sothe DOM is not re-created), forward 10 s, current time / total time, mute (two icons), playback speed 1 / 1.25 / 1.5 / 2 (one buttonstepping through them), fullscreen on video (`requestFullscreen`). Keyboard: the video takes the focus (`tabindex = 0`), Spaceplays / pauses, ArrowLeft / ArrowRight jump 10 s; the seek bar itself takes the keyboard too (arrows, Home, End).- The queue under the player: `queue = [{ src, title, dur }]`, dense rows (44 px tap rows that look thin — the touch area is thepadding, the visible rows hug their text), the item whose `src` plays marked with the accent colour on a surface, nothing else. A tap(and the end of an item) calls the host's `onPlay(src)` function (hybriel#87); the host hands a new `src` back and the player is builtanew with it. `autoPlay = "true"` (the demo sets it after a pick) starts the new item at once.- The media element loads its metadata DURING the page parse, before the handlers bind: `loadedmetadata` / `durationchange` / the first`progress` have already fired when the component is live, so the total time and the buffered part would stay at 0. Fixed the codeeditor's way: a 100 ms CSS animation (`animationiteration`) on the video (and on the cover image — the audio element is `display:none`,where a CSS animation never runs) reads duration, buffered and mute state once the page is live, then turns itself off.- `components/icons/icons.hl` — the new icons `play`, `pause`, `skipBack`, `skipForward`, `volume`, `volumeOff`, `fullscreen`, in thesame style (one path, stroke = currentColor). The volume and play paths were redrawn once to centre them optically.- `components/media-player/demo.hl` + route `/media-player` + `README.md` + an entry in `components/index.hl`. The demo's media files(public domain, made with ffmpeg here): a 30 s test video (testsrc2 + a sine, 320×180, 704 KB), a 45 s tone (mp3, 270 KB), a coverPNG (a music note drawn as SVG, rendered with rsvg-convert).- `lib/media.hl` — the demo's media served from `storage/media` as a **function route**: a Bytes body (a file route would hand aString; a media element needs the bytes), the right content type (video/mp4, audio/mpeg, image/png) and **HTTP Range answers**(206 + Content-Range), so the browser's media element can seek without downloading the whole file. Hybriel's own file routescannot do ranges or Bytes bodies yet (WebFramework's `serveFile` notes it), which is why this is a function route.- Gate (`tests/browser.mjs`): 35 new checks in a "MP" block (the home link, the README, no .js file, the media files served with theright type, 16:9, the controls exist, play by a real click, the time and played bar follow, the buffered part, Space pauses, theseek bar dragged with real pointer events to 10% and 60% of a 30 s clip, back / forward 10 s by real clicks, the speed cycle1.25 → 1.5 → 2 → 1, the queue rows with the current one marked, a real tap on the second queue item → the audio player with thecover, autoplay, no fullscreen button for audio, mute toggles icon and label, no console errors), then 390 px checks (every control≥ 44 × 44 including the seek strip and both queue rows, the play button the largest, the video 16:9 inside the width, no horizontalscroll) and the new page in the mobile-first, base-look and offline lists (12 public component files now, 11 home entries).**Gate 605/0** (8740–8749). The MP checks fail on the old code (the old app 404s /media-player, the home has no link — verified on agit-archive copy of main on port 8750).**layouts.worldapi.org, commit 5b5dbf0 (branch mp-player)**- `tools/sync-components.sh` now also copies `media-player/media-player.hl` + README (25 files); ran it against components dd003e5, so`components/media-player/` is a byte-verbatim copy (components/SOURCE names the commit).- `components/showcase/media-player.hl` — `/components/media-player`: the player with the same queue inside the app shell (ContentFirst,site header, sidebar), and the README link (`/read/readme-media-player`). `lib/media.hl` (the same function route, storage/media) andthe same media files. `lib/site.hl`: the page in the components overview and its README in the reader's list. `components/styles.hl`:the page root is a block.- `theme/theme.hl` section 3, the themed rules (no fork of the component): the video area a sunken surface with radiusLarge, the seektrack sunken with radiusSmall, the buffered layer the border grey at 60% (the unbuffered end reads as the lighter end of one bar), theplayed part and the thumb the accent, the buttons the theme's plain ones (transparent, surface on hover, radiusSmall), the times muted,the current queue item the accent on a surface, its length the accent too.- `.check-theme-ignore` skips the verbatim copy folder.- Gate: the page added to the route list — **340/0** (8750–8759). `node theme/check-theme.mjs .` → **0 problems**.## Screenshots (looked at, via a fresh reviewer each round)- `/media/STORAGE/claude-scratch/atlas/MP/shots/video-paused-{390,1280}.png` — the video paused: the colour-bar test clip 16:9, the seekbar at 0 with the thumb at the left, one row of controls (back, play, forward, "0:00/0:30", mute, "1×", fullscreen), the queue with"Test clip (video) 0:30" highlighted, the README link.- `video-playing-{390,1280}.png` — playing: the pause icon shows, the played part a short black bar with the thumb at ~5%, the time"0:01/0:30", the video frame advanced.- `audio-queue-{390,1280}.png` — after a tap on the second queue item: no video area, the cover (grey tile, music note) with "Test tone(audio)" and the artist line, the time "0:01/0:45", no fullscreen button, "Test tone (audio) 0:45" highlighted.- `layouts-video-paused-{390,1280}.png`, `layouts-video-playing-{390,1280}.png`, `layouts-audio-queue-{390,1280}.png` — the same in thedark theme: the video area dark, the played part blue (the accent), the current queue item blue on a surface, the shell (header,sidebar) around it.- Reviewed by a fresh reviewer in four rounds: the first found the control row wrapping at 390, misaligned icons (a wrong CSS selector— `.mp-buttons` class vs the `mp-buttons` element — let the site's button padding win), the speed button a long label, the total time0:00 (the load-before-bind problem above), a seek thumb overhanging. All fixed; the last round found nothing left in the player.The one recurring note in the 1280 layouts shots (a header apparently mid-page) is an artifact of Chrome's full-page capture(`captureBeyondViewport`) painting at the page's scroll offset — measured in the live page: the sticky header sits at viewport y = 0.## What is missing / not done- No captions track UI (the README says so); no volume slider (mute only); no picture-in-picture button (the browser's own menu on thevideo still has it). A longer real clip (the demo files are 30/45 s) and a real queue of more than two items would be the next test.- The layouts gate's own per-page screenshots live in `.scratch/gate-shots/` of the worktree (the gate's naming); nothing of the gatechecks the player's behaviour inside layouts beyond the page answering 200 and the theme checks.- Both branches are unmerged and undeployed; Atlas reviews and deploys.## Logs- Gates: components 605/0 (gate8.log), layouts 340/0 (layouts-gate2.log), check-theme 0 problems. Old-code proof: 6/6 MP checks fail onmain (the page 404s).- Processes: every server, gate and Chrome this mission started was stopped by its saved PID; no port of 8740–8759 listens, no Chromewith a cwd under the scratch dir is left, the hl-browser-tier profile dirs are removed.
Branches
Latest commits
- 4099e64aMerge branch 'font-segoe-ui' into mainAtlas
- e14fb795|||PR Theme font: Segoe UI first (his choice 2026-11-19)Atlas
- 44071d2cMerge branch 'hl-standard-5' into mainAtlas
- 5ea64202|||PR Gate: count the new-tab check's console errors tooAtlas
- 2752ceddMerge branch 'hl-standard-4' into mainAtlas
- ac552b81|||PR Gate: keyboard (Tab/Enter/Space) and Back/Forward/reload/new-tab checks (HL-STANDARD F5, F21)Atlas
- 8cddcaa9Merge branch 'hl-standard-2' into mainAtlas
- 2b480a64|||PR Type the route parameter of main-menu build (HL-STANDARD L10)Atlas
- ab54a39dMerge branch 'hl-standard' into mainAtlas
- 04d36fcf|||PR Type function parameters and drop unneeded let (HL-STANDARD L2, L10)Atlas
- 220c8fa4Merge branch 'readme-audit' into mainAtlas
- b78fb85a|||PR README matches the codemre
- 9f351699Preserve comments and nest supported selectors without changing rendered outputmre
- 97110ad9WIP: nest accepted layout selectors; stopped at startup parse failuremre
- ce4a0baeKeep caller slot styles whole so minimal shell apps startmre
- 12cd3992Re-vendor complete Hybriel plugins and runtime to day44mre
- b05c20feBackup tar: --hard-dereference, so mpackdb sidecars are never stored as hard links (Tracker's finding)mre
- 8d9ed0b8Re-vendor complete Hybriel plugins and runtime to day39mre
- ebd00b6cNest caller slot styles in three-panemre
- 009991efNest caller slot styles in list-firstmre