Skip to content

Free, open-source AI video generator for Mac. Run LTX-2.5 and MiniMax H3 (Hailuo) locally on Apple Silicon: text-to-video and image-to-video with sound, lip-sync, character LoRA training, songs from lyrics (YuE2) and image editing (Qwen-Image-Edit). One-click install via Pinokio. Offline: no cloud, no API key, no NVIDIA GPU.

release(v4.3.0): the engine picker is a dropdown, and contributing has an address

mrbizarro325504de3f6e
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..7043a8b
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,94 @@
+# Contributing to Phosphene
+
+**Short version: yes, send it.** Bug fixes, new features, new engines, docs,
+copy fixes, a better ETA estimate — all of it is welcome, and none of it needs
+to be asked about first.
+
+---
+
+## Read this before you open a PR
+
+**Your PR will say CONFLICTING. That is expected and it is not about your work.**
+
+Public `main` is published as a curated snapshot commit rather than by merging
+branches — each release replaces the tree in one commit. Nothing can
+fast-forward onto that, so *every* incoming PR shows as conflicting regardless
+of how clean the patch is.
+
+It still gets read, and it still gets shipped. What happens is:
+
+1. Your PR is reviewed as a patch — the diff, the reasoning, the validation.
+2. If it holds up, the change is applied to the working tree.
+3. It ships in the next release, and **you are credited by name in the release
+ notes and usually in the commit message**.
+4. Your PR is closed with a comment saying exactly what landed and where.
+
+Closed does not mean rejected here. Two recent examples: a 48 GB RAM-gate
+mismatch and a Pinokio shell-dispatch hang were both contributor-diagnosed;
+the second one became an enforced build gate across all ten launcher scripts,
+which is more than the original patch asked for.
+
+If a change is *not* going to land, you will be told that and why, in the PR.
+
+---
+
+## What is most useful
+
+**A good bug report is worth as much as a patch.** The most valuable
+contributions this project has had were reports where someone captured the
+actual crash line, showed what *did* work on the same machine, and narrowed the
+difference. That turns an unreproducible report into a ten-minute fix.
+
+If you are reporting a render problem, the things that matter:
+
+- **Chip and macOS version** (`Apple M2 Max`, `macOS 26.5.2`) — several bugs
+ have been chip-specific, including one where macOS reports the same failure
+ under a different name on different silicon.
+- **Phosphene version** and the vendored engine tag (both are in the header).
+- **What the panel log says**, and if it crashed hard, what the process printed
+ to stderr.
+- **Whether the engine CLI reproduces it** outside the panel. This single fact
+ splits "engine bug" from "panel bug" immediately.
+
+## New engines are welcome
+
+The engine table is data-driven on purpose. Adding one is an `ENGINES` entry, a
+`<symbol>` for its mark, and a probe — the picker, the tooltips, the mode
+gating, the install offer and the CSS accents all derive from that row. If you
+want to add an engine, open an issue first so we can agree on the shape before
+you write the adapter.
+
+## Things that will get pushed back on
+
+- **A dependency added without a reason in the commit message.** Every pin in
+ this repo is a paid lesson and they are documented as such in `CLAUDE.md`.
+- **A change to a render path with no evidence it is identical where it should
+ be.** Byte-identical output at a fixed seed, or a measured difference — not
+ "looks the same to me".
+- **Long Pinokio shell payloads.** `node scripts/check_pinokio_scripts.js`
+ enforces this and will fail the build.
+- **A claim in user-facing copy that is not true on a fresh install.**
+
+## Before you send
+
+```bash
+node scripts/check_ltx_pin.js # engine pin agreement
+node scripts/check_pinokio_scripts.js # launcher payload sizes
+python3 scripts/check_output_codec.py # the last render is what was asked for
+node --check install.js && node --check update.js
+```
+
+and run the panel test suites:
+
+```bash
+for t in test_*.py; do ./ltx-2-mlx/env/bin/python -m unittest "${t%.py}"; done
+```
+
+Tests are not a formality here. Several of them exist because a thing shipped
+broken in a way that looked fine — they encode the failure, not the feature.
+
+## Licence
+
+By contributing you agree your work ships under the repository's licence.
+Third-party model weights and brand marks are **not** vendored into this repo;
+if your change needs an asset, it downloads it at install time.
diff --git a/VERSION b/VERSION
index 6aba2b2..8089590 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-4.2.0
+4.3.0
diff --git a/docs/STATE.md b/docs/STATE.md
index 8548a39..dc00dfc 100644
--- a/docs/STATE.md
+++ b/docs/STATE.md
@@ -1,5 +1,16 @@
# Phosphene — project state, history, open work
+> **🎛️ 2026-08-15 — v4.3.0: the engine picker becomes a dropdown, the header stops fighting for room, and contributing has an address.**
+>
+> - **The picker is a dropdown.** Two segments plus the health cluster already overflowed a 14" window, and a third engine could not have fitted at any width — which mattered, because `ENGINES` already carries a **Flux Video** row behind `LTX_ENGINE_PREVIEW=1`. A trigger showing only the ACTIVE engine costs one header slot no matter how many engines exist, and it *states* the selection instead of leaving it to a highlight. Each menu row now carries its tagline, because the menu is where someone chooses BETWEEN engines: "every mode, LoRAs, characters" / "joint video + dialogue + sound" / "weights announced, not released yet". Every piece of state logic — install offers, repair, capability, mode gating, `engineSegClick` — is untouched; only the presentation changed.
+> - **The menu is PORTALED to `<body>`** and positioned fixed. `<header>` is `overflow:hidden` — the same clipping that produced the "avatar cut off" report — so a menu rendered inside it would have been sliced at the header's edge.
+> - **The RAM pill lost three quarters of its words.** `21.0 / 64 GB · 33% pressure` → **`21/64 GB · 33%`**. That badge answers one question at a glance — am I near the ceiling — and the decimal on used never changed a decision. The full sentence (`21.4 of 64 GB in use · 33% memory pressure · swap 4.6 GB`) moved to the tooltip, where it is available without costing header room on every machine.
+> - **The standalone version badge is gone.** `#versionPill` already carries the version in every state it can be in — `Up to date · 4.2.0`, `Update to 4.3.0`, `Checking · 4.2.0`, `4.2.0 · dev · <sha>`, `4.2.0 · offline`. Printing it twice cost a slot the health cluster needed on exactly the machines where the cluster was already truncating.
+> - **CONTRIBUTING.md, and the thing it exists to say: a CONFLICTING PR is not a rejected PR.** Public `main` is a curated snapshot commit, so nothing can fast-forward onto it and *every* incoming PR shows conflicting regardless of quality. Two well-diagnosed contributor PRs sat in draft looking broken because of it. The doc states the actual path — reviewed as a patch, applied to the tree, shipped, credited by name — and says plainly that a change which will not land gets told so, in the PR.
+> - **One row, both asks, once ever.** The contributing link rides the same one-time row as the star ask rather than adding a second dismissible prompt: the moment someone is already looking at our GitHub link is the moment the contributing link is worth showing.
+>
+> **Gates:** `check_ltx_pin` PASS · `check_pinokio_scripts` PASS (worst 377/500) · `check_output_codec` PASS · all 12 panel suites green · verified in-browser with `LTX_ENGINE_PREVIEW=1` so all three engines render: menu portaled to body, LTX ticked as active, H3 offering its 75 GB install, Flux inert as "soon".
+
> **⭐ 2026-08-15 — v4.2.0: updates announce themselves, and the star ask is a local flag rather than a tracking problem.** Finding out you were behind required clicking the header pill, which is a check nobody performs.
>
> - **A banner, deliberately not a modal.** An update is not an emergency, and a dialog that blocks a running render is worse than being out of date. It states the available version and the one you are on, offers Update now (reusing the pill's existing pull path — one implementation, not two) and Later. `update_banner_dismissed` stores a **VERSION string, not a boolean**, so dismissing 4.1.1 cannot silence 4.2.0.
@@ -43,7 +54,7 @@
> **🔧 2026-08-14 night — v4.0.5 ASSEMBLED on dev/beta (`65880b3` + version `66f0dbd`), HELD for the owner's word.** The two recovered audits' punch-list, closed in one campaign. (1) **H3 Turbo install is LIVE again**: the v1.0 runner-layout repack is a published release asset on `weights-ltx25-v1` (sha256 `d51d626f…`, verified byte-identical against the local repack the selection was graded on); `/h3/turbo/install` streams it partial→verify→atomic-rename, `install_h3.js` fetches the same asset best-effort via `scripts/fetch_h3_turbo.py` (resumable, digest-checked, short Pinokio-safe lines), and the retired **ckpt500-EMA is accepted again as the LAST fallback** — dropping it in 4.0.4 un-Turboed installs that rendered fine on it. Raw v0.1 stays refused by name. Turbo gate 5→11 tests incl. script↔panel pin parity. (2) **The dead HQ Speed control is gone** (skip-step fields were dropped at the engine boundary; both pills ran identical settings under a "~12% faster" claim), and the collapsed summary stops printing "exact speed" from the retired accel input. (3) **The real speed control**: the engine's 2.5-only `fast` schedule preset (F6S2, 5+2 forwards, owner-graded, **a different take**) wired end to end — Speed pills → `schedule_preset` → make_job (lane-gated: dropped with a sentence on 2.3/HQ/H3) → helper → `generate_two_stage`; tier cells carry `fast_eta` (cost-model 5+2/8+2 ratio, so fixed costs aren't discounted), chips re-price while Fast is armed, and Load Params round-trips it from day one (`test_schedule_preset.py`, 8). (4) **Geometry truth**: make_job floors LTX canvases to the two-stage engine's /64 grid and frames to 8k+1 (floored, never raised) and pushes a sentence when it does; dims inputs step by 64; warnings state what WILL render; H3 tier-cell geometry untouched (`test_geometry_grid.py`, 6). (5) **Load Params restores the cast** (owner-reported): the fire-and-forget IIFE is replaced by an awaited restore through `applyCharacterSelection()` — the new non-toggling hydrator — with visible failure when the character left the library; quality chip by the sidecar's own token, explicit `no_voice` with touched provenance, Extend's four fields, STG (absence = Off), and the Length chip repaints after programmatic frame assignment. A hidden checked No-voice can no longer rewrite a plain render (submit gated on a cast; every hide path clears the box). (6) **One health cluster**: the six machine-state pills live in a single bordered container that is the header's only shrinkable region — narrow windows degrade it to colored state dots, then collapse it; the creator avatar is never clipped again. (7) **Stale-process pill**: `/version` compares HEAD-on-disk to HEAD-at-boot each poll; a promote landing under a running panel renders "Restart to finish update" — **validated live**: the dev panel booted at `90b8a6e` reported `stale_process: true` the moment `65880b3` landed. (8) Keyframe sidecars stamp the resolved q8 pack, not the 2.3-defaulting `MODEL_ID_HQ`. **Gates all green at the tree** (pinokio scripts 377/500 worst · ltx pin unmoved at `v0.14.19+ltx25.4` · post_update · registry 169 · schedules 45 · character round-trip 35 · lora_compat · stage_live_preview · spicy · turbo 11 · schedule_preset 8 · geometry 6 · storyboard suites · py_compile · page parse). **Known-remaining / descoped**: the owner's "stray −1 bar" did not reproduce in either live panel's idle state (needs a screenshot the moment it appears); HDR Load-Params restore is moot while the HDR pill ships commented out (roadmap-parked); render validation of the fast preset + Turbo v1.0 timing run deferred until the GPU frees (the eltrumpo retrain holds both locks overnight). **Audit sources**: `~/AI/projects/phosphene/notes/customize_audit_2026-08-14.md` + `journey_audit_2026-08-14.md` (recovered from the sandboxed sessions' stdout; the FIELD REGISTRY campaign spec in the journey audit is the post-4.0.5 systemic fix).
-**Public release: `v4.2.0`** (2026-08-14 — the live preview leaves the postage stamp and plays full-size on the main stage; the Spicy option follows the Settings switch on both engines; H3's Turbo adapter selection moves to LightX2V v1.0 768p and its automatic install is paused until the repack is published. Carries v4.0.3's picker-LoRA crash fix and the v4.0.2 content: the 720p High tier, i2v that animates the image you gave it, characters on the engine's native runtime-LoRA route, and the vendored pin at `v0.14.19+ltx25.4`; see the entries below. The narrative in this paragraph stops at v3.1.1 and is kept as history). **The 2.3/2.5 divergence that ran through the v3.8.x line was closed by v4.0.0** — LTX-2.5 is the registered default and the vendored port is pinned at the tag `v0.14.19+ltx25.4`. v3.8.x registered 2.3 only and pinned `871694d`, because the 2.5 packs were not publicly downloadable at cut time; they are now. See `CLAUDE.md`'s pin table. The entire v3.0 line shipped — v3.0.0 (Characters / Voice / Image Studio / A2V, May 23) → v3.0.1 (FFLF crash fix) → v3.0.2 (Boost/Turbo accel restored after a 2-month silent regression) → v3.0.3 (HiDream hidden, #15) → v3.0.4 (CivitAI SSL) → v3.0.5 (A2V kwarg signature shim, #5) → v3.0.6 (deep-review hardening) → v3.0.7 (GPU-race fix + /status version surfacing) → **v3.0.8 (ltx-2-mlx v0.14.8 catch-up — codec-only patches, I2V "mosaic"/Metal-watchdog fix #17, ASCII version-skew handshake fix)** → **v3.0.9 (custom I2V Width×height inputs restored for power users; Train-tab dev-transformer Download "unknown install key" fix — form-encoding, reported by @cocktailpeanut)** → **v3.0.10 (model-integrity self-heal — boot scan + `/status.model_integrity` + a one-click Repair banner for corrupt/partial weights, the leading *non-Metal* "mosaic" garbage-decode cause; safetensors header+size check)** → **v3.0.11 (latent helper-handshake hang fixed: `_read_until` mixed `select()` on the raw fd with a buffered `readline()`, so any event the helper emitted *right before* `ready` — a version-skew line, the new runtime fingerprint — got stranded in the TextIOWrapper buffer and the panel hung 120 s → "helper failed to start: None". This is the true root cause behind the mislabeled "⚠️-emoji" handshake break. Now reads the raw fd via `os.read()` into a carry buffer and drains every complete line before re-`select()`-ing. PLUS: every render log self-documents its runtime — mlx/mlx-metal version + Apple chip + macOS — surfaced in `/status`, the `helper ready ·` line, and a standalone `runtime |` line, the exact data needed to triangulate the remaining MLX-numerical "mosaic")** → **v3.0.12 (the REAL mosaic fix + 3 more. The mosaic is NOT a code bug or the missing-upscaler theory (both disproved by local repro — the bare 6-file Q4 set renders byte-identical-clean on M4 Max); it's stale/corrupt weight *content* — right size, wrong bytes — that v3.0.10's header+size check can't see (confirmed: ronyeoh/#18 + claude3d/#5 fixed it only by a fresh full re-download). Added **deep checksum verify vs upstream**: Settings → Model files → "Verify model files (checksum)" / `/models/verify-deep` hashes every weight + compares to HuggingFace's published SHA-256 (proven to match local), mismatches feed the existing one-click Repair re-download. Validated: flipped 16 bytes mid-file → header+size passed, deep-verify caught it. ALSO in v3.0.12: character-LoRA-shows-as-"style-only" fix (#5 — `list_user_loras` recovers trigger+kind from the `_v2` filename when the sidecar is missing); `cgi`→`email` multipart migration (Python-3.13-ready, removes the boot DeprecationWarning, adopted from @ssfeather's PR #22); dynamic 3–8 multi-keyframe UI (adopted from @youngbee12's PR #20, ported clean with the integrity feature preserved + a JS ReferenceError fixed). Folds in v3.0.11's handshake fix + runtime fingerprint.)** → **v3.0.13 (character LoRA fixes, #5 @claude3d: a multi-word/spaced character filename no longer mislabels as style-only — the id regex gated out spaces before the sidecar was read; and the Character tab no longer silently falls back to plain T2V — a UI desync left the avatar's selection ring lit after `character_id` was cleared. Plus an `enhancePrompt` element-id fix. Cherry-picked to prod `ce03139`, release `814dc2d`.)** → **v3.1.0 (Ideogram 4 — open-weight 9.3B text-rendering image model + a visual text-placement canvas that places exact text via normalized-bbox captions. mflux 0.18 `mflux-generate-ideogram4`; gated `ideogram-ai/ideogram-4-fp8` ~26 GB, needs a HF Read token + license. Fixed the gated-download 401 that would have hit EVERY user — the panel now exports its configured token to subprocess env via `_sync_hf_token_to_env` so a stale `hf auth login` cache can't shadow it; proven clean-room. Validated end-to-end: 8-text-element field-guide poster rendered clean, every label placed per its bbox.)** → **v3.1.1 (Ideogram output-card buttons hotfix, reported by Mr Bizarro: an Ideogram image's prompt is a caption JSON, which broke every output surface that fed it into a plain box / inline onclick — the Recent-list Animate button was worked-but-dead because apostrophes/&/< in the caption terminated the single-quoted onclick. Display-layer fix: `_displayPromptFor` derives `high_level_description`, `escapeHtml` the onclick args, friendly `_imgEngineLabel`, and `loadParams` restores an Ideogram image into the visual canvas instead of dumping JSON. `params.prompt` stays the caption JSON; renders unaffected. Validated live.)** All validated end-to-end on the dev panel (deep-verify corrupt-detect + repair, /loras, byte-identical upload, multi-keyframe render, FFLF regression). See §4 for the full version history. The May-17 Codex C+ UI restructure (capability tiers, Q4 surface, Character as 5th mode pill, accel kill, HQ-speed move) and the Train-tab / LoRA-chrome work that followed are all baseline now, folded into v3.0.x. There is no `v2.0.6` tag.
+**Public release: `v4.3.0`** (2026-08-14 — the live preview leaves the postage stamp and plays full-size on the main stage; the Spicy option follows the Settings switch on both engines; H3's Turbo adapter selection moves to LightX2V v1.0 768p and its automatic install is paused until the repack is published. Carries v4.0.3's picker-LoRA crash fix and the v4.0.2 content: the 720p High tier, i2v that animates the image you gave it, characters on the engine's native runtime-LoRA route, and the vendored pin at `v0.14.19+ltx25.4`; see the entries below. The narrative in this paragraph stops at v3.1.1 and is kept as history). **The 2.3/2.5 divergence that ran through the v3.8.x line was closed by v4.0.0** — LTX-2.5 is the registered default and the vendored port is pinned at the tag `v0.14.19+ltx25.4`. v3.8.x registered 2.3 only and pinned `871694d`, because the 2.5 packs were not publicly downloadable at cut time; they are now. See `CLAUDE.md`'s pin table. The entire v3.0 line shipped — v3.0.0 (Characters / Voice / Image Studio / A2V, May 23) → v3.0.1 (FFLF crash fix) → v3.0.2 (Boost/Turbo accel restored after a 2-month silent regression) → v3.0.3 (HiDream hidden, #15) → v3.0.4 (CivitAI SSL) → v3.0.5 (A2V kwarg signature shim, #5) → v3.0.6 (deep-review hardening) → v3.0.7 (GPU-race fix + /status version surfacing) → **v3.0.8 (ltx-2-mlx v0.14.8 catch-up — codec-only patches, I2V "mosaic"/Metal-watchdog fix #17, ASCII version-skew handshake fix)** → **v3.0.9 (custom I2V Width×height inputs restored for power users; Train-tab dev-transformer Download "unknown install key" fix — form-encoding, reported by @cocktailpeanut)** → **v3.0.10 (model-integrity self-heal — boot scan + `/status.model_integrity` + a one-click Repair banner for corrupt/partial weights, the leading *non-Metal* "mosaic" garbage-decode cause; safetensors header+size check)** → **v3.0.11 (latent helper-handshake hang fixed: `_read_until` mixed `select()` on the raw fd with a buffered `readline()`, so any event the helper emitted *right before* `ready` — a version-skew line, the new runtime fingerprint — got stranded in the TextIOWrapper buffer and the panel hung 120 s → "helper failed to start: None". This is the true root cause behind the mislabeled "⚠️-emoji" handshake break. Now reads the raw fd via `os.read()` into a carry buffer and drains every complete line before re-`select()`-ing. PLUS: every render log self-documents its runtime — mlx/mlx-metal version + Apple chip + macOS — surfaced in `/status`, the `helper ready ·` line, and a standalone `runtime |` line, the exact data needed to triangulate the remaining MLX-numerical "mosaic")** → **v3.0.12 (the REAL mosaic fix + 3 more. The mosaic is NOT a code bug or the missing-upscaler theory (both disproved by local repro — the bare 6-file Q4 set renders byte-identical-clean on M4 Max); it's stale/corrupt weight *content* — right size, wrong bytes — that v3.0.10's header+size check can't see (confirmed: ronyeoh/#18 + claude3d/#5 fixed it only by a fresh full re-download). Added **deep checksum verify vs upstream**: Settings → Model files → "Verify model files (checksum)" / `/models/verify-deep` hashes every weight + compares to HuggingFace's published SHA-256 (proven to match local), mismatches feed the existing one-click Repair re-download. Validated: flipped 16 bytes mid-file → header+size passed, deep-verify caught it. ALSO in v3.0.12: character-LoRA-shows-as-"style-only" fix (#5 — `list_user_loras` recovers trigger+kind from the `_v2` filename when the sidecar is missing); `cgi`→`email` multipart migration (Python-3.13-ready, removes the boot DeprecationWarning, adopted from @ssfeather's PR #22); dynamic 3–8 multi-keyframe UI (adopted from @youngbee12's PR #20, ported clean with the integrity feature preserved + a JS ReferenceError fixed). Folds in v3.0.11's handshake fix + runtime fingerprint.)** → **v3.0.13 (character LoRA fixes, #5 @claude3d: a multi-word/spaced character filename no longer mislabels as style-only — the id regex gated out spaces before the sidecar was read; and the Character tab no longer silently falls back to plain T2V — a UI desync left the avatar's selection ring lit after `character_id` was cleared. Plus an `enhancePrompt` element-id fix. Cherry-picked to prod `ce03139`, release `814dc2d`.)** → **v3.1.0 (Ideogram 4 — open-weight 9.3B text-rendering image model + a visual text-placement canvas that places exact text via normalized-bbox captions. mflux 0.18 `mflux-generate-ideogram4`; gated `ideogram-ai/ideogram-4-fp8` ~26 GB, needs a HF Read token + license. Fixed the gated-download 401 that would have hit EVERY user — the panel now exports its configured token to subprocess env via `_sync_hf_token_to_env` so a stale `hf auth login` cache can't shadow it; proven clean-room. Validated end-to-end: 8-text-element field-guide poster rendered clean, every label placed per its bbox.)** → **v3.1.1 (Ideogram output-card buttons hotfix, reported by Mr Bizarro: an Ideogram image's prompt is a caption JSON, which broke every output surface that fed it into a plain box / inline onclick — the Recent-list Animate button was worked-but-dead because apostrophes/&/< in the caption terminated the single-quoted onclick. Display-layer fix: `_displayPromptFor` derives `high_level_description`, `escapeHtml` the onclick args, friendly `_imgEngineLabel`, and `loadParams` restores an Ideogram image into the visual canvas instead of dumping JSON. `params.prompt` stays the caption JSON; renders unaffected. Validated live.)** All validated end-to-end on the dev panel (deep-verify corrupt-detect + repair, /loras, byte-identical upload, multi-keyframe render, FFLF regression). See §4 for the full version history. The May-17 Codex C+ UI restructure (capability tiers, Q4 surface, Character as 5th mode pill, accel kill, HQ-speed move) and the Train-tab / LoRA-chrome work that followed are all baseline now, folded into v3.0.x. There is no `v2.0.6` tag.
> **🎬 2026-08-14 — v4.0.4: the forming take plays on the MAIN STAGE.** The live preview existed since v3.7 and lived in a postage stamp next to the queue, which is not where anyone looks while they wait. It now takes the big player.
>
diff --git a/mlx_ltx_panel.py b/mlx_ltx_panel.py
index 14b2d41..30c1cb3 100644
--- a/mlx_ltx_panel.py
+++ b/mlx_ltx_panel.py
@@ -25492,6 +25492,7 @@ HTML = r"""<!doctype html>
}
.ub-star[hidden] { display: none; }
.ub-star a { color: #f0b940; font-weight: 600; }
+ .ub-sep { opacity: .4; }
.pill-update {
color: var(--warning, #f0b940);
border-color: rgba(240,185,64,0.55);
@@ -32078,6 +32079,46 @@ HTML = r"""<!doctype html>
body > header #bugBtn,
body > header #settingsBtn,
body > header .creator-link,
+ /* ---- Engine picker: trigger + portaled menu ------------------------ */
+ .eng-trigger {
+ display: inline-flex; align-items: center; gap: 7px;
+ width: auto; padding: 5px 9px; cursor: pointer;
+ background: var(--eng-dim, rgba(255,255,255,.06));
+ border: 1px solid var(--eng-soft, var(--line, #262a33));
+ border-radius: 9px; color: var(--ink, #e8eaf0);
+ font-size: 12.5px; font-weight: 600; white-space: nowrap;
+ }
+ .eng-trigger:hover { filter: brightness(1.12); }
+ .eng-trigger .eng-mark { color: var(--eng-accent, currentColor); display: inline-flex; }
+ .eng-trigger .eng-mark svg { width: 15px; height: 15px; }
+ .eng-caret { width: 11px; height: 11px; opacity: .65; margin-left: 1px; }
+ /* Portaled to <body>: header is overflow:hidden and would slice this. */
+ #engineMenu {
+ position: fixed; z-index: 9000;
+ background: var(--panel, #14161c);
+ border: 1px solid var(--line, #262a33);
+ border-radius: 12px; padding: 5px;
+ box-shadow: 0 18px 44px rgba(0,0,0,.55);
+ max-height: 70vh; overflow-y: auto;
+ }
+ #engineMenu[hidden] { display: none; }
+ .eng-opt {
+ display: flex; align-items: flex-start; gap: 9px; width: 100%;
+ text-align: left; padding: 8px 10px; border: 0; border-radius: 9px;
+ background: transparent; color: var(--ink, #e8eaf0); cursor: pointer;
+ }
+ .eng-opt:hover { background: rgba(255,255,255,.05); }
+ .eng-opt.active { background: var(--eng-dim, rgba(255,255,255,.07)); }
+ .eng-opt .eng-mark { color: var(--eng-accent, currentColor); display: inline-flex; padding-top: 1px; }
+ .eng-opt .eng-mark svg { width: 16px; height: 16px; }
+ .eng-opt-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
+ .eng-opt-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
+ .eng-opt-sub { font-size: 11.5px; color: var(--ink-500, #98a0b3); line-height: 1.35; }
+ .eng-tick { width: 13px; height: 13px; color: var(--eng-accent, currentColor); flex: 0 0 auto; margin-top: 3px; }
+ /* Inert = real but unreachable right now; still listed, visibly muted. */
+ .eng-opt.inert { opacity: .58; }
+ .eng-opt.needs-install .eng-badge.offer { color: var(--eng-accent, currentColor); }
+
body > header .engine-switch {
flex-shrink: 0;
}
@@ -33073,15 +33114,26 @@ HTML = r"""<!doctype html>
<button type="button" class="ub-go" id="ubUpdate">Update now</button>
<button type="button" class="ub-dismiss" id="ubLater" title="Hide until the next version">Later</button>
</div>
+ <!-- ONE row, both asks, once ever. A second dismissible prompt for
+ "contribute" would double the nagging to say a smaller thing, and the
+ moment someone is already looking at our GitHub link is exactly the
+ moment the contributing link is worth showing. -->
<div class="ub-star" id="ubStar" hidden>
- Updating takes a minute — <a href="https://github.com/mrbizarro/phosphene" id="ubStarLink" target="_blank" rel="noopener">a star on GitHub</a> while you wait means the world.
+ <span>Updating takes a minute — <a href="https://github.com/mrbizarro/phosphene" id="ubStarLink" target="_blank" rel="noopener">a star on GitHub</a> while you wait means the world.</span>
+ <span class="ub-sep">·</span>
+ <span>Fixed something, or want to add an engine? <a href="https://github.com/mrbizarro/phosphene/blob/main/CONTRIBUTING.md" id="ubContribLink" target="_blank" rel="noopener">PRs are welcome and get credited</a>.</span>
<button type="button" class="ub-already" id="ubStarDone">Already did</button>
</div>
</div>
<header>
<a href="/" class="brand"><img src="/assets/phosphene_cycle_word_transparent.png" alt="Phosphene"></a>
- <span class="version-badge" title="Phosphene __PANEL_VERSION__">__PANEL_VERSION__</span>
+ <!-- The standalone version badge is gone: #versionPill already carries the
+ version in EVERY state it can be in — "Up to date · 4.2.0",
+ "Update to 4.3.0", "Checking · 4.2.0", "4.2.0 · dev · <sha>",
+ "4.2.0 · offline". Printing it twice cost a header slot that the
+ health cluster needed, on the machines where the cluster was
+ already truncating. -->
__PROFILE_BADGE__
<span class="spacer"></span>
<!-- ============== ENGINE SWITCHER ==============
@@ -42634,6 +42686,64 @@ function syncModeStripToEngine() {
// function has no idea which engines exist. Re-run on: boot, every setEngine,
// a workflow-tab change, and any /status tick that moves an install.
+// The picker is a DROPDOWN, not a segmented row. Two reasons, and the second
+// is the one that forced it:
+// 1. Header room. Two full segments plus the health cluster already
+// overflowed a 14" window; a third engine (Flux Video) could not fit at
+// any width. A trigger showing only the ACTIVE engine costs one slot no
+// matter how many engines exist.
+// 2. "Which one is selected" has to survive being glanced at. In a segmented
+// row that is carried entirely by a highlight; a dropdown states it.
+//
+// The MENU IS PORTALED TO <body> and positioned fixed, because <header> is
+// overflow:hidden — the same clipping that produced the "avatar cut off"
+// report. A menu rendered inside the header would be sliced at its edge.
+window._engineMenuOpen = false;
+
+function _engineMenuEl() {
+ let m = document.getElementById('engineMenu');
+ if (!m) {
+ m = document.createElement('div');
+ m.id = 'engineMenu';
+ m.setAttribute('role', 'listbox');
+ m.hidden = true;
+ document.body.appendChild(m); // portal: escape header overflow:hidden
+ }
+ return m;
+}
+
+function closeEngineMenu() {
+ window._engineMenuOpen = false;
+ const m = document.getElementById('engineMenu');
+ if (m) m.hidden = true;
+ const t = document.querySelector('#engineSwitch .eng-trigger');
+ if (t) t.setAttribute('aria-expanded', 'false');
+}
+
+function toggleEngineMenu() {
+ const m = _engineMenuEl();
+ if (window._engineMenuOpen) { closeEngineMenu(); return; }
+ const trig = document.querySelector('#engineSwitch .eng-trigger');
+ if (!trig) return;
+ const r = trig.getBoundingClientRect();
+ m.style.top = (r.bottom + 6) + 'px';
+ m.style.left = r.left + 'px';
+ m.style.minWidth = Math.max(r.width, 240) + 'px';
+ m.hidden = false;
+ window._engineMenuOpen = true;
+ trig.setAttribute('aria-expanded', 'true');
+}
+
+document.addEventListener('click', (ev) => {
+ if (!window._engineMenuOpen) return;
+ if (ev.target.closest('#engineMenu') || ev.target.closest('#engineSwitch')) return;
+ closeEngineMenu();
+}, true);
+document.addEventListener('keydown', (ev) => {
+ if (ev.key === 'Escape' && window._engineMenuOpen) closeEngineMenu();
+});
+window.addEventListener('resize', closeEngineMenu);
+
function renderEngineSwitch() {
const box = document.getElementById('engineSwitch');
const div = document.getElementById('engineSwitchDivider');
@@ -42641,11 +42751,30 @@ function renderEngineSwitch() {
const show = _engineRowVisible();
box.hidden = !show;
if (div) div.hidden = !show;
- if (!show) { box.innerHTML = ''; return; }
+ if (!show) { box.innerHTML = ''; closeEngineMenu(); return; }
const active = currentEngine();
const list = ENGINES.filter(engineRenderable);
- box.innerHTML = list.map(e => {
+
+ // ---- The trigger: the active engine, and nothing else ----
+ const act = list.find(e => e.id === active) || list[0];
+ if (act) {
+ box.innerHTML = `<button type="button" class="eng-trigger" aria-haspopup="listbox"
+ aria-expanded="false"
+ style="--eng-accent:${escapeHtml(act.accent)};--eng-dim:${escapeHtml(act.accent_dim)};--eng-soft:${escapeHtml(act.accent_soft)}"
+ title="${escapeHtml(_engineTooltip(act, engineStatus(act), engineServesMode(act, currentMode)))}">
+ <span class="eng-mark"><svg class="ph" aria-hidden="true"><use href="#${escapeHtml(act.mark)}"/></svg></span>
+ <span class="eng-seg-name">${escapeHtml(act.label)}</span>${
+ act.generation ? `<span class="eng-seg-gen">${escapeHtml(act.generation)}</span>` : ''}
+ <svg class="ph eng-caret" aria-hidden="true"><use href="#ph-caret-down-bold"/></svg>
+ </button>`;
+ const t = box.querySelector('.eng-trigger');
+ if (t) t.onclick = (ev) => { ev.stopPropagation(); toggleEngineMenu(); };
+ }
+
+ // ---- The menu: every engine, each stating its own state ----
+ const menu = _engineMenuEl();
+ menu.innerHTML = list.map(e => {
const st = engineStatus(e);
const offer = !e.builtin && !st.announced && st.capable && !st.available;
const modeOk = engineServesMode(e, currentMode);
@@ -42660,22 +42789,35 @@ function renderEngineSwitch() {
// Inert = real but unreachable RIGHT NOW. Distinct from needs-install,
// which IS reachable — that click is the install.
const inert = st.announced || (st.available && !modeOk);
- const cls = 'eng-seg'
+ const cls = 'eng-opt'
+ (e.id === active ? ' active' : '')
+ (offer ? ' needs-install' : '')
+ (inert ? ' inert' : '');
+ // The tagline earns its place here in a way it never could in a segment:
+ // the menu is where someone decides BETWEEN engines, so each row says what
+ // it is for rather than only what it is called.
return `<button type="button" class="${cls}" data-engine="${escapeHtml(e.id)}"
+ role="option" aria-selected="${e.id === active ? 'true' : 'false'}"
style="--eng-accent:${escapeHtml(e.accent)};--eng-dim:${escapeHtml(e.accent_dim)};--eng-soft:${escapeHtml(e.accent_soft)}"
title="${escapeHtml(_engineTooltip(e, st, modeOk))}">
<span class="eng-mark"><svg class="ph" aria-hidden="true"><use href="#${escapeHtml(e.mark)}"/></svg></span>
- <span class="eng-seg-name">${escapeHtml(e.label)}</span>${
- e.generation ? `<span class="eng-seg-gen">${escapeHtml(e.generation)}</span>` : ''}${
- badge ? `<span class="eng-badge${badgeClass}">${escapeHtml(badge)}</span>` : ''}
+ <span class="eng-opt-body">
+ <span class="eng-opt-top">
+ <span class="eng-seg-name">${escapeHtml(e.label)}</span>${
+ e.generation ? `<span class="eng-seg-gen">${escapeHtml(e.generation)}</span>` : ''}${
+ badge ? `<span class="eng-badge${badgeClass}">${escapeHtml(badge)}</span>` : ''}
+ </span>
+ <span class="eng-opt-sub">${escapeHtml(e.tagline || e.sublabel || '')}</span>
+ </span>${
+ e.id === active ? '<svg class="ph eng-tick" aria-hidden="true"><use href="#ph-check-bold"/></svg>' : ''}
</button>`;
}).join('');
- box.querySelectorAll('.eng-seg').forEach(b => {
- b.onclick = () => engineSegClick(b.dataset.engine);
+ menu.querySelectorAll('.eng-opt').forEach(b => {
+ b.onclick = () => {
+ closeEngineMenu();
+ engineSegClick(b.dataset.engine);
+ };
});
}
@@ -44622,8 +44764,20 @@ function ingredientPickerWire() {
// surfaces in the Memory Pressure indicator. The swap value is still
// included in /status payloads for any external tooling that wants it.
function fmtMem(m) {
- const p = (m.pressure_pct != null) ? `${m.pressure_pct}% pressure` : `swap ${(m.swap_gb || 0).toFixed(1)}`;
- return `${m.used_gb.toFixed(1)} / ${m.total_gb.toFixed(0)} GB · ${p}`;
+ // Compact on purpose. "21.0 / 64 GB · 33% pressure" is five pieces of
+ // information for a glance that only ever asks one question — am I near the
+ // ceiling. The decimal on used never changed a decision, and the word
+ // "pressure" is carried by the tooltip and the pill's own colour. The full
+ // sentence still lives in the title attribute for anyone who wants it.
+ const p = (m.pressure_pct != null) ? `${m.pressure_pct}%` : `swap ${(m.swap_gb || 0).toFixed(1)}`;
+ return `${Math.round(m.used_gb)}/${m.total_gb.toFixed(0)} GB · ${p}`;
+}
+function fmtMemTitle(m) {
+ const used = (m.used_gb != null) ? m.used_gb.toFixed(1) : '?';
+ const tot = (m.total_gb != null) ? m.total_gb.toFixed(0) : '?';
+ const pr = (m.pressure_pct != null) ? `${m.pressure_pct}% memory pressure` : null;
+ const sw = (m.swap_gb != null) ? `swap ${m.swap_gb.toFixed(1)} GB` : null;
+ return [`${used} of ${tot} GB in use`, pr, sw].filter(Boolean).join(' · ');
}
function fmtMin(s) { if (!s || s < 0) return '—'; const m = Math.floor(s/60); const sec = Math.round(s%60); return m > 0 ? `${m}m ${sec}s` : `${sec}s`; }
function snippet(s, n = 70) { if (!s) return ''; s = s.replace(/\s+/g,' ').trim(); return s.length > n ? s.slice(0, n-1)+'…' : s; }
@@ -44980,6 +45134,7 @@ async function poll() {
const m = s.memory;
const memPill = document.getElementById('memPill');
memPill.innerHTML = `<span class="dot"></span>${fmtMem(m)}`;
+ memPill.title = fmtMemTitle(m);
// 2026-05-20: color the badge by real pressure, not by sticky swap.
// Same reason fmtMem dropped swap from the visible label — swap is
// a high-water mark that only decreases on reboot, so keying the