mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 10:48:20 +01:00
Expand/collapse on phones gives xterm usable height; Loki dispatches route "let's develop" through next_best and link to watch the agent. Profile drawer follows action-first hierarchy with filtered activity noise. Co-authored-by: Cursor <cursoragent@cursor.com>
37 lines
1.5 KiB
TypeScript
37 lines
1.5 KiB
TypeScript
import assert from "node:assert/strict";
|
|
import { sanitizeActivityPreview, isNoisyProfileActivity } from "../../src/lib/activity-display";
|
|
import {
|
|
mergeDuplicateProjectRows,
|
|
} from "../../src/lib/domain/project-canonical";
|
|
import { shortProjectStatus } from "../../src/lib/projects-display";
|
|
import type { ProjectGridRow } from "../../src/components/projects/ProjectGridCard";
|
|
|
|
function row(partial: Partial<ProjectGridRow> & Pick<ProjectGridRow, "id" | "name">): ProjectGridRow {
|
|
return {
|
|
description: null,
|
|
attrs: {},
|
|
...partial,
|
|
};
|
|
}
|
|
|
|
assert.equal(sanitizeActivityPreview("gh secret set MY_KEY some-value"), "[redacted]");
|
|
assert.equal(sanitizeActivityPreview("hello world"), "hello world");
|
|
const long = `Status update: ${"still shipping. ".repeat(12)}`;
|
|
assert.ok(sanitizeActivityPreview(long).endsWith("…"));
|
|
|
|
assert.equal(shortProjectStatus("Production"), "Production");
|
|
assert.equal(shortProjectStatus("Strategic planning only - no code, nothing else"), null);
|
|
assert.equal(shortProjectStatus("Active development — shipping v2"), "Active development");
|
|
|
|
assert.equal(isNoisyProfileActivity("custom", "AUTOPILOT BATCH — do NOT idle"), true);
|
|
assert.equal(isNoisyProfileActivity("dispatch", "Ship the fix"), false);
|
|
|
|
const merged = mergeDuplicateProjectRows([
|
|
row({ id: "1", name: "botsmann", attrs: {} }),
|
|
row({ id: "2", name: "Botsmann", description: "Fleet ops", gitUrl: "https://github.com/x/y" }),
|
|
]);
|
|
assert.equal(merged.length, 1);
|
|
assert.equal(merged[0]!.id, "2");
|
|
|
|
console.log("✓ projects-display tests passed");
|