feat(workspaces): title recent-activity rows from a bounded preview

The activity column's disk-only rows had no title: the recent feed carried file
metadata only, so every session outside a live instance rendered "(unnamed)".

recentSessions() now projects a display title for the rows it returns — the
latest `session_info` name and the first user message — from a 128 KiB head +
32 KiB tail of each session file, cached by (mtime, size). Entries are never
parsed into session state: the read is bounded, opt-in, and only paid for the
≤limit rows the caller renders, so the daemon stays a router.

The web client keeps the disk title as a fallback under the live state, and the
B4 e2e scenario asserts session-first rows with their links and titles.
This commit is contained in:
yuez committed 2026-10-30 15:15:09 +08:00
1 parent 086cac8c8e
commit 17fcf931c0
11 files changed
+431 -30

No files matched your search

+3
View File
@@ -156,6 +156,9 @@ describe("workspace store", () => {
timestamp: Date.parse("2026-10-13T06:40:33.032Z"),
modified: Date.parse("2026-10-13T06:40:33.032Z"),
sessionFile: expect.stringContaining("g1"),
// The helper writes a user message "hi": the disk preview labels
// the row that has no live instance.
firstMessage: "hi",
});
// The default (no limit) still returns every discovered session, and an
// out-of-range limit is clamped instead of exploding the header scan.