mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 05:37:19 +01:00
* docs(design): the reset brief, and a page audit that signs in and screenshots every page
The owner walked the app on a phone on 2026-10-21 and called it unusable.
design-reset-2026-10.md is the bar every page is now held to, written from
the apps he uses daily. scripts/audit-pages.mjs signs in (the public demo by
default), visits every page at phone and desktop width, saves screenshots and
writes down overflow, duplicate h1s, sticky blocks, cut-off text, small tap
targets, console errors and failed requests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* feat(scripts): seed:showcase, a local account that looks like the owner's
The public demo has three tidy projects, so most pages look empty on it and
their real problems never show. scripts/seed-showcase.ts creates
owner@loki.local / showcase-owner ("Cato", operator) with 42 projects under
the owner's own junk folder names and long task-text descriptions, mixed
states (live, site down, not connected, deploy failed, autopilot paused,
production / blueprint), 73 feedback items on one project and 8 on another,
73 runs over 60 days with the real failure texts and three running now,
bell alerts 8, 19 and 28 days old, four identical "Next Best Step" prompts
plus two near-copies, a dozen Loki threads, goals with milestones, habits
with history, people, crew assignments, approvals, package rows, scheduled
jobs, subscriptions, events and memory.
Idempotent through the demo reset's live-foreign-key wipe (now exported),
with timestamps relative to now. Refuses any non-localhost database URL,
the prod tunnel's port, and a database that already has an operator.
audit-pages.mjs documents the pair.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* fix(audit): one slow screenshot no longer loses the whole report
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* feat(widget): a host can draw the launcher itself (data-fc-place="host")
A rendered region marked data-fc-place="host" IS the launcher: the widget
draws no floating button while it is on screen and counts the owner's state
as shown, so watch mode adds no bar. When the region goes, the launcher comes
back on its own. The page opens the panel with Loki.open() and reads
Loki.status ({ owner, watching, unread }), announced as a loki:status event.
A hidden region still wins. Customer sites are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* feat(design): primitives and a calm top bar for the design reset
The pieces the page rebuilds are made of (docs/development/design-reset-2026-10.md):
ListRow + List + ListSearch, Section/SectionHeading, a quiet EmptyState,
ChoiceMenu ("Sort: Priority" as a sheet on a phone, a popover from md up),
and PageAction — a page's one primary action, a round + in the phone top bar
and a pill in the header from md up (PageLayout action, ModalForm
trigger="page-action").
Chrome: the top bar names every page on a phone with 40px borderless icons;
exactly one h1 per page at every width (the page's own, read but not drawn on
a phone; the bar's name is the h1 only when the page has none). Loki's own
feedback launcher is a top-bar icon (data-fc-place="host"), not a tab over the
content. The Sessions drawer icon leaves the phone bar. The bottom bar is
exactly its token's height and the main column ends above it, so nothing
scrolls under it. ui-kicker and ui-micro-label stop shouting in capitals;
empty panels lose their box; the demo strip is one line on a phone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* feat(memory,robots): rebuild both pages to the design reset
The two worked examples the page rebuilds copy. Memory: the counts as a
sentence, then sections of rows — recently added (each with its own Forget
in a row menu), recent activity, by kind, context from other projects — and
"Forget everything" as the page's last row. No cards, tiles or badges.
Robots: the title is the top bar's, "Add robot" is the round + beside the
avatar, the search is the list's first row, each robot one row, and an empty
book is an icon, a line and one button.
Adds a "Primitives" section to the design brief: each primitive, its file,
and when to use it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* fix(alerts): stale notifications fold into Earlier; the bell counts what still needs you
The bell read a red 9+ over nudges 8, 19 and 28 days old. Root cause: event
alerts (studio requests, build requests, escalations) have no condition a
checker can see end, so nothing ever cleared them; insert-once producers
deduped against any open row, so one forgotten alert swallowed every later
occurrence; and the bell counted every open row however old.
- lib/alerts/relevance: an alert is current while younger than its type's
window (alert-types freshForDays, default 7) or urgent; otherwise Earlier.
/api/alerts marks each one; the bell counts only current ones, and Today's
needs-you reads the same rule.
- insertActiveAlertOnce lets a stale open alert go instead of blocking new
ones; refreshOrInsertActiveAlert can renew the date when things got worse
(feedback summary renews when more items wait).
- The feedback summary says one plain sentence instead of
'84 feedback items need you (stalled + check live)'.
- The panel is a ListRow sheet (bottom sheet on a phone): dot, title, one
grey line, time, x to dismiss; Earlier below with Clear all.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* style(labels): sentence case for the app's remaining capital-letter labels
Section labels in settings, Control, Today and the private unlock form
dropped their uppercase + letter-spacing (design reset rule 4). Small
tags (status pills, badges) keep theirs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* feat(ui): DetailSheet, a ListRow control slot, quiet ModalForm triggers
DetailSheet opens one thing from its row (bottom sheet on a phone, dialog
from md up) with its actions as full-width rows. ListRow gains a leading
control that is its own action (a habit's check-off); ModalForm gains a
"secondary" trigger for an empty state's one button and "none" for a
form opened from a row's menu. Styles for the Life pages sit in one
design-reset block in globals.css; rules their old markup used are gone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* feat(goals): rows on /goals, and a page of its own for every goal
/goals is one sentence ("4 goals, 48% done on average") and a list: a
progress ring, the title, one line (due, milestones, sub-goals, project)
and the percentage. Sort and project are menus, not chip rows cut at the
edge; finished and set-aside goals fold away. The old card — inline
title, description button, four menu actions, folded milestones, nested
sub-goal cards — is now /goals/[id]: where it stands, its fields as rows,
milestones and sub-goals as lists, the actions as rows at the end.
Deleting a goal now checks the answer instead of refreshing on failure.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* feat(habits): check off from the row, open a habit in a sheet
/habits is one sentence ("3 of 5 done today") and a row per habit: the
circle on the left checks it off for today, the row opens the habit — its
month, how often (one even row of three), the goals it feeds, pause,
rename, ask Loki, delete. The card with a 35-cell heatmap, a frequency
select, five icon buttons and a stat-tile row above it is gone. A goal's
row line drops its milestone count, which pushed the project off a phone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* feat(projects): rebuild the list, project page and Watch to the design reset
/projects is a search row, two menus on one line (Show / Sort) and ListRows:
an initial, projectTitle(), ONE plain-word state line ("Building now",
"Live · updated 2h ago", "Needs you: 3 notes") and the time since the last
run. Nothing sticks. Checks, stage and feedback counts moved to the project
page; earlier `-refresh-<hex>` copies and archived projects fold under
"Archived". The two black buttons became one `+` that asks "Build a site"
or "Add an existing project".
The project page has one title with the way back, one primary action (Ask
Loki, in the top bar on a phone), a section menu on a phone instead of a
pinned select, sections as plain headings without boxes, flags as "Needs
fixing" rows, and agent sentences said plainly (no URLs or HTTP codes).
Watch it work uses PageLayout and names the project with projectTitle().
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* wip(work-tools): prompts, activity, feedback rebuilt as rows; tab-inject starts repo-only projects
Work in progress before merging main; gates run after the merge.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* feat(events): rows by date, a sheet per event; an event with no deadline can be added again
/events reads an event's date and place, not only its deadline: a meetup
with a day and a city sat under "No deadline" as if it had neither. Rows
go coming up, no date yet, already happened; a row opens the event in a
sheet (edit, ask Loki, archive, delete) and "New event" is the page's
one action, a form in a sheet.
Fix: the add form sent "" for an empty deadline and the API refused it
as "Invalid date", so no event without a deadline could be added. The
form now sends only what was filled in, and the API reads "" as none.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* feat(talk): Loki's empty chat, chat list, Sessions and More sheet as rows
- /loki: a greeting, recent chats and Build next as ListRows above the
composer; no scrolling chip strip, no starter chips when there are
projects, no "Auto your key" on the model chip; the chat list
(ThreadRail) as Claude's list, pin and delete in each row's menu.
- Sessions: nothing open is one line and a Resume row per project; a
missed deep link is one line and its row (and, on a phone, the open
sessions); the session and more sheets are short rows; the Sessions
drawer is a list with its search as the first row.
- More sheet: names only, no truncated descriptions.
- Voice: one line and Start, then titled sections of rows.
- Sidebar section labels and app-wide label classes in sentence case.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* wip(public): calmer signed-out site — rows, one orange action, sentence case
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* feat(design): Home, Today, Suggestions and Approvals as sections of rows
Design reset (docs/development/design-reset-2026-10.md) for the 'what needs
me' group:
- Home: three sections of ListRows — Needs you (failures with their fix on
the row, escalations, the review inbox), Being built, Done — under the
composer. Job cards that all read 'Next best step' became rows naming the
project and the live step; the footer is two rows (builder, New project),
so nothing pokes under the bottom bar. The status hero no longer repeats
projects the rows already name. Builder-offline chip is a row.
- Today: a greeting, the day in one sentence (lib/today-brief todaySentence)
with Plan my day / Log a conversation, then Needs you, weather in one
line, Calendar, Habits, Commitments, Sticky note and More as sections of
rows. Six recap cards that restated nav pages are gone.
- Suggestions: momentum as a sentence, Show: All menu instead of a cut-off
chip row, each suggestion a ListRow (tap = do it, menu = Not now), and
project names through projectTitle().
- Approvals: pending first, unboxed; Approve/Decline in words; event times
in the reader's zone instead of a raw UTC ISO string; standing approvals
as OptionRows at the end; quiet empty state.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* feat(money): one sentence, subscription rows, a sheet per subscription
"51.00 CHF and 329.60 USD a month across 9 subscriptions. Next: GitHub on
3 Nov." replaces three stat tiles. Each subscription is a row (how often,
when next, whether a receipt backs it; the amount on the right) that opens
a sheet with everything the row used to carry: mark paid, edit, check at
the vendor, ask Loki, free alternatives, cancel, delete. Cancelled ones
fold away; promised money and the founder's OrangeCat link are rows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* feat(people): contact rows with search and menus, a real page per person
/people is a list like a phone's contacts: initial, name, what they do and
where, how long since you talked. Search is the first row; Show and Sort
are menus instead of a chip row cut at the edge; the filled "Log talk"
button on every row moved into the row's menu. Importing and merging is
one row that opens a sheet. A person's page opens with the person on it
(it fetched the same row again behind a skeleton), in plain sections,
with rename, ask Loki and delete as rows at the end.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* feat(crew): asks and crew as rows; an ask with nobody on it can be given to someone
One sentence ("1 ask needs you"), the open asks grouped by where they
stand, each a row that opens a sheet with its brief, link, payment and
the moves open to you; your crew as rows with "Give them work" in the
row's menu. Fix: an ask saved with nobody on it said "pick someone before
handing this over" and offered no way to pick; the sheet now does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* feat(settings): a list of sections on a phone, flat sections inside
Below lg, /settings is a list of its twelve sections, each a row with
what is in it; one opens as its own page with a back row, and the phone's
back gesture returns to the list. The tab strip that ran off the screen
is gone. Inside, the bordered boxes and caps labels are flattened to
sections and rows; Appearance is one even row of three, the digest is a
list of choices, and the Agent tab says what it is for in plain words.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* fix(home,bell): failure rows give the reason the full width; Earlier rows carry no dot
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* feat(today,home): In focus is one row; Home loads as its own shape
TodayWatch was a bordered card with an orange capitals eyebrow, the day's
counts a second time and two Loki buttons; it is now one row under 'In
focus' with Loki's nudge as a plain line, and says nothing when nothing
stands out. Home's loading state is the composer and three row lines
instead of three empty cards.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* feat(projects): plain sections on every project tab, one time per row
- A row's line no longer repeats its trailing time ("Worked on 1d ago … 1d"):
it says Live / Not live yet / Not started yet, and the time is said once.
- A run waiting on a person (main's new "needs_you" build state) reads
"Needs you: the agent is waiting" on the list and offers "See what it
needs" on the project; the list query now reads the run's own record.
- Story: one rename (in the header), the stage drawn without colour, the
profile score labelled in words, "The story" instead of "Agent context",
three short fill buttons that fit a phone.
- Feedback: one heading and one "…" menu for list actions; the widget setup
and auto-ship toggle on the page instead of boxes in boxes; plain labels
("Put it on the site", "Turn on only") kept in step with the API hints and
the public docs.
- Activity: "What changed" as rows, newest first by date, no handoff chips.
- Plan: "Roadmap" is the section's heading; no accent icons.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* fix(prompts): one Run that works — repo-only projects start, Loki streams, no raw blanks
- Send to terminal on a project with only a repository (no folder) queued a
bare inject that failed with "no running agent for 'substrata' on this
runner"; tab-inject now hands such projects to the inject core, the same
start-or-queue path /api/inject uses (in the previous commit).
- The Run sheet leads with the prompt's own worker (lib/prompt-run): the
project's agent for project work, Loki for personal prompts; the other is
one quiet line. A send ends in one sentence and "Watch it work".
- Run with Loki streams into the sheet through the chat's own thread
(useSessionAsk + ChatThread): clock, Stop, retry, Continue in Loki.
- {{variables}} are never shown raw: blanks are named in words until filled.
- Pins all of it in scripts/test/prompts-page.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* feat(activity): the answer as a sentence, failures and history as rows
/activity drew eight boxes before the first event: a hero card with a bar
chart and four coloured tiles, a red card of failures in the builder's own
words, project chips cut off at the edge, a time picker card, count chips and
a report card. Now: When and Project as two menus, the headline sentence,
"Runs need you" as rows with Run again, and "What happened" as rows under
day headings (Show: menu), each opening its run on Watch. The report is the
page's one action, in a sheet. Failures read in plain words (activity-words).
Fixes the double <h1> (page and view both drew PageLayout).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* feat(feedback): decisions and reports as rows; each opens in a sheet
/feedback: "Do all" is the page's one action (confirmed in a sheet that
says what it spends); every decision is one row — the report in the
reporter's words, project and when — with its yes as the row's own button,
still one tap; the row opens the full decision (Loki's read, facts, every
move) in a sheet. Under way / Done / Filed away are rows with their state in
plain words. Keeps main's per-decision taken key (#1367).
/my-feedback: rows (your words, status and project, when), each opening the
shared ReporterFeedbackCard in a sheet; a quiet empty state.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* feat(system,packages): plain sections and rows; one design-reset block in globals.css
/system: nineteen bordered cards under three question headings become one
page of plain sections (SystemBlock: sentence-case heading, no box) with
words a person would say — Alarms, Server, Server size, Room for more work,
Health check, Recent errors, Agents keep going, Runs on a schedule — and the
records behind one "More records" row. Agents keep going is one sentence
and the one button that changes it.
/packages: each package one row (latest, who uses it, who is behind), the
read line ending in "Read again", and Publish to npm as two calm numbered
steps instead of a card.
globals.css: the work-tools block (prompts sheet, activity, feedback row
verb, steps, system) after the feedback classes; the dead activity, pulse,
needs-you and feedback-card rules deleted with the code that used them, and
ui-btn-overlay (its last users were the prompt cards). CLAUDE.md follows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* fix(talk): own class for the empty Sessions list, quieter dots, a voice note that fits
ui-term-empty already named another rule, which centred the new list;
a finished session no longer gets a green dot (rule 8); the 'Only what
needs me' line fits under its switch on a phone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* fix(public): reachable /fleet filters on desktop, essay body on the title's edge
The /fleet filters sat in a <details> whose summary was hidden from md up
on the belief that CSS forced it open; a closed <details> hides its
content at any width, so on a desktop the filters were gone with nothing
to press. The toggle now shows at every width and opens itself while a
filter is set. The footer's closed studio-sites list no longer lays out
invisibly, and an essay's body starts on the same left edge as its title.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* fix(feedback): projects by name, the age last, the night note in francs
- Every project on /feedback goes through projectTitle(): the inbox route
attaches each row's projectTitle from the project entity, and the rows, the
project menu and the sheet title read it.
- A decision row's one line is project · age (or the page, with one project
in view); the repeated "Build it, one agent run" beside a "Build it" button
is gone, and no trailing age squeezes the report's words.
- The morning note (nightNoteText, shared with /today) names projects through
projectTitle, drops the "· 2 of 3 runs" ledger, and states the cost in
francs (CHF_PER_USD): "… filed away 4 old reports. It cost CHF 1.70."
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* chore: drop the dead recent-dispatches query; the build-row fade at every width
getRecentDispatches fed only the Today recap card the redesign removed. The
/loki build row hid its scrollbar at every width but faded its edge only on
a phone; the fade now applies wherever the row scrolls.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* fix(projects): a project with no title reads as a word, not its folder name
projectTitle passed an untitled project's folder name straight through, so
Home, Feedback and the bell listed "murphys-bar" and "aoz-housing". An
all-lowercase slug now reads as a word ("Murphys bar"); a name typed with
capitals is kept as typed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* fix(public): headline visible before its animation, names through projectTitle, plain demo note
The hero rose in from opacity 0 with a 'both' fill, so until the
animation ran the headline was simply not there: a slow phone, a
screenshot or a page still loading showed a blank where the promise
should be. The rise is now movement only; content is visible by
default and reduced motion turns the movement off.
Every project name on the public site (the /fleet register, a project's
public page, a person's public profile, the landing hero) now goes
through projectTitle(). The sign-in demo note says what is switched off
in plain words, and /build's eyebrow is sentence case.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* chore(terminal): drop terminalSourceHint, which nothing reads now
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* fix(life): project titles, channel names and sheet rows after a look at the pages
A goal's project and an ask's project read the project's title when it
has one instead of its folder name; the ask's row drops the project so
the date fits on a phone. A person's ways to reach them and their
conversations say "WhatsApp", not "whatsapp", and the icon now matches
a conversation's channel (it looked the channel up without its prefix and
always fell back). Sheet action rows draw every icon at one size and start
at the left; "I cancelled it" is not red. A goal's progress and date are
body text. The responsive audit names /goals/[id] as needing an id.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* fix(work-tools): every project name through projectTitle()
With main's projectTitle() reading an untitled key as words (3bc9a395), the
remaining bare keys in this group go through it too: the decision card's
where-line and the full feedback row's project link, Activity's rows, menus
and retry label (one titleFor helper instead of three fallbacks to the raw
key), scheduled jobs grouped by project on /system, and the repositories and
dependents on /packages.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* test(projects): pin the rebuilt rows, flags and activity to the new rule
- getProjectsRunNow reads runs since a day ago with gte(), not raw SQL.
- The health panel can no longer be trapped by a row: it is not on a row.
- "Needs fixing" heads the flags; each row carries a red dot and no tint.
- Activity speaks plainly ("Working on …", "Nothing running", "last change").
- The project page's site link uses the widget's owner-pass helper, so the
browser fixture bundles it.
- The chooser's two lines fit a phone; the dead ui-* rule baseline drops to 27.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* docs(projects): the Views row describes the rebuilt list and page
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* fix(home,today): project names in words, reasons that say what happened, one builder line
- Every project name on Home and Today goes through projectTitle().
- 'last run: needs attention' became what the run's record says, in words
(lib/attention-words): 'Stopped: …', 'Stuck: …', 'The last run only got
part of the way — next: …'.
- Home says the builder's state once: the row at the top. The foot is
Settings and New project, and no longer contradicts it.
- Runs with no word from the agent sit under 'Gone quiet' and say what
they wait on ('No word from the agent for 1d', 'Waiting for a builder to
pick it up'); times are compact ('1d', '2h 5m').
- Today: Start my day is one row when no main projects are chosen; the
headline names its parts ('4 urgent, 4 approvals, 42 reports to triage
and 7 other things.'); an urgent item has one action (Fix with Loki), its
title opens it; alerts show their first paragraph only. The repo-missing
alert says "<Project>'s repository can't be found on GitHub", with no URL
or status code in the words a person reads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* docs: the Life pages and their primitives, as they now are
CLAUDE.md's component map and Views rows for People, Crew, Money, Goals,
Habits, Events and Settings described cards, chip filters and stat tiles
that are gone. The design-reset primitives table gains DetailSheet, the
ListRow control slot and ModalForm's quiet triggers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* chore(design): drop two rules the rebuilt pages no longer use
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* fix(audit): a page that reloads or crashes no longer ends the audit
Each route gets its own page, measuring retries while a dev server reloads,
and a crashed page is recorded in the report instead of throwing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* docs(changelog): every page, calm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* fix(design): session names in words, and no "next: Nothing queued"
A session's name in Sessions was its folder ("derhochhinhousepartyrenner-ch-
refresh"); it now reads as every other surface names the project. Home no
longer appends an agent's "Nothing queued" as if it were a next step.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* test: pin the rebuilt pages' names and rows
Project names now read as words in the night note and the Sessions drawer,
the ListRow link carries its own props, and the trailing-column check reads
the rule itself rather than a scoped override.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
---------
Co-authored-by: Claude <noreply@anthropic.com>
213 lines
8.0 KiB
JavaScript
213 lines
8.0 KiB
JavaScript
/**
|
|
* Walk Loki's pages the way a person on a phone does, and write down what is
|
|
* visibly wrong — design-reset-2026-10.md, "How a page is checked".
|
|
*
|
|
* node scripts/audit-pages.mjs <outDir>
|
|
* BASE=http://localhost:3000 (default: production)
|
|
* ROUTES=/control,/projects (default: every app page)
|
|
* AUDIT_EMAIL / AUDIT_PASSWORD (default: the public demo)
|
|
* THEME=light|dark (default: light — the owner's)
|
|
*
|
|
* The demo has three tidy projects, so long lists, failures and stale alerts
|
|
* never show on it. To see the pages the way the owner does, seed the local
|
|
* showcase account (`pnpm run seed:showcase`, local databases only) and pass
|
|
* its pair:
|
|
*
|
|
* AUDIT_EMAIL=owner@loki.local AUDIT_PASSWORD=showcase-owner \
|
|
* BASE=http://localhost:3000 node scripts/audit-pages.mjs .tmp/audit
|
|
*
|
|
* Writes phone-<page>.png (first screen), phone-<page>-full.png, desk-<page>.png
|
|
* and report.json: overflow, <h1> count, sticky/fixed blocks, text cut off,
|
|
* small tap targets, console errors and failed requests per page.
|
|
*/
|
|
import { chromium } from "playwright";
|
|
import fs from "node:fs";
|
|
const BASE = process.env.BASE ?? "https://loki.orangecat.ch";
|
|
const OUT = process.argv[2];
|
|
fs.mkdirSync(OUT, { recursive: true });
|
|
const ROUTES = (
|
|
process.env.ROUTES ??
|
|
"/control,/projects,/loki,/terminal,/prompts,/voice,/today,/suggestions,/approvals,/feedback,/my-feedback,/packages,/fleet,/system,/activity,/people,/crew,/money,/goals,/habits,/events,/memory,/thoughts,/settings,/robots,/download,/roadmap,/why,/whitepaper,/investors"
|
|
).split(",");
|
|
const exe =
|
|
process.env.CHROMIUM_PATH ??
|
|
(fs.existsSync("/opt/pw-browsers/chromium-1248/chrome-linux64/chrome")
|
|
? "/opt/pw-browsers/chromium-1248/chrome-linux64/chrome"
|
|
: undefined);
|
|
const browser = await chromium.launch(exe ? { executablePath: exe } : {});
|
|
const THEME = process.env.THEME ?? "light";
|
|
|
|
async function login(ctx) {
|
|
const r = await ctx.request.get(BASE + "/api/auth/csrf");
|
|
const { csrfToken } = await r.json();
|
|
const res = await ctx.request.post(BASE + "/api/auth/callback/email-password", {
|
|
form: {
|
|
csrfToken,
|
|
email: process.env.AUDIT_EMAIL ?? "demo@loki.app",
|
|
password: process.env.AUDIT_PASSWORD ?? "explore-the-fleet",
|
|
callbackUrl: BASE + "/control",
|
|
json: "true",
|
|
},
|
|
maxRedirects: 0,
|
|
});
|
|
const cookies = await ctx.cookies();
|
|
if (!cookies.some((c) => /session-token/.test(c.name)))
|
|
throw new Error("login failed " + res.status());
|
|
}
|
|
|
|
async function measure(page) {
|
|
return page.evaluate(() => {
|
|
const vw = innerWidth,
|
|
vh = innerHeight;
|
|
const out = {
|
|
overflowX: document.documentElement.scrollWidth > vw + 1,
|
|
h1: document.querySelectorAll("h1").length,
|
|
h1Text: [...document.querySelectorAll("h1")].map((h) => h.textContent.trim().slice(0, 60)),
|
|
};
|
|
let truncated = [],
|
|
small = [],
|
|
fixedArea = 0,
|
|
fixed = [];
|
|
for (const el of document.querySelectorAll("body *")) {
|
|
const cs = getComputedStyle(el);
|
|
if (cs.display === "none" || cs.visibility === "hidden") continue;
|
|
const r = el.getBoundingClientRect();
|
|
if (r.width === 0 || r.height === 0) continue;
|
|
if (
|
|
(cs.position === "fixed" || cs.position === "sticky") &&
|
|
r.top < vh &&
|
|
r.bottom > 0 &&
|
|
r.width > vw * 0.5
|
|
) {
|
|
fixed.push({
|
|
tag: el.tagName,
|
|
cls: el.className?.toString().slice(0, 60),
|
|
h: Math.round(r.height),
|
|
top: Math.round(r.top),
|
|
});
|
|
}
|
|
if (
|
|
el.children.length === 0 &&
|
|
el.textContent.trim() &&
|
|
el.scrollWidth > el.clientWidth + 1 &&
|
|
(cs.textOverflow === "ellipsis" || cs.webkitLineClamp !== "none")
|
|
)
|
|
truncated.push(el.textContent.trim().slice(0, 70));
|
|
if (
|
|
(el.tagName === "BUTTON" || el.tagName === "A" || el.getAttribute("role") === "button") &&
|
|
r.top < vh * 3 &&
|
|
(r.height < 32 || r.width < 32) &&
|
|
el.textContent.trim().length < 30
|
|
)
|
|
small.push(
|
|
(el.textContent.trim() || el.getAttribute("aria-label") || el.tagName).slice(0, 30) +
|
|
` ${Math.round(r.width)}x${Math.round(r.height)}`,
|
|
);
|
|
}
|
|
out.fixed = fixed;
|
|
out.truncated = [...new Set(truncated)].slice(0, 25);
|
|
out.smallTargets = [...new Set(small)].slice(0, 20);
|
|
out.textLen = document.body.innerText.length;
|
|
return out;
|
|
});
|
|
}
|
|
|
|
const report = {};
|
|
for (const [label, vp] of [
|
|
["phone", { width: 390, height: 844, isMobile: true, hasTouch: true, deviceScaleFactor: 2 }],
|
|
["desk", { width: 1440, height: 900 }],
|
|
]) {
|
|
const ctx = await browser.newContext({
|
|
viewport: { width: vp.width, height: vp.height },
|
|
isMobile: vp.isMobile ?? false,
|
|
hasTouch: vp.hasTouch ?? false,
|
|
deviceScaleFactor: vp.deviceScaleFactor ?? 1,
|
|
});
|
|
await login(ctx);
|
|
await ctx.addInitScript((t) => {
|
|
try {
|
|
localStorage.setItem("loki-theme", t);
|
|
} catch {}
|
|
}, THEME);
|
|
const extra = [];
|
|
for (let i = 0; i < ROUTES.length + extra.length; i++) {
|
|
const route = i < ROUTES.length ? ROUTES[i] : extra[i - ROUTES.length];
|
|
// A page of its own per route: a tall page can crash Chromium's renderer,
|
|
// and a crashed page must not take every route after it down too.
|
|
const page = await ctx.newPage();
|
|
try {
|
|
const errs = [],
|
|
bad = [];
|
|
page.removeAllListeners("console");
|
|
page.removeAllListeners("response");
|
|
page.on("console", (m) => m.type() === "error" && errs.push(m.text().slice(0, 200)));
|
|
page.on(
|
|
"response",
|
|
(r) =>
|
|
r.status() >= 400 &&
|
|
bad.push(
|
|
`${r.status()} ${r.request().method()} ${r.url().replace(BASE, "").slice(0, 100)}`,
|
|
),
|
|
);
|
|
try {
|
|
await page.goto(BASE + route, { waitUntil: "networkidle", timeout: 30000 });
|
|
} catch (e) {
|
|
errs.push("goto: " + e.message.slice(0, 120));
|
|
}
|
|
await page.waitForTimeout(2500);
|
|
const name = route.replace(/\W+/g, "_").replace(/^_/, "") || "root";
|
|
await page
|
|
.screenshot({ path: `${OUT}/${label}-${name}.png` })
|
|
.catch((e) => errs.push("screenshot: " + e.message.slice(0, 80)));
|
|
if (label === "phone")
|
|
await page
|
|
.screenshot({ path: `${OUT}/${label}-${name}-full.png`, fullPage: true })
|
|
.catch(() => undefined);
|
|
// A dev server recompiles and reloads a page it just served; measure
|
|
// once it has settled rather than losing the whole report to one reload.
|
|
let m;
|
|
for (let attempt = 0; attempt < 3 && !m; attempt++) {
|
|
m = await measure(page).catch(async () => {
|
|
await page.waitForLoadState("networkidle").catch(() => undefined);
|
|
await page.waitForTimeout(1500);
|
|
return undefined;
|
|
});
|
|
}
|
|
m ??= { error: "page kept reloading" };
|
|
report[`${label} ${route}`] = {
|
|
finalUrl: page.url().replace(BASE, ""),
|
|
consoleErrors: [...new Set(errs)].slice(0, 8),
|
|
failedRequests: [...new Set(bad)].slice(0, 12),
|
|
...m,
|
|
};
|
|
if (label === "phone" && route === "/projects" && !process.env.ROUTES) {
|
|
const href = await page
|
|
.locator('a[href^="/projects/"]')
|
|
.first()
|
|
.getAttribute("href")
|
|
.catch(() => null);
|
|
if (href) {
|
|
extra.push(href, href + "/watch");
|
|
}
|
|
}
|
|
if (label === "phone" && route === "/feedback" && !process.env.ROUTES) {
|
|
const href = await page
|
|
.locator('a[href^="/feedback/"]')
|
|
.first()
|
|
.getAttribute("href")
|
|
.catch(() => null);
|
|
if (href) extra.push(href);
|
|
}
|
|
} catch (e) {
|
|
report[`${label} ${route}`] = { error: String(e.message ?? e).slice(0, 160) };
|
|
} finally {
|
|
await page.close().catch(() => undefined);
|
|
}
|
|
}
|
|
if (label === "phone") ROUTES.push(...extra.filter((r) => !ROUTES.includes(r)));
|
|
await ctx.close();
|
|
}
|
|
fs.writeFileSync(`${OUT}/report.json`, JSON.stringify(report, null, 1));
|
|
await browser.close();
|
|
console.log("done", Object.keys(report).length);
|