diff --git a/components/chat.tsx b/components/chat.tsx
index 0c8d9a5..0dcd3b4 100644
--- a/components/chat.tsx
+++ b/components/chat.tsx
@@ -210,7 +210,10 @@ export function Chat({
dock stays sticky inside the scroller, untouched. */}
-
+ {/* h-10, not py-2: the toggle (a size-9 icon button) renders only
+ while the sidebar is CLOSED — an auto-height row would collapse
+ when it disappears and slide the title + chip up. */}
+
{title}
diff --git a/components/tree-panel.tsx b/components/tree-panel.tsx
index 4e24dab..7f50d10 100644
--- a/components/tree-panel.tsx
+++ b/components/tree-panel.tsx
@@ -41,6 +41,14 @@ import { planNodeStatus, type PlanNode, type PlanNodeStatus, type PlanTree } fro
/** localStorage: the mode persists as "lh:tree-panel-mode"
* ("rail" | "list" | "graph"); the pre-graph key
* ("lh:tree-panel-collapsed": "1" rail / "0" list) is the fallback. */
+/** The panel width per mode — the aside AND its fixed inner layer (see
+ * TreePanel: the inner layer must not squish while the aside animates). */
+const PANEL_WIDTH: Record = {
+ rail: "w-10",
+ list: "w-64",
+ graph: "w-96",
+};
+
const MODE_KEY = "lh:tree-panel-mode";
const LEGACY_KEY = "lh:tree-panel-collapsed";
@@ -198,19 +206,35 @@ export function TreePanel({
// the moment plan_init's output lands and updates live from there.
if (!tree || tree.nodes.length === 0) return null;
- if (mode === "rail") {
- return (
- go("list")}
- />
- );
- }
- if (mode === "graph") {
- return go("list")} onCollapse={() => go("rail")} />;
- }
- return go("graph")} onCollapse={() => go("rail")} />;
+ // ONE animated container, exactly like the left sidebar: the aside
+ // animates its width (sidebar-motion transition cascades from the
+ // provider and is mount-gated there) while the inner layer keeps a
+ // FIXED width and is clipped by overflow-hidden — content never
+ // reflows mid-transition, so no scrollbar flash or overshoot. The
+ // mode's content just swaps instantly inside the steady frame.
+ return (
+
+ );
}
/** The collapsed panel: a thin strip with the map icon + quiet progress. */
@@ -224,9 +248,9 @@ export function TreePanelRail({
onExpand: () => void;
}) {
return (
-
+