mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-05 06:07:57 +01:00
* feat(home): every failure carries its fix; one list, no repeats
* feat(alerts): one calm row for the bell and /system — one thing to read, one thing to do
The bell put "WARNING"/"INFO" in capitals beside every title, the whole
description, a bordered "View" and a bare tick; /system put each alert in a
beige or red box holding its full text (owner, 2026-10-19: "a bunch of
text ... some are red, some are green. Very bad design").
- components/alerts/AlertList: shared by both. A dot only for urgent or
warning; the title; the description's first paragraph in at most two
lines, the technical record behind "Details"; when; "Dismiss" as a word;
ONE button named for where it goes, and the whole row opens it. No button
to the page you are already on.
- config/alert-types: an optional `action` per type ("Review", "Fix in
Projects", "Reconnect"), else a label from the destination
("Get the update", "Open Home").
- The system alerts' producers now open with what is wrong and what to do,
in plain words, with the old engineer's text kept as the record:
runner version (and the cloud builder, which updates itself, no longer
says "Get the update"), missing repositories, telemetry, a stalled queue,
model ids.
- /system: a divided list in the card; the count reads "3 open · 1 urgent".
- scripts/test/alert-list-browser.ts mounts both at 390px.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* feat(sessions): open sessions in words, every other project one tap from its own
The Sessions drawer listed all 42 projects, each with one of four coloured
dots, one of six codes (ready / offline / open / closed / working / —), the
age of a database row and a git-branch icon; a tap went to Home. Owner,
2026-10-19: "what exactly do you mean by sessions? What will happen when I
click on AOZ Housing? ... super useless".
- Open now: only sessions the runner has seen open in the last ten minutes,
each in words that say what a tap gives you (Working on <task> / Waiting
for you / Finished — your turn / Open, nothing running). A tap attaches.
- Start in another project: plain rows with when an agent last worked there
(its own handoff time, not the row's heartbeat), a search, Show all. A tap
opens the project on the Sessions page, which now offers its Resume row
instead of "Start it from Loki".
- No colour legend (one pulse for working), no branch icon, no codes.
- lib/session-list is the pure SSOT for the words; tests: session-list,
sessions-drawer-browser.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* fix(ui): chat starts under its header, nothing floats over the terminal, one shape for project settings
- Chat view: the thread no longer bottom-anchors (mt-auto) a short
conversation onto the box, which left ~200px of nothing above the first
message. Dispatch details is a centred 44px row; reply steps are one
grouped list.
- Terminal: "Last screen · updating" was a pill over the output's first
lines. It is a 2px edge bar now, and the header says "connecting…" until
a live frame lands (the remembered screen no longer reports live).
- Project settings: every row is a SettingRow (what it is, its value, its
actions), and every action one bordered 44px shape whichever control drew
it. The phone section picker is one full-width control.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* fix(projects): publish actions take the settings row's size
---------
Co-authored-by: Claude <noreply@anthropic.com>
135 lines
5.7 KiB
TypeScript
135 lines
5.7 KiB
TypeScript
/**
|
|
* The terminal pane before its first live frame, as a phone shows it: words
|
|
* saying it is on its way, then the remembered last screen marked as not yet
|
|
* live, then the live screen with nothing over it.
|
|
*
|
|
* It used to be a black pane for the seconds the runner took to answer, then
|
|
* the terminal "a little bit later" (owner, 2026-10-18), and a user "would
|
|
* think, what's going on? It's not working."
|
|
*
|
|
* Run: npx tsx scripts/test/terminal-opening-browser.ts
|
|
*/
|
|
import assert from "node:assert/strict";
|
|
import fs from "node:fs";
|
|
import path from "node:path";
|
|
import { createRequire } from "node:module";
|
|
import { build } from "esbuild";
|
|
import { chromium } from "playwright";
|
|
import tailwind from "@tailwindcss/postcss";
|
|
|
|
async function main() {
|
|
const require = createRequire(import.meta.url);
|
|
const postcss = createRequire(require.resolve("@tailwindcss/postcss"))("postcss");
|
|
const from = path.resolve("src/app/globals.css");
|
|
const styles = await postcss([tailwind()]).process(fs.readFileSync(from, "utf8"), { from });
|
|
const xtermCss = fs.readFileSync(require.resolve("@xterm/xterm/css/xterm.css"), "utf8");
|
|
const bundle = await build({
|
|
stdin: {
|
|
resolveDir: process.cwd(),
|
|
loader: "jsx",
|
|
contents: `import React from 'react';import{createRoot}from'react-dom/client';import{TerminalView}from'./src/components/terminal/TerminalView';
|
|
const transport={key:'t',convertEol:true,connect(h){window.h=h;return()=>{}},sendKey:async()=>{},sendResize(){}};
|
|
createRoot(document.getElementById('app')).render(<div style={{height:600,display:'flex',flexDirection:'column'}}><TerminalView transport={transport} fill compactChrome/></div>);`,
|
|
},
|
|
bundle: true,
|
|
write: false,
|
|
jsx: "automatic",
|
|
format: "iife",
|
|
loader: { ".css": "empty" },
|
|
define: { "process.env.NODE_ENV": '"production"' },
|
|
});
|
|
let browser;
|
|
try {
|
|
browser = await chromium.launch({ args: ["--no-sandbox"] });
|
|
} catch (error) {
|
|
if (process.env.CI) throw error;
|
|
console.log("↷ terminal opening skipped: Chromium unavailable; CI runs it");
|
|
return;
|
|
}
|
|
try {
|
|
const page = await browser.newPage({ viewport: { width: 390, height: 780 } });
|
|
const errors: string[] = [];
|
|
page.on("pageerror", (e) => errors.push(e.message));
|
|
await page.route("**/*", (r) =>
|
|
r.fulfill(
|
|
r.request().url().includes("/api/")
|
|
? { contentType: "application/json", body: "{}" }
|
|
: {
|
|
contentType: "text/html",
|
|
body: `<style>${styles.css}${xtermCss}</style><div id="app"></div>`,
|
|
},
|
|
),
|
|
);
|
|
await page.goto("http://terminal.fixture/terminal");
|
|
await page.addScriptTag({ content: bundle.outputFiles[0].text });
|
|
await page.waitForFunction(() => Boolean((window as unknown as { h?: unknown }).h));
|
|
type H = {
|
|
onConnected: (c: boolean) => void;
|
|
onCached?: (c: boolean) => void;
|
|
onReset: () => void;
|
|
onOutput: (d: string) => void;
|
|
};
|
|
const frame = (text: string, cached: boolean) =>
|
|
page.evaluate(
|
|
([t, c]) => {
|
|
const h = (window as unknown as { h: H }).h;
|
|
h.onCached?.(c as boolean);
|
|
h.onReset();
|
|
h.onOutput(t as string);
|
|
},
|
|
[text, cached] as const,
|
|
);
|
|
|
|
fs.mkdirSync(".tmp/terminal-opening", { recursive: true });
|
|
await page.evaluate(() => (window as unknown as { h: H }).h.onConnected(true));
|
|
await page.getByText("Opening the screen…").waitFor();
|
|
await page.screenshot({ path: ".tmp/terminal-opening/waiting-390.png" });
|
|
|
|
await frame("claude> remembered screen", true);
|
|
await page.locator(".ui-term-updating").waitFor({ state: "attached" });
|
|
assert.equal(await page.getByText("Opening the screen…").count(), 0, "the screen replaces it");
|
|
// Marked on the pane's EDGE, never over the output (owner, 2026-10-19:
|
|
// the pill covered the first lines of the remembered screen).
|
|
const cover = await page.evaluate(() => {
|
|
const bar = document.querySelector(".ui-term-updating")!.getBoundingClientRect();
|
|
const rows = document.querySelector(".xterm-rows")!.getBoundingClientRect();
|
|
return { barH: bar.height, barBottom: bar.bottom, rowsTop: rows.top };
|
|
});
|
|
assert.ok(cover.barH <= 2, `the mark is an edge line (${cover.barH}px), not a label`);
|
|
assert.ok(
|
|
cover.barBottom <= cover.rowsTop + 2,
|
|
"it is the pane's top edge, not a label over the first line",
|
|
);
|
|
assert.equal(
|
|
await page.locator(".ui-term-updating").textContent(),
|
|
"Last screen · updating",
|
|
"a screen reader still hears what it is",
|
|
);
|
|
await page.screenshot({ path: ".tmp/terminal-opening/cached-390.png" });
|
|
|
|
// The remembered screen is not proof of life: the stall watchdog still
|
|
// runs, and only a live frame clears it.
|
|
await frame("claude> live screen", false);
|
|
await page.locator(".ui-term-updating").waitFor({ state: "detached" });
|
|
assert.equal(await page.getByRole("status").count(), 0, "nothing over the live screen");
|
|
await page.screenshot({ path: ".tmp/terminal-opening/live-390.png" });
|
|
|
|
// A later remembered copy (another viewer joining) never re-marks a live pane.
|
|
await frame("claude> again", true);
|
|
await page.waitForTimeout(100);
|
|
assert.equal(await page.locator(".ui-term-updating").count(), 0, "live stays live");
|
|
assert.deepEqual(errors, []);
|
|
console.log(
|
|
"✓ terminal-opening: words while it opens, the last screen marked, nothing over the live one",
|
|
);
|
|
} finally {
|
|
await browser.close();
|
|
}
|
|
}
|
|
|
|
main().catch((e) => {
|
|
console.error(e instanceof Error ? e.stack : e);
|
|
console.error(`✗ terminal-opening: ${e instanceof Error ? e.message : String(e)}`);
|
|
process.exit(1);
|
|
});
|