feat: integrate Pi backend and Pi Web

This commit is contained in:
luckyyzh
2026-07-30 19:37:53 +08:00
commit 7392ab9dd7
1390 changed files with 337197 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
import assert from "node:assert/strict";
import { readFile } from "node:fs/promises";
import test from "node:test";
const source = await readFile(new URL("./SessionSidebar.tsx", import.meta.url), "utf8");
const sessionItemSource = source.slice(source.indexOf("function SessionItem("));
test("only Shift+click bypasses session deletion confirmation", () => {
assert.match(
sessionItemSource,
/const handleDeleteClick[\s\S]*?if \(e\.shiftKey\) \{\s*void performDelete\(\);\s*\} else \{\s*setConfirmDelete\(true\);/,
);
});
test("does not register row-level session deletion shortcuts", () => {
assert.doesNotMatch(sessionItemSource, /const handleKeyDown/);
assert.doesNotMatch(sessionItemSource, /onKeyDown=\{handleKeyDown\}/);
assert.doesNotMatch(sessionItemSource, /tabIndex=\{0\}/);
});