The sidebar rendered whatever order the plugin payload happened to carry (disk mtime desc, then Lua hash order). It now mirrors pi2.nvim: - roots ranked by the tab's visual position (`tabRank`, falling back to the `tab` handle), a lineage occupying the earliest tab it occupies; - siblings (real sub-session rows and manifest subagents merged into one list) by `createdAt` desc with the id as tie-break, a session row inheriting its manifest entry's `createdAt`, matching `manifest.lua`; - deterministic code-unit comparisons plus a root tie-break chain, so WS arrivals and payload order can no longer shuffle rows. `session-order.ts` is the single owner of the rule; the tree model renders it and the /chat index default is the sidebar's top root.
pi2-web
React port of the pi2 web UI prototype, built into web/dist and served statically by pi2 daemon.
Development
# Start dev server with proxy to daemon (:7676)
pnpm --dir web dev
# Typecheck
pnpm --dir web typecheck
# Run test suite
pnpm --dir web exec vitest run
# Run only changed tests or specific file
pnpm --dir web exec vitest run --changed
pnpm --dir web exec vitest run tests/chat.composer.test.tsx
# Watch mode
pnpm --dir web test
For performance tuning, concurrency settings, and DOM environment details, see docs/testing.md.