mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 05:57:09 +01:00
* feat(feedback): one integrated inbox instead of stacked widgets /feedback on a phone read as "a bunch of random elements": a lone bordered Studio requests button, two rows of pills, a line restating the chip just tapped, three bordered cards with grey headers, and rows whose status, context and buttons sat in different places and came in three heights and two fills. - Lens: Needs you · Under way · Shipped as one segmented control with counts. One list shows at a time; it opens on the first lens that holds something. An empty lens links to the lens that has work, never a dead end. - Filters: one line. Project chips scroll; source is a compact select; the loop's numbers and the Studio requests link share the line under the chips. - Rows: same anatomy for every phase. Context (status · project · page · who · age), message, one "why" line, then an action bar of one height: the labelled decision leads, icon utilities (note, resolve, archive) sit at the trailing edge. Under-way Resolve becomes an icon; "What changed" becomes a link on the agent's line. The "Watching this run" strip is gone, because the Watch panel already holds Terminal and Chat. - Dead .ui-inbox-fold rules removed; the fold now uses .ui-fb-fold. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TDTqcifctAar8o5hcbD3pE * fix(terminal): the Claude conversation finds its log; a calmer phone chat The /terminal conversation view sat on "No conversation from this session yet" for sessions that were plainly running. - Runner (0.8.38): claudeProjectSlug now matches Claude Code — every non-alphanumeric becomes "-", not just "/" and ".". Workspace and worktree names may contain "_", and for those the transcript stream, the usage collector and the auth canary all looked in a folder that never exists. Slugs past 200 chars (Claude truncates and hashes them) match on prefix. - Runner: when it has the session but Claude has written no log, it says so once (an empty frame). The view tells apart "builder never answered", "Claude hasn't started here" and "nothing said yet", each with its own next step; the composer stays live in all of them. - Answers in the Claude conversation get the same row as Loki's chat: Copy, Listen and — where the phone has a share sheet — Share (AnswerActions, shared with MessageTurn). - Phone chrome: the Profile/Chat/Control/Terminal strip and its repeated project name are hidden on /terminal below md (the one-line header names the session); the agent chip drops in conversation view so the session name is readable; the Loki button says "Loki", not a second "Chat". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TDTqcifctAar8o5hcbD3pE * feat(loki): suggested follow-ups and a hands-free voice conversation Two things the reference chat apps have and Loki's chat did not. - Suggested follow-ups: after an ordinary answer that ends the thread, up to three "↳ Make it longer" rows; a tap sends one as the next message. POST /api/loki/follow-ups asks the fast model once (feature "chat-follow-ups"); a slow or failed model answers [] and nothing shows. lib/loki/follow-ups.ts parses whatever comes back (numbering, bullets, quotes, a JSON array, a preamble) into clean tap targets — tested. - Talk: a filled pill beside the composer's controls (only while the box is empty — the mic beside send still dictates). It opens a full-screen voice chat: listen until you pause, send what you said through the normal send path, read the answer aloud, listen again. The mic is closed while the answer is read, so the phone never answers itself; a failed turn goes back to listening rather than to silence; 20s of quiet pauses it. Endpointing (lib/loki/voice-turn.ts) works on waveform RMS against an adaptive noise floor and ends a turn only on a pause AFTER speech — tested. Transcription is the composer's own server leg (/api/control/transcribe). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TDTqcifctAar8o5hcbD3pE * fix(loki): voice chat passes lint — no setState in an effect body, workspace under its line cap The answer that arrives during a voice turn is read aloud from a deferred callback rather than the effect body (react-hooks/set-state-in-effect), and the voice screen takes the hook's state whole, so LokiWorkspace drops back under its 510-line max-lines-per-function ratchet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TDTqcifctAar8o5hcbD3pE * fix(loki): answer first, never a wall of projects; thumbs-down files feedback From the owner's phone: "This all is making it unworkable. Flow should be easy and enjoyable." A plain message ("let's keep improving this interface") came back as "Which project should I run that on?" over seventeen two-column project tiles, and the thread title ran across the back arrow. - Loki always answers. When the message also reads like work, the answer carries one closed line under it — "Run this on a project…" (or "No project called X — run this on another…") — which opens the picker only when tapped. The blocking needs-project turn is gone; older threads that contain one still render it. - The picker is small wrapping chips, not 44px tiles in a grid. - Thread header: the title truncates instead of overflowing both edges (a centred flex child is as wide as its text, so `truncate` never engaged). - Thumbs-down under Loki's answers: one optional line on what was wrong, then Send. POST /api/loki/answer-feedback files it into Loki's own project (FEEDBACK_WIDGET_TOKEN, where the dogfood widget files), with the question and answer attached so it reads on its own in /feedback, and the reporter recorded so it shows in their /my-feedback. Not on the Claude Code conversation, which is not Loki's answer. Says plainly when the token is not provisioned. Report text: lib/loki/answer-report.ts, tested. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TDTqcifctAar8o5hcbD3pE * fix(feedback): scale widths, not arbitrary ones, in the row context line max-w-48 / max-w-40 are the same 12rem / 10rem on Tailwind's scale; the arbitrary values raised design-principles' one-off-layout ratchet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TDTqcifctAar8o5hcbD3pE * fix(loki): answer report takes optional note/question, as the route sends them Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TDTqcifctAar8o5hcbD3pE --------- Co-authored-by: Claude <noreply@anthropic.com>
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
// A thumbs-down becomes a feedback report that stands on its own and always
|
|
// fits the ingest's 2000-character suggestion cap.
|
|
import assert from "node:assert/strict";
|
|
import { ANSWER_REPORT_MAX_CHARS, buildAnswerReport } from "@/lib/loki/answer-report";
|
|
|
|
let n = 0;
|
|
const check = (fn: () => void) => {
|
|
fn();
|
|
n++;
|
|
};
|
|
|
|
check(() => {
|
|
const r = buildAnswerReport({
|
|
note: "It invented a meeting",
|
|
question: "What's tomorrow?",
|
|
answer: "A 9am standup.",
|
|
});
|
|
assert.ok(r.startsWith("Bad answer in Loki chat: It invented a meeting"));
|
|
assert.ok(r.includes("Question:\nWhat's tomorrow?"));
|
|
assert.ok(r.endsWith("Answer:\nA 9am standup."));
|
|
});
|
|
check(() => {
|
|
const r = buildAnswerReport({ note: " ", question: null, answer: "x" });
|
|
assert.ok(r.startsWith("Bad answer in Loki chat (no reason given)."));
|
|
assert.ok(!r.includes("Question:"));
|
|
});
|
|
check(() => {
|
|
const r = buildAnswerReport({
|
|
note: "n".repeat(5000),
|
|
question: "q".repeat(5000),
|
|
answer: "a".repeat(9000),
|
|
});
|
|
assert.ok(r.length <= ANSWER_REPORT_MAX_CHARS, `length ${r.length}`);
|
|
assert.ok(r.includes("Answer:\naaa"));
|
|
});
|
|
|
|
console.log(`${n}/3 loki-answer-report cases passed`);
|