mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 06:17:23 +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>
105 lines
3.3 KiB
TypeScript
105 lines
3.3 KiB
TypeScript
/**
|
|
* The Sessions list's words (lib/session-list): open or not, what an open
|
|
* one is doing, and when an agent last worked on the rest — never the age of
|
|
* a database row ("aoz-housing · offline · 29d ago", owner, 2026-10-19).
|
|
*
|
|
* Run: npx tsx scripts/test/session-list.ts
|
|
*/
|
|
import assert from "node:assert/strict";
|
|
import { OPEN_FRESH_MS, sessionListRow, type SessionStateRow } from "../../src/lib/session-list";
|
|
|
|
const NOW = Date.parse("2026-10-19T18:00:00Z");
|
|
const ago = (ms: number) => new Date(NOW - ms);
|
|
const row = (patch: Partial<SessionStateRow>): SessionStateRow => ({
|
|
agentRunning: true,
|
|
tabOpen: true,
|
|
closedAt: null,
|
|
sessionStatus: null,
|
|
sessionBlockReason: null,
|
|
currentPromptKey: null,
|
|
currentPromptLabel: null,
|
|
runtimeObservedAt: ago(60_000),
|
|
sessionUpdatedAt: null,
|
|
currentPromptStartedAt: null,
|
|
updatedAt: ago(60_000),
|
|
...patch,
|
|
});
|
|
|
|
// Open, and what tapping gives you.
|
|
assert.deepEqual(sessionListRow(row({}), NOW), {
|
|
open: true,
|
|
status: "idle",
|
|
line: "Open, nothing running",
|
|
});
|
|
assert.deepEqual(
|
|
sessionListRow(
|
|
row({ currentPromptKey: "custom", currentPromptLabel: "Fix the contact form" }),
|
|
NOW,
|
|
),
|
|
{ open: true, status: "working", line: "Working on Fix the contact form" },
|
|
);
|
|
assert.equal(
|
|
sessionListRow(row({ currentPromptKey: "custom", currentPromptLabel: "custom" }), NOW).open &&
|
|
(
|
|
sessionListRow(row({ currentPromptKey: "custom", currentPromptLabel: "custom" }), NOW) as {
|
|
line: string;
|
|
}
|
|
).line,
|
|
"Working",
|
|
"a bare prompt key is not shown as a task",
|
|
);
|
|
assert.deepEqual(sessionListRow(row({ sessionStatus: "blocked" }), NOW), {
|
|
open: true,
|
|
status: "waiting",
|
|
line: "Waiting for you",
|
|
});
|
|
assert.deepEqual(sessionListRow(row({ sessionBlockReason: "awaiting_user" }), NOW), {
|
|
open: true,
|
|
status: "waiting",
|
|
line: "Waiting for you",
|
|
});
|
|
assert.deepEqual(sessionListRow(row({ sessionStatus: "ready" }), NOW), {
|
|
open: true,
|
|
status: "finished",
|
|
line: "Finished — your turn",
|
|
});
|
|
// A turn in progress outranks a stale "blocked" handoff.
|
|
assert.equal(
|
|
(
|
|
sessionListRow(row({ sessionStatus: "blocked", currentPromptKey: "next_best" }), NOW) as {
|
|
status: string;
|
|
}
|
|
).status,
|
|
"working",
|
|
);
|
|
|
|
// Not open: closed, nothing running, or not seen by the runner lately.
|
|
assert.equal(sessionListRow(row({ closedAt: ago(1000) }), NOW).open, false);
|
|
assert.equal(sessionListRow(row({ agentRunning: false, tabOpen: false }), NOW).open, false);
|
|
assert.equal(
|
|
sessionListRow(row({ runtimeObservedAt: ago(OPEN_FRESH_MS + 1000) }), NOW).open,
|
|
false,
|
|
"a session the runner has not seen for ten minutes is not called open",
|
|
);
|
|
assert.deepEqual(sessionListRow(null, NOW), { open: false, lastWorkedAt: null });
|
|
|
|
// "Last worked" is the agent's own handoff or prompt start — not updatedAt,
|
|
// which the runner rewrites on every heartbeat.
|
|
const closed = sessionListRow(
|
|
row({
|
|
closedAt: ago(1000),
|
|
updatedAt: ago(60_000),
|
|
sessionUpdatedAt: ago(3 * 86_400_000),
|
|
currentPromptStartedAt: ago(5 * 86_400_000),
|
|
}),
|
|
NOW,
|
|
);
|
|
assert.deepEqual(closed, { open: false, lastWorkedAt: ago(3 * 86_400_000).toISOString() });
|
|
assert.deepEqual(
|
|
sessionListRow(row({ closedAt: ago(1000) }), NOW),
|
|
{ open: false, lastWorkedAt: null },
|
|
"no agent turn on record: no age at all",
|
|
);
|
|
|
|
console.log("✓ session-list: open in words, the rest by when an agent last worked");
|