diff --git a/apps/p2/docs/tree.md b/apps/p2/docs/tree.md index df965bfd2..0a557957d 100644 --- a/apps/p2/docs/tree.md +++ b/apps/p2/docs/tree.md @@ -115,7 +115,9 @@ node: - Web: "Edit" beside the owner's view of a user message (on hover; always shown on touch screens) and "Branch from here" under an answer, in the main conversation. Under the session in the sidebar, from two branches on, one row per branch (`Sessions` rows' `branches`: the stored labels, null for the session title, newest first in a stable order, - the current one marked in place); choosing one switches the session to its end (`SessionTree.select`). The worker + the current one marked in place), behind the session row's expand control, which also shows its subagents + (collapsed by default, expanded while a subagent is shown); choosing one switches the session to its end + (`SessionTree.select`). The worker reports `p2.main` (`treeSelf`: `main` and the branches with their labels) at start and whenever a commit changes it. - Search indexes each branch's own entries (after its fork point). diff --git a/apps/p2/src/web/Drawer.tsx b/apps/p2/src/web/Drawer.tsx index d2aba978f..af88549b2 100644 --- a/apps/p2/src/web/Drawer.tsx +++ b/apps/p2/src/web/Drawer.tsx @@ -71,8 +71,8 @@ function ThemeButton() { } /** - * A session's `/tree` branches (docs/tree.md), from two on, newest first in a stable order: switching only moves the - * "current" mark. Choosing another branch switches the session to it (`onBranch`, the owner's); the pencil beside a + * A session's `/tree` branches (docs/tree.md), newest first in a stable order: switching only moves the "current" mark. + * Shown from two branches on, behind the session row's expand control (`hidden` while collapsed). Choosing another branch switches the session to it (`onBranch`, the owner's); the pencil beside a * row renames it (`onRenameBranch`). A branch without a label (conversation 1's default) shows the session title. */ function BranchRows({ @@ -82,6 +82,7 @@ function BranchRows({ onOpen, onBranch, onRenameBranch, + hidden, }: { session: SessionSummary; conversationId: number; @@ -89,10 +90,10 @@ function BranchRows({ onOpen: (id: string, conversationId?: number) => void; onBranch: (id: string, conversationId: number) => void; onRenameBranch?: (id: string, conversationId: number) => void; + hidden: boolean; }) { - if (session.branches.length < 2) return null; return ( -
+ - {onBranch && !archived && ( + {branches && (