luxe 0.1.4: remembered models, wheel-driven lists, and a steadier phone app

- luxe starts on the model you last chose in this project, then the last one anywhere. Signing in
  opens the model picker instead of choosing for you.
- Every list in a modal takes the mouse wheel and a draggable scrollbar.
- The phone app shows reasoning in full, stays put while you read back through a long session, and
  shows a question's answer on its card.
- On Windows, luxe update replaces the running luxe, and a signed-in install no longer sees setup
  again.
- The file tree no longer shows "engine busy" in a large project, loop output is easier to follow,
  and the name is written lowercase.

The CHANGELOG has the full list.
This commit is contained in:
Evan Whittaker
2026-10-20 13:51:34 -05:00
parent 6184aa21fb
commit a0666d6c81
591 changed files with 4926 additions and 2942 deletions

View File

@@ -0,0 +1,54 @@
// @ts-check
// A question card's answers, read back out of the call's result the way the TUI's card reads them
// (`luxe_core::question::QuestionOutcome`). The prompt above the composer is gone once answered, so
// without these rows the card is the question alone and the decision leaves no trace.
import { html } from "./html.js";
// The four endings as the host writes them, copied from `QuestionOutcome::result_text`
const ANSWERED = "The user answered:";
const EMPTY = "The user submitted the question with no selection.";
const DISMISSED = "The user dismissed the question without answering.";
const UNATTENDED = "[Auto-answered, no interactive session]";
/**
* @typedef {{ answers: string[], note: string }} Outcome
*/
/**
* What a question's result says was decided, or null when the text isn't one of the host's: a card
* that shows its raw output beats one inventing an answer nobody gave.
* @param {string} result @returns {Outcome | null}
*/
export function questionOutcome(result) {
const [first = "", ...rest] = result.split("\n");
const head = first.trimEnd();
if (head.startsWith(ANSWERED)) return answered(head.slice(ANSWERED.length).trim(), rest);
if (head.startsWith(UNATTENDED)) return unattended(rest);
if (head === EMPTY) return { answers: [], note: "submitted with no answer" };
if (head === DISMISSED) return { answers: [], note: "dismissed without answering" };
return null;
}
/** @param {string} inline @param {string[]} lines @returns {Outcome} */
function answered(inline, lines) {
if (inline) return { answers: [inline], note: "" };
const listed = lines.map((line) => line.trim()).filter((line) => line.startsWith("- ")).map((line) => line.slice(2));
const answers = listed.filter(Boolean);
return { answers, note: answers.length ? "" : "submitted with no answer" };
}
/** Nobody was there to ask, so the card mustn't credit the reader. @param {string[]} lines */
function unattended(lines) {
const answer = lines.map((line) => line.trim()).find((line) => line.startsWith("Answer:"));
if (answer === undefined) return null;
return { answers: [answer.slice("Answer:".length).trim()], note: "nobody to ask · answered from the default" };
}
/** The decision under its question, labeled so it doesn't read as the options offered. @param {{ outcome: Outcome }} props */
export function Answers({ outcome }) {
return html`<div class="answers">
${outcome.note ? html`<p class="answer-note">${outcome.note}</p>` : null}
${outcome.answers.map((answer) => html`<p class="answer"><span class="answer-label">answer</span>${answer}</p>`)}
</div>`;
}

View File

@@ -66,7 +66,7 @@ function ModelPicker({ listing, current, pick }) {
/** What the model list is waiting on, when it's not just a list. @param {{ state: string, empty: boolean }} props */
function ListingNote({ state, empty }) {
if (state === "unsupported") return html`<p class="dim">Update Luxe on your computer to switch models from here.</p>`;
if (state === "unsupported") return html`<p class="dim">Update luxe on your computer to switch models from here.</p>`;
if (state === "lost") return html`<p class="dim">Not connected.</p>`;
if (state === "asking" && empty) return html`<p class="dim">Loading models…</p>`;
if (state === "listed" && empty) return html`<p class="dim">No other models configured.</p>`;

View File

@@ -58,7 +58,7 @@
width: calc(24rem + env(safe-area-inset-left));
box-sizing: border-box;
overflow-y: auto;
padding: env(safe-area-inset-top) 1.5ch calc(env(safe-area-inset-bottom) + 1lh)
padding: var(--top-inset) 1.5ch calc(env(safe-area-inset-bottom) + 1lh)
calc(1.5ch + env(safe-area-inset-left));
border-right: 1px solid var(--luxe-border-muted, #2e2b27);
}

View File

@@ -16,7 +16,7 @@ subset keeps come from Material Design Icons (Apache-2.0), Font Awesome (OFL-1.1
Extra (MIT) and [Codicons](https://github.com/microsoft/vscode-codicons) (© Microsoft Corporation,
CC BY 4.0).
Subset to Latin, Greek, Cyrillic, punctuation, arrows, maths and box drawing, plus every glyph Luxe
Subset to Latin, Greek, Cyrillic, punctuation, arrows, maths and box drawing, plus every glyph luxe
draws. Regular (400), Bold (700) and Italic.
## Adwaita Mono Nerd Font Mono
@@ -26,4 +26,4 @@ Invis) · Copyright (c) 2025, Jamie Gravendeel · Copyright (c) 2025, Florian M
<https://gitlab.gnome.org/GNOME/adwaita-fonts> · SIL Open Font License 1.1 · full text in
`OFL-AdwaitaMono.txt`. Patched with Nerd Fonts, as above.
Subset to only the marks Luxe draws that JetBrains Mono lacks, on the same 0.6em cell.
Subset to only the marks luxe draws that JetBrains Mono lacks, on the same 0.6em cell.

View File

@@ -1,5 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 440 154" width="440" height="154" data-cell="10 22" data-drift-depth="0.55" role="img" aria-label="Luxe">
<title>Luxe</title>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 440 154" width="440" height="154" data-cell="10 22" data-drift-depth="0.55" role="img" aria-label="luxe">
<title>luxe</title>
<path fill="var(--luxe-wordmark-1, currentColor)" d="M10 11h10v11h-10z M20 11h10v11h-10z M30 11h10v11h-10z M40 11h10v11h-10z M10 22h10v11h-10z M20 22h10v11h-10z M30 22h20v22h-20z M30 44h20v22h-20z M30 66h20v22h-20z M30 88h20v22h-20z M30 110h20v22h-20z M50 121h10v11h-10z M60 121h10v11h-10z M70 121h10v11h-10z M40 132h10v11h-10z M50 132h10v11h-10z M60 132h10v11h-10z M70 132h10v11h-10z"/>
<path fill="var(--luxe-wordmark-2, currentColor)" d="M110 44h20v22h-20z M170 44h20v22h-20z M110 66h20v22h-20z M170 66h20v22h-20z M110 88h20v22h-20z M170 88h20v22h-20z M110 110h20v22h-20z M130 121h10v11h-10z M140 121h10v11h-10z M150 121h10v11h-10z M160 110h30v22h-30z M120 132h10v11h-10z M130 132h10v11h-10z M140 132h10v11h-10z M150 132h10v11h-10z M170 132h10v11h-10z M180 132h10v11h-10z"/>
<path fill="var(--luxe-wordmark-3, currentColor)" d="M210 44h10v11h-10z M220 44h20v22h-20z M260 44h20v22h-20z M280 44h10v11h-10z M230 66h40v22h-40z M230 99h10v11h-10z M240 88h20v22h-20z M260 99h10v11h-10z M220 121h10v11h-10z M230 110h10v22h-10z M240 110h10v11h-10z M250 110h10v11h-10z M260 110h10v22h-10z M270 121h10v11h-10z M210 132h10v11h-10z M220 132h10v11h-10z M230 132h10v11h-10z M260 132h10v11h-10z M270 132h10v11h-10z M280 132h10v11h-10z"/>

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -3,10 +3,10 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<title>Luxe</title>
<title>luxe</title>
<link rel="manifest" href="/manifest.webmanifest">
<link rel="apple-touch-icon" href="/icons/180.png">
<meta name="apple-mobile-web-app-title" content="Luxe">
<meta name="apple-mobile-web-app-title" content="luxe">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="stylesheet" href="/theme.css">
<link rel="stylesheet" href="/app/style.css">

View File

@@ -6,6 +6,7 @@
// so nothing waits on the round trip to be readable.
import { useLayoutEffect, useRef, useState } from "preact/hooks";
import { Answers, questionOutcome } from "./answers.js";
import { html, landedIn } from "./html.js";
import { useRendered } from "./render.js";
@@ -31,13 +32,28 @@ export function windowOf(items, shown) {
return { hidden, drawn: hidden ? items.slice(hidden) : items };
}
/** @param {{ items: TranscriptItem[] }} props */
export function Transcript({ items }) {
/**
* Where the drawn items start, of `length`, when at least the latest `shown` are wanted. A reader
* following the bottom gets the latest `shown`. One reading above it keeps the start where it was,
* so new items grow the list below them rather than taking items from over them: WebKit doesn't
* anchor the scroll, and every item dropped from the top moved what they were reading.
* @param {number | null} start where the drawn items started last time, if they have
* @param {number} length @param {number} shown @param {boolean} following
*/
export function windowStart(start, length, shown, following) {
const latest = Math.max(0, length - shown);
return following || start === null ? latest : Math.min(start, latest);
}
/** @param {{ items: TranscriptItem[], following: boolean }} props */
export function Transcript({ items, following }) {
const [shown, setShown] = useState(WINDOW);
const list = useRef(/** @type {HTMLDivElement | null} */ (null));
const start = useRef(/** @type {number | null} */ (null));
const keepPlace = useKeptPlace(list);
const { hidden, drawn } = windowOf(items, shown);
const more = () => keepPlace(() => setShown(shown + WINDOW));
start.current = windowStart(start.current, items.length, shown, following);
const { hidden, drawn } = windowOf(items, items.length - start.current);
const more = () => keepPlace(() => setShown(items.length - Math.max(0, hidden - WINDOW)));
const count = html`<span class="dim">${hidden.toLocaleString()} more</span>`;
return html`<div class="transcript" ref=${list} onClick=${copyCode}>
${hidden ? html`<button type="button" class="earlier" onClick=${more}>Show earlier ${count}</button>` : null}
@@ -118,15 +134,10 @@ function Reply({ item }) {
return html`<${Rendered} className="item reply md" rendered=${rendered} text=${item.text.value} />`;
}
/** @param {{ item: TextItem }} props */
/** Reasoning in full, as the TUI shows it by default. @param {{ item: TextItem }} props */
function Thinking({ item }) {
const [open, setOpen] = useState(false);
const rendered = useRendered({ kind: "reasoning", text: item.text.value }, !!item.provisional);
const toggle = () => setOpen(!open);
/** @param {KeyboardEvent} event */
const onKey = (event) => (event.key === "Enter" || event.key === " ") && toggle();
return html`<div class=${`item thinking ${open ? "open" : ""}`} role="button" tabindex="0"
aria-expanded=${open} onClick=${toggle} onKeyDown=${onKey}>
return html`<div class="item thinking">
<${Rendered} className="md reasoning" rendered=${rendered} text=${item.text.value} />
</div>`;
}
@@ -140,6 +151,8 @@ function ToolCard({ card }) {
<span class="tool-label">${call.label}</span>
<span class="tool-time">${standing(call)}</span>
${body(call)}`;
const outcome = call.name === "question" && output ? questionOutcome(output) : null;
if (outcome) return html`<div class=${`item tool ${call.state}`}><div class="tool-head">${head}</div><${Answers} outcome=${outcome} /></div>`;
if (!output) return html`<div class=${`item tool ${call.state}`}><div class="tool-head">${head}</div></div>`;
return html`<details class=${`item tool ${call.state}`}>
<summary class="tool-head">${head}</summary>

View File

@@ -1,6 +1,6 @@
// @ts-check
// The models a session can switch to, asked for each time the details sheet opens and answered to
// this device alone. An older Luxe doesn't know the question and refuses it, so the sheet says so
// this device alone. An older luxe doesn't know the question and refuses it, so the sheet says so
// rather than waiting for an answer that won't come.
import { signal } from "@preact/signals";

View File

@@ -120,8 +120,8 @@ export function NotificationSwitch() {
function Choice({ state }) {
switch (state) {
case "unsupported": return html`<p class="dim">Notifications aren't supported in this browser.</p>`;
case "home-screen": return html`<p class="dim">Add Luxe to your Home Screen to enable notifications.</p>`;
case "blocked": return html`<p class="dim">Allow notifications for Luxe in this device's settings.</p>`;
case "home-screen": return html`<p class="dim">Add luxe to your Home Screen to enable notifications.</p>`;
case "blocked": return html`<p class="dim">Allow notifications for luxe in this device's settings.</p>`;
case "on": return html`<p class="dim">Notifications are on for this device.</p>
<button type="button" class="quiet" onClick=${() => flip(turnOff)}>Turn off</button>`;
default: return html`<p class="dim">Get notified when a session needs an answer or finishes a long turn.</p>

View File

@@ -28,18 +28,20 @@ import { createWorkspace, diffRequest } from "./workspace.js";
const PROTOCOL_VERSION = 2;
/** @import { Frame, Status } from "./connection.js" */
/** @import { Signal } from "@preact/signals" */
/** @typedef {ReturnType<typeof createView>} View */
/** @param {{ sessionId: string }} props */
export function SessionView({ sessionId }) {
const view = useMemo(createView, [sessionId]);
const transcriptRef = useRef(/** @type {HTMLElement | null} */ (null));
const following = useMemo(() => signal(true), [sessionId]);
useLink(sessionId, view);
usePinnedScroll(transcriptRef);
usePinnedScroll(transcriptRef, following);
return html`
<${Header} view=${view} sessionId=${sessionId} />
<main ref=${transcriptRef}>
<${Transcript} items=${view.transcript.items.value} />
<${Transcript} items=${view.transcript.items.value} following=${following.value} />
<${Ending} status=${view.status.value} problem=${view.problem.value} />
</main>
<${Footer} view=${view} />
@@ -203,7 +205,7 @@ function applyFrame(view, frame) {
if (frame.kind !== "ready") return view.transcript.apply(frame);
view.title.value = folderName(frame.content.cwd);
if (frame.content.protocol_version !== PROTOCOL_VERSION) {
view.problem.value = `Protocol mismatch: Luxe uses ${frame.content.protocol_version}, this app ${PROTOCOL_VERSION}.`;
view.problem.value = `Protocol mismatch: luxe uses ${frame.content.protocol_version}, this app ${PROTOCOL_VERSION}.`;
}
}
@@ -225,24 +227,27 @@ function Ending({ status, problem }) {
/**
* Follow new output while the reader is at the bottom; leave them be once they scroll up. Only
* scrolling up lets go: items drawn late grow the page under a scroll to the bottom, which would
* otherwise read as the reader having left it.
* @param {{ current: HTMLElement | null }} ref
* otherwise read as the reader having left it. `following` says which, for the transcript's window.
* @param {{ current: HTMLElement | null }} ref @param {Signal<boolean>} following
*/
function usePinnedScroll(ref) {
useEffect(() => (ref.current ? followGrowth(ref.current) : undefined), []);
function usePinnedScroll(ref, following) {
useEffect(() => (ref.current ? followGrowth(ref.current, following) : undefined), [following]);
}
/** Keeps the page at the bottom as `transcript` grows, until stopped. @param {HTMLElement} transcript */
function followGrowth(transcript) {
let pinned = true;
/**
* Keeps the page at the bottom as `transcript` grows, until stopped.
* @param {HTMLElement} transcript @param {Signal<boolean>} following
*/
function followGrowth(transcript, following) {
following.value = true;
let lastY = scrollY;
const page = document.documentElement;
const onScroll = () => {
if (innerHeight + scrollY >= page.scrollHeight - 48) pinned = true;
else if (scrollY < lastY) pinned = false;
if (innerHeight + scrollY >= page.scrollHeight - 48) following.value = true;
else if (scrollY < lastY) following.value = false;
lastY = scrollY;
};
const follow = new ResizeObserver(() => pinned && scrollTo(0, page.scrollHeight));
const follow = new ResizeObserver(() => following.value && scrollTo(0, page.scrollHeight));
addEventListener("scroll", onScroll, { passive: true });
follow.observe(transcript);
return () => {

View File

@@ -88,7 +88,7 @@ function Row({ session }) {
return html`<a class="session" href=${`#/session/${encodeURIComponent(session.session_id)}`}>
<span class="name">${folderName(session.cwd)}</span>
<span class="dim path">${session.cwd}</span>
<span class="dim">${session.session_id.slice(0, 8)} · Luxe ${session.luxe_version}</span>
<span class="dim">${session.session_id.slice(0, 8)} · luxe ${session.luxe_version}</span>
</a>`;
}

View File

@@ -1,23 +1,23 @@
/* The app is set like the terminal: one monospace face, one line height, widths in `ch`. Colors
come from `/theme.css`, the active theme; each fallback is Luxe's own, for a theme whose token
come from `/theme.css`, the active theme; each fallback is luxe's own, for a theme whose token
is the terminal's default color, which a page can't know. Rendered text is `markdown.css`. */
@font-face {
font-family: "Luxe Mono";
font-family: "luxe Mono";
src: url("fonts/jetbrains-mono-regular.woff2") format("woff2");
font-weight: 400;
font-display: swap;
}
@font-face {
font-family: "Luxe Mono";
font-family: "luxe Mono";
src: url("fonts/jetbrains-mono-bold.woff2") format("woff2");
font-weight: 700;
font-display: swap;
}
@font-face {
font-family: "Luxe Mono";
font-family: "luxe Mono";
src: url("fonts/jetbrains-mono-italic.woff2") format("woff2");
font-style: italic;
font-display: swap;
@@ -25,14 +25,14 @@
/* A separate family, so the browser takes from it only what the first face lacks */
@font-face {
font-family: "Luxe Mono Marks";
font-family: "luxe Mono Marks";
src: url("fonts/adwaita-mono-regular.woff2") format("woff2");
font-weight: 400;
font-display: swap;
}
@font-face {
font-family: "Luxe Mono Marks";
font-family: "luxe Mono Marks";
src: url("fonts/adwaita-mono-bold.woff2") format("woff2");
font-weight: 700;
font-display: swap;
@@ -44,6 +44,17 @@
--corner: 0.5ch;
/* the least a finger is given to hit, Apple's 44 points */
--tap: 2.4lh;
/* where a top edge's content starts: under the status bar */
--top-inset: env(safe-area-inset-top);
}
/* From the Home Screen, iOS 26 blurs a strip of the page just under the status bar, and a page has
no way to turn that off (only a native app's web view does). So the top bar's words start below
it, and only its background sits in the blur. A Safari tab has its own toolbar up there. */
@media (display-mode: standalone) {
:root {
--top-inset: calc(env(safe-area-inset-top) + 0.75lh);
}
}
body {
@@ -51,7 +62,7 @@ body {
padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
background: var(--luxe-background, #12100e);
color: var(--luxe-text, #e4dfd6);
font: 13px / var(--cell) "Luxe Mono", "Luxe Mono Marks", ui-monospace, monospace;
font: 13px / var(--cell) "luxe Mono", "luxe Mono Marks", ui-monospace, monospace;
-webkit-text-size-adjust: 100%;
}
@@ -64,7 +75,7 @@ button {
text-align: start;
}
/* Buttons keep Luxe's square shape: no browser's rounded tap blob or focus ring, which hug a lone
/* Buttons keep luxe's square shape: no browser's rounded tap blob or focus ring, which hug a lone
icon into a circle. A press or a keyboard's focus marks the button's own box instead */
button,
a {
@@ -125,7 +136,7 @@ main {
display: flex;
gap: 1ch;
align-items: baseline;
padding: calc(env(safe-area-inset-top) + 0.5lh) 1ch 0.5lh;
padding: calc(var(--top-inset) + 0.5lh) 1ch 0.5lh;
background: var(--luxe-background, #12100e);
border-bottom: 1px solid var(--luxe-border-muted, #2e2b27);
}
@@ -370,7 +381,7 @@ h2 {
padding-inline: 1ch;
}
/* Your words on a band; a brief Luxe wrote to the agent, as one muted line */
/* Your words on a band; a brief luxe wrote to the agent, as one muted line */
.user-message .words,
.user-message.plain {
display: block;
@@ -399,18 +410,11 @@ h2 {
padding-inline: 1ch;
}
/* Reasoning stays three rows until it's tapped open */
/* Reasoning in full, as the TUI shows it: a clipped block reads as text that never arrived */
.thinking {
padding-inline: 1ch;
font-style: italic;
color: var(--luxe-thinking-text, #97938c);
max-height: 3lh;
overflow: hidden;
cursor: pointer;
}
.thinking.open {
max-height: none;
}
.tool {
@@ -452,6 +456,29 @@ h2 {
white-space: pre-wrap;
}
/* A question's answers sit under the question, in the voice of the reader's own messages */
.answers {
padding-inline-start: 3ch;
}
.answers p {
margin: 0;
}
.answer {
color: var(--luxe-accent, #ddc084);
}
.answer-label {
margin-inline-end: 1ch;
font-weight: bold;
color: var(--luxe-success, #81caa0);
}
.answer-note {
color: var(--luxe-muted, #97938c);
}
.tool-output {
margin-block-start: 0.5lh;
padding-block-start: 0.5lh;

View File

@@ -44,7 +44,7 @@ export function createTranscript() {
}
// The engine says a turn started with turn_started; the message that opened it, or anything it
// streams, stands in for that from a session whose Luxe predates the event
// streams, stands in for that from a session whose luxe predates the event
const TURN_SIGNS = new Set(["turn_started", "token_delta", "thinking_delta", "tool_call_composing"]);
/** @param {State} state @param {Frame} frame */

View File

@@ -42,9 +42,9 @@ export async function loadWordmark(get = fetch) {
export function Wordmark() {
const art = drawing.value;
if (!art) return html`<span class="title">Luxe</span>`;
if (!art) return html`<span class="title">luxe</span>`;
// a custom property set through the DOM, which the page's style-src allows
return html`<svg class="wordmark" viewBox=${art.viewBox} role="img" aria-label="Luxe"
return html`<svg class="wordmark" viewBox=${art.viewBox} role="img" aria-label="luxe"
style=${{ "--drift-depth": art.depth }}>
${art.paths.map((d, index) => html`<path d=${d} style=${{ "--phase": driftPhase(index, art.paths.length) }} />`)}
</svg>`;

View File

@@ -33,7 +33,7 @@ function read(data) {
/** @param {Notice | null} notice */
function show(notice) {
if (!notice?.title) {
return worker.registration.showNotification("Luxe", { body: "A session wants you", icon: ICON });
return worker.registration.showNotification("luxe", { body: "A session wants you", icon: ICON });
}
const { title, body, session } = notice;
return worker.registration.showNotification(title, { body, icon: ICON, data: { session } });