mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-05 00:08:44 +01:00
From the owner's phone on /loki (2026-10-09): "Continue in Loki" from the
widget pasted the whole site conversation into the composer as raw "Me: … /
Loki: …" text, the model chip read "A…" and the project "kes…", a white
Talk pill outshone the send arrow beside it, and an unexplained dot sat in
the row.
- Site hand-off (lib/loki/site-handoff.ts, use-site-handoff.ts,
SiteHandoffCard): ?q= in the widget's format is parsed into turns and
shown where a thread would be — your words a pill, Loki's prose, a
remark with its rule — above an EMPTY composer ("What should Loki do
with this?"). "Take it from here" sends it on in one tap; whatever is
typed is sent with the conversation attached once as a text file.
The chats list steps aside while it is shown.
- One primary control: with an empty box, Talk takes the send slot (the
same filled circle, a waveform) and the dead send arrow hides; typing
brings Send back.
- The builder-honesty chip became a dot on the project pill (its words in
the title); the pill's × is desktop-only (change scope by tapping it).
The model chip has room to say "Auto".
- A thread opened by its link (?c=, Back) keeps its project — it read
"No project — answers only" unless tapped in the list
(initialLokiSelection).
- Tests: loki-site-handoff (agrees with widget/continue.ts byte for
byte), loki-thread-scope. Seen on a local stack at 390×844.
Claude-Session: https://claude.ai/code/session_011L2dmcydDLYAiNQwK4XcF4
Co-authored-by: Claude <noreply@anthropic.com>
24 lines
936 B
TypeScript
24 lines
936 B
TypeScript
/**
|
|
* A thread opened by its link keeps its project scope — it used to read
|
|
* "No project — answers only" unless it was tapped in the list.
|
|
*
|
|
* Run: npx tsx scripts/test/loki-thread-scope.ts
|
|
*/
|
|
import assert from "node:assert/strict";
|
|
import { initialLokiSelection } from "../../src/lib/loki/project-selection";
|
|
import type { LokiProject } from "../../src/components/loki/types";
|
|
|
|
const projects = [{ name: "kestrel" }, { name: "ledgerpost" }] as LokiProject[];
|
|
assert.deepEqual(initialLokiSelection(projects, "Kestrel", null), ["kestrel"], "?project= wins");
|
|
assert.deepEqual(
|
|
initialLokiSelection(projects, null, { projectKeys: ["kestrel", "gone"] }),
|
|
["kestrel"],
|
|
"the open thread's projects, the ones that still exist",
|
|
);
|
|
assert.deepEqual(
|
|
initialLokiSelection(projects, null, null),
|
|
[],
|
|
"a fresh /loki stays the start page",
|
|
);
|
|
console.log("✓ loki thread scope: a thread opened by link keeps its project");
|