Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

### Fixed

- Keep indexing visible while an existing workspace republishes its index. Overview tables now keep readable columns, Members spans the page, and crowded maps stay compact. Cards have space below the view tabs, and graph nodes are easier to hover and select.

- Windows harness shutdown accepts an already-reaped child while retaining errors for a child that has not exited.
- Compounding reports early subprocess rejections instead of crashing with a broken-pipe error.
- `rzm init` preserves custom and edited command files, and previews and reports removal of unmodified generated commands.
Expand Down
2 changes: 1 addition & 1 deletion DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ The canvas uses neutral grid depth, typed cards, type-palette relation lines, an

### Graphs and Maps

Every graph surface (the overview maps, the Atlas, and Explorer) follows the same rules. Essential edges and outlines use `--type-8` or `--link`, which clear 3:1 in both appearances. Labels sit on their own layer above nodes and edges with a 4px surface-coloured halo, placed clear of other nodes and labels, and nodes keep 24px inside the plot. Overview maps cap at 280px so the Members table stays in view, give each member type its own hue (matching the Members dots), put edge counts where no other edge crosses, and state the expand hint once. Explorer opens at folder level (folders sized by what they hold and coloured by their most common type; very large folders open into subfolders and small ones fold into one node under their parent). Its root graph follows folder containment from the vault at the centre; cross-folder links appear on hover with counts and never drive layout. Selecting a folder focuses the graph and sidebar without opening a right panel; files keep their detail panel and use the sidebar’s current outline file icons. Explorer drops node radii to 2–3px with the hovered neighbourhood emphasised, shows edge labels only on hover or match, keeps its grouped legend (Notes by type, Code, Folders) and banner outside the canvas, and shows a loading state until the first draw; a drawn graph sets `data-graph-ready="true"` on its container (also when there is nothing to draw), which the screenshot tooling waits on.
Every graph surface (the overview maps, the Atlas, and Explorer) follows the same rules. Essential edges and outlines use `--type-8` or `--link`, which clear 3:1 in both appearances. Labels sit on their own layer above nodes and edges with a 4px surface-coloured halo, placed clear of other nodes and labels, and nodes keep 24px inside the plot. Overview maps are 260px tall and grow by at most 120px for labels, so the Members table stays in view, give each member type its own hue (matching the Members dots), put edge counts where no other edge crosses, and state the expand hint once. Explorer opens at folder level (folders sized by what they hold and coloured by their most common type; very large folders open into subfolders and small ones fold into one node under their parent). Its root graph follows folder containment from the vault at the centre; cross-folder links appear on hover with counts and never drive layout. Selecting a folder focuses the graph and sidebar without opening a right panel; files keep their detail panel and use the sidebar’s current outline file icons. Explorer drops node radii to 2–3px with the hovered neighbourhood emphasised, shows edge labels only on hover or match, keeps its grouped legend (Notes by type, Code, Folders) and banner outside the canvas, and shows a loading state until the first draw; a drawn graph sets `data-graph-ready="true"` on its container (also when there is nothing to draw), which the screenshot tooling waits on.

### Custom Views

Expand Down
4 changes: 2 additions & 2 deletions docs/specs/experience/scope-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ type: ExperienceSpec
id: SPEC-0117
summary: "One Overview view shows the shape of All notes and of every display group: a type-level link map, a member table, and scope-only blocks. Briefing shows activity at every level, All notes gains one, and every block loads on its own so switching scopes never freezes the workspace."
spec-status: active
last-updated: 2026-11-04
last-updated: 2026-11-06
last-verified: 2026-11-04 # Round 7
aliases:
- SPEC-0117
Expand Down Expand Up @@ -161,7 +161,7 @@ This spec revises [[group-views-and-view-platform|SPEC-0111]], whose Briefing lo
- MUST remember the map/matrix toggle per scope and the expanded groups at All notes through the kit's view preferences ([[view-preferences|SPEC-0114]]).
- MUST add a kit host action, `openSearch({ folder })`, that opens a project search tab with the existing folder filter, for US4's folder action. The rail's note-list filter stays private to the rail.
- MUST give map nodes keyboard focus in descending record-count order, activation with Enter or Space, and accessible names, and keep the Matrix a complete text alternative.
- MUST use the kit's theme tokens and stay dense: hairline dividers, Inter numbers with tabular figures, no cards inside cards. Descriptive section help belongs in the heading's title and accessible description; only computed judgements such as "Review suggested" keep an info icon. Briefing and Overview share their centred column with the header and presentation tabs (about 1320px and 1520px respectively). Overview places Members below the compact map (capped at 280px), uses solid relation links and dashed plain links, and legends only the link kinds drawn. Unused declared relations retain their separate dashed hairline treatment. The page MUST fit without horizontal scrolling at 1280px with the rail open, and the member table SHOULD begin above the fold at 1440 by 1000.
- MUST use the kit's theme tokens and stay dense: hairline dividers, Inter numbers with tabular figures, no cards inside cards. Descriptive section help belongs in the heading's title and accessible description; only computed judgements such as "Review suggested" keep an info icon. Briefing and Overview share their centred column with the header and presentation tabs (about 1320px and 1520px respectively). Overview places Members across the full width below the compact map (260px tall, growing by at most 120px when a crowded map needs room for labels), uses solid relation links and dashed plain links, and legends only the link kinds drawn. Unused declared relations retain their separate dashed hairline treatment. The page MUST fit without horizontal scrolling at 1280px with the rail open, and the member table SHOULD begin above the fold at 1440 by 1000.
- SHOULD reuse the Briefing building blocks, including the existing "Outside the group" list and the views-and-guide block, instead of duplicating them.
- SHOULD keep Overview's modules under about 500 lines each, like the other group views.

Expand Down
8 changes: 1 addition & 7 deletions web/bundled-views/group/group.css
Original file line number Diff line number Diff line change
Expand Up @@ -1495,12 +1495,6 @@
padding: 0 20px;
}

/* All notes: Members sit under the map in the main column. */
.gv-ov--workspace .gv-ov-main .gv-ov-members {
margin: 4px -20px -16px;
border-top: 1px solid var(--border);
}

@media (min-width: 960px) {
.gv-ov {
grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr);
Expand All @@ -1512,7 +1506,7 @@
}
}

/* The map. Its canvas takes the block's width and a 280px height, so labels draw
/* The map. Its canvas takes the block's width and a 260-380px height, so labels draw
at their real size and the Members table starts above the fold. Edges and node
outlines clear 3:1 against the surface in both themes. */
.gv-map-canvas {
Expand Down
19 changes: 14 additions & 5 deletions web/bundled-views/group/map-layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,16 +455,25 @@ function layoutAtSize(input: LayoutInput): MapLayout {
};
}

/** Add room for crowded expansions rather than silently dropping their labels. */
/**
* The most a crowded map grows to fit its labels. Every pass re-spreads the
* drawing over the taller box, so more height rarely fits more labels and
* instead strands weakly linked members far from the rest.
*/
const MAX_GROWTH = 120;

/** Add some room for crowded expansions, keeping the shortest box that labels the most members. */
export function layoutMap(input: LayoutInput): MapLayout {
let result = layoutAtSize(input);

for (
let attempt = 1;
result.labels.size < result.positions.size && attempt <= result.positions.size;
attempt++
let extra = 60;
result.labels.size < result.positions.size && extra <= MAX_GROWTH;
extra += 60
) {
result = layoutAtSize({ ...input, height: input.height + attempt * 60 });
const taller = layoutAtSize({ ...input, height: input.height + extra });

if (taller.labels.size > result.labels.size) result = taller;
}

return result;
Expand Down
29 changes: 29 additions & 0 deletions web/bundled-views/group/members.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,3 +497,32 @@ it("fits a label wider than the canvas without adding height", () => {
expect(layout.labels.has("wide")).toBe(true);
expect(layout.height).toBe(260);
});

it("keeps a crowded map near its height when its labels cannot all fit", () => {
// Shaped like a large vault: a dense, fully linked core and one member with a single link.
const core = Array.from({ length: 11 }, (_, index) => ({
id: `T${index}`,
radius: index ? 6 + index : 30,
label: `Member type ${index}\n${(index + 1) * 37} notes`,
}));

const edges = core.flatMap((a, i) =>
core.slice(i + 1).map((b, j) => ({
a: a.id,
b: b.id,
links: (i + j) * 13 + 1,
label: { key: `${a.id}|${b.id}`, text: String((i + j) * 13 + 1) },
})),
);

const input: LayoutInput = {
width: 560,
height: 260,
nodes: [...core, { id: "Leaf", radius: 5, label: "Coaching\n1 note" }],
edges: [...edges, { a: "T0", b: "Leaf", links: 1, label: { key: "T0|Leaf", text: "1" } }],
outside: [],
};

// Growing to fit every label would make this map over 2,000px tall.
expect(layoutMap(input).height).toBeLessThanOrEqual(input.height + 120);
});
23 changes: 18 additions & 5 deletions web/bundled-views/group/overview-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,15 @@
.gv-ov-side > .rz-section {
margin-top: 0;
}
.gv-ov-members {
/* A scroller must also be the containing block of the hidden .sr-only text in
its cells, or that text escapes the clip and widens the whole page. */
.gv-ov-members,
.gv-mx-wrap {
position: relative;
overflow-x: auto;
}

.gv-ov--group > .gv-ov-members,
.gv-ov > .gv-ov-members,
.gv-ov-below {
grid-column: 1 / -1;
border-top: 1px solid var(--border);
Expand Down Expand Up @@ -206,8 +210,10 @@
.gv-map-legend dd > span {
white-space: nowrap;
}
/* Automatic layout: the fixed column widths below are minimums, so the name
column keeps its content's width instead of collapsing under the others. */
.gv-page .gv-ov-table {
table-layout: fixed;
table-layout: auto;
width: 100%;
}
.gv-ov-table .gv-col-number {
Expand All @@ -224,7 +230,7 @@
}
.gv-page .gv-ov-table th,
.gv-page .gv-ov-table td {
padding: 5px 8px;
padding: 5px 6px;
white-space: nowrap;
}
.gv-page .gv-ov-table th:first-child {
Expand Down Expand Up @@ -338,12 +344,19 @@
.gv-ov .gv-outside-actions .list-more {
margin: 0;
}
/* Automatic layout, as in the member table: a long folder name widens its
column, and "links to" wraps in what is left. */
.gv-page .gv-ov-folders {
table-layout: fixed;
table-layout: auto;
}
.gv-page .gv-ov-folders th:first-child {
width: 60px;
}
.gv-ov-folders .gv-ov-folder {
max-width: 160px;
white-space: normal;
overflow-wrap: anywhere;
}
.gv-page .gv-ov-folders th:nth-child(2) {
width: 58px;
}
Expand Down
21 changes: 7 additions & 14 deletions web/bundled-views/group/overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -351,15 +351,10 @@ function OverviewPage({ scope }: { scope: Scope }) {
<ScopeFacts scope={scope} data={data} status={status} />
{!data.missing && (
<>
{/* Group Members span both columns; All notes keeps its compact main column. */}
{/* Members span both columns, so the table has room for every column. */}
<div className={`gv-ov gv-ov--workspace${scope.kind === "group" ? " gv-ov--group" : ""}`}>
<div className="gv-ov-main">
<MapBlock data={data} {...expansion} />
{scope.kind === "workspace" && (
<div className="gv-ov-members">
<MembersBlock data={data} {...expansion} />
</div>
)}
</div>
<div className="gv-ov-side">
{scope.kind === "workspace" ? (
Expand All @@ -374,15 +369,13 @@ function OverviewPage({ scope }: { scope: Scope }) {
</>
)}
</div>
<div className="gv-ov-members">
<MembersBlock data={data} {...expansion} />
</div>
{scope.kind === "group" && (
<>
<div className="gv-ov-members">
<MembersBlock data={data} {...expansion} />
</div>
<div className="gv-ov-below">
<GroupRecordsBlocks />
</div>
</>
<div className="gv-ov-below">
<GroupRecordsBlocks />
</div>
)}
</div>
</>
Expand Down
34 changes: 34 additions & 0 deletions web/src/components/AppShell.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { act, fireEvent, screen, waitFor } from "@testing-library/react";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { deferredReply, jsonReply, withFakeFetch } from "../test/fakeFetch";
import type { OntologyEditSessionResponse } from "../api/types";
import { queryKeys } from "../api/queryKeys";
import { renderWithQueryClient as render } from "../test/renderWithQueryClient";
import { AppShell } from "./AppShell";
import type { DesktopCommand } from "./desktopHost";
Expand Down Expand Up @@ -201,6 +202,39 @@ describe("AppShell", () => {
expect(http.count("GET", "/api/v1/status")).toBe(1);
});

it.each([false, true])(
"shows index republication after startup (desktop=%s)",
async (desktop) => {
window.__RHIZOME_DESKTOP__ = desktop;

if (desktop) http.json("GET", "/api/tasks", {}, 404).json("GET", "/api/tasks/state", {}, 404);

statusReplies({ vaultName: "testvault", vaultPath: "/tmp/x", indexState: "ready" });
http.json("GET", "/api/v1/ontology/summary", {
schemaPresent: false,
totalNotes: 12,
rebuilding: true,
});

const { queryClient } = render(<AppShell />);

try {
const banner = await screen.findByTestId("index-ready-banner");
expect(banner).toHaveTextContent("Updating index…");
await act(async () => {
queryClient.setQueryData(queryKeys.ontology.summary(), {
schemaPresent: false,
totalNotes: 12,
rebuilding: false,
});
});
await waitFor(() => expect(screen.queryByTestId("index-ready-banner")).toBeNull());
} finally {
delete window.__RHIZOME_DESKTOP__;
}
},
);

it("keeps one shared navigation shell while switching workspaces", async () => {
statusReplies({ vaultName: "testvault", vaultPath: "/tmp/x" });

Expand Down
7 changes: 6 additions & 1 deletion web/src/components/AppShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ export function AppShell() {
});

const status = statusQuery.data ?? null;
const summaryQuery = useOntologySummaryQuery(status !== null && !bareNote?.note);

const setStatus = (next: StatusResponse | null) =>
queryClient.setQueryData(queryKeys.status(), next);
Expand Down Expand Up @@ -415,7 +416,11 @@ export function AppShell() {
</button>
</div>
)}
<IndexReadyBanner status={status} onStatusChange={setStatus} />
<IndexReadyBanner
status={status}
onStatusChange={setStatus}
rebuilding={summaryQuery.data?.rebuilding}
/>
<OntologyEditSessionProvider vaultKey={status?.vaultPath || null}>
<ErrorBoundary resetKey={route} label="Rhizome could not render this view">
{notesVisited || route === "notes" ? (
Expand Down
27 changes: 18 additions & 9 deletions web/src/components/IndexReadyBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,19 @@ type IndexReadyBannerProps = {
// omit it and let this component own the fetch.
status?: StatusResponse | null;
onStatusChange?: (status: StatusResponse) => void;
rebuilding?: boolean;
};

// IndexReadyBanner renders a non-blocking "Preparing index…" affordance under
// the AppShell nav whenever `/api/v1/status` reports `indexState ===
// "initializing"`. It hides as soon as status flips to `ready` (or on the
// existing `index.changed` SSE invalidation event), so the gate transition
// surfaces in the UI without forcing a manual refresh. Routes render normally
// beneath the banner; gated endpoints surface their own in-pane loading
// states until the backend gate opens.
export function IndexReadyBanner({ status, onStatusChange }: IndexReadyBannerProps = {}) {
// "initializing"`, or the shared ontology summary reports republication.
// Startup readiness stays true during later indexing, so it cannot describe
// whether the current index snapshot is available.
export function IndexReadyBanner({
status,
onStatusChange,
rebuilding = false,
}: IndexReadyBannerProps = {}) {
const controlled = status !== undefined;
const [fetchedState, setFetchedState] = useState<StatusResponse["indexState"] | null>(null);
const state = controlled ? (status?.indexState ?? null) : fetchedState;
Expand Down Expand Up @@ -80,7 +83,7 @@ export function IndexReadyBanner({ status, onStatusChange }: IndexReadyBannerPro
};
}, [controlled, onStatusChange, status]);

if (state !== "initializing") return null;
if (state !== "initializing" && !rebuilding) return null;

return (
<div
Expand All @@ -90,8 +93,14 @@ export function IndexReadyBanner({ status, onStatusChange }: IndexReadyBannerPro
data-testid="index-ready-banner"
>
<span className="index-ready-banner__spinner" aria-hidden="true" />
<span className="index-ready-banner__label">Preparing index…</span>
<span className="index-ready-banner__hint">First-launch reads will retry automatically.</span>
<span className="index-ready-banner__label">
{state === "initializing" ? "Preparing index…" : "Updating index…"}
</span>
{state === "initializing" && (
<span className="index-ready-banner__hint">
First-launch reads will retry automatically.
</span>
)}
</div>
);
}
14 changes: 13 additions & 1 deletion web/src/components/sigmaLabels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ export function createLabelPainter(
) {
let planned: Map<string, Spot | null> | null = null;
const placed: Box[] = [];
/** Each node's drawn label this frame, so the label is a pointer target too. */
const drawn = new Map<string, Box>();
const widths = new Map<string, number>();

const measure = (context: CanvasRenderingContext2D, text: string) => {
Expand All @@ -102,6 +104,7 @@ export function createLabelPainter(
const beginFrame = () => {
planned = null;
placed.length = 0;
drawn.clear();
};

/** Place every label this frame will draw, largest node first, clear of discs, labels, and edges. */
Expand Down Expand Up @@ -409,6 +412,7 @@ export function createLabelPainter(
}

if (!spot) return;
drawn.set(data.key, spot.box);
const [left, top, right, bottom] = spot.box;
const { label, canvas } = colors();
const endX = Math.max(left, Math.min(data.x, right));
Expand Down Expand Up @@ -490,5 +494,13 @@ export function createLabelPainter(
context.globalAlpha = 1;
};

return { draw, beginFrame, occupied: () => placed };
/** The node whose drawn label covers the viewport point, if any. */
const labelAt = (x: number, y: number) => {
for (const [id, [left, top, right, bottom]] of drawn)
if (x >= left && x <= right && y >= top && y <= bottom) return id;

return null;
};

return { draw, beginFrame, labelAt, occupied: () => placed };
}
Loading
Loading