hex/site
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Dax 648ec4725a
labs: transcribe dropped audio files (#1798)
* labs: transcribe dropped audio files

Add Labs › Transcribe dropped audio (off by default) and its backend:
WAV and MP3 on every OS, M4A/AIFF/CAF on macOS through the meeting import
bridge, decoded in 30 s pieces, transcribed in-process with the selected
model, and written as <stem>.txt beside the file with a Downloads fallback,
collision numbering, atomic writes, cancellation, and progress. Move the
shared pieces reader out of the transcribe CLI so both use it.

The window's drop target lands in a later change.

* labs: drop audio files on the window to save a transcript

The window root takes files with the extensions this build reads while
Labs › Transcribe dropped audio is on: a file drag shows "Drop to save a
transcript" over the window, a drag Hex can't read says what it reads, and
a drop queues one job per file behind the one running, all at the dictation
model and language in use. A worker transcribes each file and the toast
shows its name, a progress ring and percentage, how many wait behind it,
and Cancel; a saved file shows its name, the whole path, and Show in folder
(meeting::reveal), and a failure shows the backend's own words. The lab's
card offers Transcribe a file…, which opens the same queue's native file
dialog, for Wayland, where nothing can be dropped.

file_transcript exposes its extension table for the drop filter and dialog,
and finds every format from that one list. New goldens cover the hint and
the transcribing toast, and the drop-transcribe card now leads with a wave.

* meeting: use the renamed bridge in the import test

* transcription: find a temp folder through a symlinked path

* transcription: finish the audio file drop's review fixes

A drop right after Cancel (or the lab turned off and on) started a second
worker and a second transcription service while the first was still loading
or running. The running job now stays tracked as cancelling, its toast says
Cancelling… with no Cancel, and the next queued file starts only when its
worker reports Done or its channel closes. A cancel before the save also
stops a cancelled file from writing a transcript.

Also: validate a WAV whole before a model loads, report an unknown MP3 length
as indeterminate progress, map a bridge decode failure to Unreadable, keep a
writable source folder's transcript beside it without Downloads, name this
build's formats in the Labs card, use the kit's 16 pt toast lead, route Show
in folder through the host, derive the Audio folder through app_paths, and
correct the stale comments and feature map.

* transcription: read dropped files through the shared pieces reader

The rebased tree already decodes every container through Pieces, so the
dropped-file backend now opens, validates and reads one Pieces instance
instead of its own WAV, rodio MP3 and macOS bridge readers. Progress comes
from the reader's position and duration, and a compressed file with no
header duration reports no fraction. The retired Labs › Expire meeting audio
gate and the removed Transcribe files lab leave the tree too.

* labs: refresh the goldens for the dropped audio card

The card's row and the drop hint and toast change the Labs images and the
two drop scenes; only those eight goldens changed.

* labs: finish the dropped audio card's translations and goldens

The string tables already translate Audio files and Transcription stopped,
so the lab reuses them; the card's English line gains translations, the
website catalog lists the lab, and the what's new goldens show it.

* labs: offer every audio format the shared reader decodes

the dropped audio lab offered wav and mp3 everywhere, and the old macOS decoder's extras only on macOS, though every OS reads through the shared pieces reader. it now offers one list: wav, mp3, m4a, mp4, aiff/aif, caf, flac, ogg/oga/opus, webm, and mkv. every copy, translation, and golden names it, and a fixture proves the reader takes each one. also names the codec or missing track on a failure, keeps a late cancel's saved toast, and waits for a cancelled worker before the next file.

* labs: offer raw AAC and MOV files too

* labs: offer the reader's other common extensions

the shared pieces reader detects formats by content, so m4b, m4v, 3gp,
aifc, mka, weba, and wave decode too. the extension list is now described
as the common names it offers rather than an exhaustive set, empty files
and unreadable wavs say why, and a lab-off poll drains the worker's
channel instead of reading one event.

* transcription: free the audio slot before a result is sent

A long file is transcribed one piece after another, and each piece admits
the slot as soon as the previous result arrives. The worker released the
slot only after sending that result, so the next admit could see it busy
and fail mid-file with "Another transcription is running".

Also fixes the codec refusal's grammar and two stale comments.

* transcription: say where a damaged file stopped

a compressed file that stops decoding partway now says where it stopped
("talk.m4a is damaged at 12:34") instead of only that it is corrupt; a wav
refused up front keeps the old words. the slot-order test uses a rendezvous
response channel and waits for the slot to read free before receiving, so
sending before the admission drops fails every time instead of occasionally.
a locked drop-transcribe card keeps the lock's words instead of replacing
them with its formats line.
2026-11-18 20:49:59 -05:00
..
perf perf(site): measure main-thread work during idle and animation (#1823) 2026-11-14 05:39:15 -06:00
public feat(site): a shareable page and link card for every lab (t1560) (#1818) 2026-11-13 22:46:21 -08:00
scripts feat(site): a shareable page and link card for every lab (t1560) (#1818) 2026-11-13 22:46:21 -08:00
src labs: transcribe dropped audio files (#1798) 2026-11-18 20:49:59 -05:00
.gitignore ci: read release secrets from aws secrets manager (#1606) 2026-11-09 15:18:26 -05:00
bun.lock feat(site): a shareable page and link card for every lab (t1560) (#1818) 2026-11-13 22:46:21 -08:00
cloudflare.config.ts deploy dev to the anomaly-dev account (#1706) 2026-11-11 18:10:50 -05:00
index.html feat(release): serve Hex at anoma.ly/hex with its files at /hex/files 2026-10-23 08:57:57 -04:00
labs.test.ts feat(site): a shareable page and link card for every lab (t1560) (#1818) 2026-11-13 22:46:21 -08:00
package.json feat(site): a shareable page and link card for every lab (t1560) (#1818) 2026-11-13 22:46:21 -08:00
README.md feat(site): a shareable page and link card for every lab (t1560) (#1818) 2026-11-13 22:46:21 -08:00
strobe.json perf(site): pulse the option key's glow at 30 fps and let the idle head sleep between frames (#800) 2026-11-01 22:25:16 +10:00
tsconfig.app.json
tsconfig.json
tsconfig.node.json feat(release): serve Hex at anoma.ly/hex with its files at /hex/files 2026-10-23 08:57:57 -04:00
vite.config.ts site: bench with @hona/strobe 0.2: canvas frames, GPU compiles, hidden source maps (#1218) 2026-11-03 18:20:34 -06:00
worker.test.ts ci: read release secrets from aws secrets manager (#1606) 2026-11-09 15:18:26 -05:00
worker.ts ci: read release secrets from aws secrets manager (#1606) 2026-11-09 15:18:26 -05:00

Hex website

https://anoma.ly/hex is the one Hex site (dev: https://dev.anoma.ly/hex). bun run dev starts Vite. bun run build [--mode dev] checks TypeScript and builds Cloudflare Build Output with base /hex/; bun run check:downloads checks that every download link serves a file. cloudflare.config.ts defines both Workers. CI deploys them, never a laptop: Site builds without secrets and .github/release/deploy-site.sh deploys the verified Build Output (cf deploy --prebuilt --mode <mode>), refusing any Worker, route, or binding other than this config's (docs/releasing.md). worker.ts serves the site and, at /hex/files/, the release files: the installers and legacy appcast built with the site, the dev notes from the Release workflow's dev-notes branch, and the frozen 2.3.1 feeds and artifacts read from hex-production-files. It 301s other hosts and plain HTTP to the canonical host.

The download section (src/Download.tsx) is one install switcher and nothing else: macOS, Windows, and Linux tabs of equal width with a sliding pill, each with every way to install there in at most three rows (Mac: DMG, Homebrew; Windows: installer, PowerShell script; Linux: script, package, binary), a small switch inside a row where it has variants (x64/ARM64 for the Windows installer and the Linux binary, which the Linux packages follow too; Debian, Fedora, Nix, and AUR for the Linux package), and the download button or copyable command. All three stacks share one grid cell, so switching tabs never moves the page. An Intel Mac sees that Hex requires Apple silicon instead of a download. It selects the visitor's OS and architecture on first paint and refines them with UA client hints. Versions, URLs, and commands live in src/release.ts; file links name /hex/download/<target>, which the Worker sends to the stable release once there is one and to the newest dev build until then. The AUR package appears from the first build after a stable release, which pushes hex-bin. Add ?platform=mac|mac-intel|windows-x64|windows-arm64|linux|linux-arm64|mobile to see each default.

The hero is a show (src/shout/, plain JS): Kit's notifications pile up around a floating head that answers them out loud, dictates prompts into an OpenCode window that fixes the complaints, powers up, and finally sprays the inbox clean. WebGPU renders it, with a Canvas 2D fallback (?canvas2d forces it).

  • The prerendered page shows public/shout-idle.webp, a still of the idle head, in .show__head. The engine chunk loads when the browser is idle or the visitor reaches for the ⌥ key (phones wait for the tap), then draws the same head into that box (the canvas reads the box, 3.2 head radii wide, so nothing moves).
  • Nothing audible or heavy loads before the key press: the voice bank and its manifest are fetched on start, the opening clips first. The sound toggle in the header remembers its choice in localStorage.
  • It pauses when the tab is hidden or the hero is off screen, runs the idle head at 30 fps on a timer (no frame callback between its frames), caps the pixel ratio (1.5 on phones), and thins the messages on small screens. The option key's glow pulses at 30 fps from src/glow.ts, set by the key until the engine runs and then by the engine in the head's frame: as a CSS animation it restyled the page on every vsync. Reduced motion keeps the still until the key is pressed, then runs only the calm stage with no shake or flashes.
  • Dax, Jay and Frank (teammates) appear with their real X avatars; everyone else is invented with a generated portrait (src/shout/assets/people.webp). Brand glyphs are Simple Icons (CC0) and Lucide (ISC); OpenCode's mark is from opencode.ai.

VITE_SHOUT_CAPTURE=1 builds a capture variant with a deterministic frame stepper (?capture, window.__shout) and an audio play log; production builds strip it. Regenerate the idle still after changing the head:

VITE_SHOUT_CAPTURE=1 bunx vite --port 5531
HEX_SITE_URL=http://127.0.0.1:5531 bun run generate:poster

Performance

perf/hex.bench.ts is a strobe bench: load to the live head, the idle head for 8 s, and the first 20 s of the show after a click on the key. strobe.json builds the site and serves the Build Output under /hex/ with perf/serve.ts. strobe builds and serves both variants with this checkout's strobe.json and perf/, so any commit works as the base. From the repository root:

strobe bench site/perf/hex.bench.ts --base origin/dev --head .
strobe bench site/perf/hex.bench.ts --head . --check            # each case once, pass or fail
strobe report experiment <exp_…> --format pr --update-pr <n>     # the results block in PR n

In a PR, write your own text (what strobe showed, what changed) and let --update-pr place strobe's generated results block: it replaces only its own block after a rerun. Don't edit inside it. The bench's expect refuses a block whose page isn't the landing page (WrongScreen).

The show draws at its own frame rate, not the display's: canvas.frames and canvas.interval.p95 count the show's WebGPU frames, where presented frames count the display's refreshes. gpu.compile is the GPU process's shader and pipeline work during a load.

Social image

The Open Graph and Twitter image is public/og.png (1200 × 630): the app icon, the name, and one line. scripts/og/hex-icon.png is the 1024 px icon exported from the built app (iconutil -c iconset Hex.app/Contents/Resources/AppIcon.icns). Regenerate with bun run generate:og, bump the ?v= on both image tags in index.html, rebuild, deploy, and fetch the published PNG.

The Labs pages (/hex/labs, /hex/labs/<id>) each have their own card, drawn at build by scripts/labs.ts with satori and resvg (no browser): the icon, "Hex Labs", the lab's title and line, and its OSes. Their ?v= is a hash of what the card shows. src/labs.json comes from the app's Labs registry; never edit it by hand (HEX_UPDATE_LABS_JSON=1 scripts/check labs::web from the repository root rewrites it).

Messages also plays public/og.mp4 (og:video) inline on a loop in place of the image; other apps keep the PNG. It's a 4.5 s, 1200 × 630, 60 fps silent H.264 loop: the icon speaks and the words pile up under it (scripts/og-video/hex-pour.js, matter.js physics, deterministic per frame so the last frame meets the first). bun run generate:og-video [hex-line|hex-key] renders it through Chromium and ffmpeg; bump the ?v= on both og:video tags after changing it. The Worker answers Range requests for .mp4, which Safari and AVFoundation need.