Skip to content

A workflow hierarchy is read from one cached export, and navigated from an outline - #67

Merged
endrix merged 1 commit into
mainfrom
feat/hierarchy-cache-outline
Oct 2, 2026
Merged

endrix merged 1 commit into
mainfrom
feat/hierarchy-cache-outline

Conversation

@endrix

@endrix endrix commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Phase 5 of docs/proposals/single-editor-hierarchy.md. The runtime side is huawei-csl/wfpy#45 (wfpy plan --format graph --hierarchy).

Navigating a hierarchy in one editor ran the runtime's plan for every view you drilled into. That was a process per level, and each nested workflow was elaborated standalone rather than as its parent's instance. The only way down was one double-click per level.

One cached export per root

  • A product that can export a whole hierarchy supplies cliHierarchyArgs(file, rootWorkflow).
  • CliGraphModelSource.viewFromHierarchy then reads every view, root or nested, from one export per root. The root comes from the trail's first crumb; the view is the instance at the trail's instance path.
  • HierarchyCache keeps an export while every file it came from (the root's and each nested definition's) has the same content hash, and exports again once any changes.
  • Fallbacks to a plan of its own: an instance that did not elaborate, a trail that does not line up, or unsaved text being previewed.

The outline, modelled on mlir-viewer's

  • The export's tree, without graphs (outlineOf), reaches the root model as wf:hierarchy (new GraphDocument.hierarchy / HierarchyOutlineEntry in shared).
  • HierarchyOutlinePanel is a model-root listener, shown only when navigating in place and a hierarchy is present.
    • toggle button and O;
    • filter that keeps the ancestors of a match;
    • rows with instance name, workflow, a chip for a file other than the root's, node and nested counts, and error or truncated markers;
    • single click selects and centers the instance in the view containing it, opening that view first if needed;
    • double click opens its view at the trail a drill-down would give;
    • the current view's row is highlighted and its ancestors opened.
  • The pure helpers live in hierarchy-outline-tree.ts, tested headlessly.

Not yet: a run's state (running / done / failed) on the rows.

Container parity: the baseline gains exactly the panel's two bindings (self, and as an IGModelRootListener). I diffed the composition before accepting them.

Tests: hierarchy cache and view reading (8), outline helpers and node lookup (8), wf:hierarchy on the root (2). I also checked the shape of a real wfpy plan --hierarchy export against what the cache reads. All workspaces pass, with neutrality 5/5 and typecheck 5/5.

wfpy-ide supplies cliHierarchyArgs in a separate PR.

https://claude.ai/code/session_015VK7fH1c4aKbexnq2QcuKU

…om an outline

Navigating a hierarchy in one editor ran the runtime's plan for every
view drilled into -- a process per level, each nested workflow elaborated
standalone rather than as its parent's instance -- and the only way down
was one double-click per level. A product that can export a whole
hierarchy (`cliHierarchyArgs`) now has every view, root or nested, read
from one export per root, kept while every file it came from is
unchanged on disk (`hierarchy-cache.ts`); an instance that did not
elaborate, or unsaved text being previewed, still gets a plan of its own.

The export's tree, without its graphs, reaches the root model as
`wf:hierarchy`, and a hierarchy outline modelled on mlir-viewer's shows
it: a toggle (and O), a filter that keeps the ancestors of a match, a
single click that selects and centers an instance in the view containing
it, a double click that opens its view at the trail a drill-down would
give, and the current view's row highlighted.

Phase 5 of docs/proposals/single-editor-hierarchy.md.

Claude-Session: https://claude.ai/code/session_015VK7fH1c4aKbexnq2QcuKU
@endrix
endrix merged commit 053205e into main Oct 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant