Skip to content

[cueweb/docs] Job graph: show layers, right-click layer menu, double-click to open#2457

Merged
ramonfigueiredo merged 1 commit into
AcademySoftwareFoundation:masterfrom
ramonfigueiredo:cueweb-job-graph-node-menu
Jun 23, 2026
Merged

[cueweb/docs] Job graph: show layers, right-click layer menu, double-click to open#2457
ramonfigueiredo merged 1 commit into
AcademySoftwareFoundation:masterfrom
ramonfigueiredo:cueweb-job-graph-node-menu

Conversation

@ramonfigueiredo

@ramonfigueiredo ramonfigueiredo commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Related Issues

Main issue:

Issues related to this PR:

Summarize your change.

JobDependencyGraph (Cuetopia > View Job Graph) now matches CueGUI's JobMonitorGraph more closely:

  • Always render the focus job's layers (ingestFocusLayers via /api/job/getlayers), so a job with no cross-job dependencies still shows its structure instead of an empty "No dependencies found" panel.
  • Right-click a layer node for a context menu that reuses the Layers-table actions via a { original: layer } shim: Auto Layout Nodes; Dependencies (View Dependencies / Dependency Wizard / Mark done); Reorder Frames; Stagger Frames; Properties; Kill / Eat / Retry / Retry Dead Frames. The layer dialogs + Dependency Wizard are already mounted by the host page, so the events resolve in both the inline panel and /jobs/[name].
  • Open the job detail page on double-click (onNodeDoubleClick) instead of a single click, so a click no longer navigates away by accident.

Docs: updated the Job Dependency Graph coverage across the user-guide, reference, developer-guide, other-guides, quick-starts, tutorials, and concepts, and added the graph + right-click-menu screenshots (light mode; dropped two redundant *_dark images).

LLM usage disclosure

Parts of this solution's implementation were developed with assistance from Claude Opus.

…click to open

JobDependencyGraph (Cuetopia > View Job Graph) now matches CueGUI's JobMonitorGraph more closely:

- Always render the focus job's layers (ingestFocusLayers via /api/job/getlayers), so a job with no cross-job dependencies still shows its structure instead of an empty "No dependencies found" panel.
- Right-click a layer node for a context menu that reuses the Layers-table actions via a { original: layer } shim: Auto Layout Nodes; Dependencies (View Dependencies / Dependency Wizard / Mark done); Reorder Frames;
Stagger Frames; Properties; Kill / Eat / Retry / Retry Dead Frames. The layer dialogs + Dependency Wizard are already mounted by the host page, so the events resolve in both the inline panel and /jobs/[name].
- Open the job detail page on double-click (onNodeDoubleClick) instead of a single click, so a click no longer navigates away by accident.

Docs: updated the Job Dependency Graph coverage across the user-guide, reference, developer-guide, other-guides, quick-starts, tutorials, and concepts, and added the graph + right-click-menu screenshots (light mode; dropped two redundant *_dark images).
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

JobDependencyGraph now fetches and renders the focus job's layer nodes unconditionally via ingestFocusLayers, adds "contains" edges from job to layer nodes, switches node navigation to double-click, and introduces a right-click context menu for layer nodes with CueGUI-parity dependency and layer-operation actions. All CueWeb documentation is updated to match.

Changes

Job Dependency Graph Enhancement

Layer / File(s) Summary
GraphNodeData extension and layer ingestion
cueweb/components/ui/job-dependency-graph.tsx
GraphNodeData gains an optional layer?: Layer field. ingestFocusLayers fetches /api/job/getlayers, upserts LAYER nodes carrying the full Layer object, and creates "contains" edges from the focus job node. walkDependencyTree calls ingestFocusLayers after inserting the focus job node so layers are always present.
Double-click navigation, context menu state, and ReactFlow wiring
cueweb/components/ui/job-dependency-graph.tsx
Single-click navigation is replaced by a double-click handler that calls onNodeNavigate or pushes to the job overview route. useSession supplies username for Kill actions. Right-click state tracks cursor position and selected node; Escape and outside-click close the menu. "Auto Layout Nodes" re-runs layout and calls fitView. The empty-state message is updated. ReactFlow is re-wired for the new handlers and conditionally renders NodeContextMenu with Item/Sep helpers calling *_GivenRow action utilities.
Documentation updates
docs/_docs/concepts/cueweb-rest-gateway.md, docs/_docs/developer-guide/cueweb-development.md, docs/_docs/other-guides/cueweb.md, docs/_docs/quick-starts/quick-start-cueweb.md, docs/_docs/reference/cueweb.md, docs/_docs/tutorials/cueweb-tutorial.md, docs/_docs/user-guides/cueweb-user-guide.md
All CueWeb docs are updated to reflect double-click navigation, focus-job layer rendering without cross-job dependencies, and the right-click layer-node context menu with its specific action set.

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant ReactFlow as JobDependencyGraph
  participant ingestFocusLayers
  participant LayersAPI as /api/job/getlayers
  participant NodeContextMenu

  User->>ReactFlow: select job (toggle on)
  ReactFlow->>ingestFocusLayers: walkDependencyTree → ingestFocusLayers(focusJob)
  ingestFocusLayers->>LayersAPI: GET layers
  LayersAPI-->>ingestFocusLayers: Layer[]
  ingestFocusLayers-->>ReactFlow: LAYER nodes + "contains" edges added

  User->>ReactFlow: double-click node
  ReactFlow->>ReactFlow: onNodeNavigate(jobName) or router.push(/jobs/<name>?tab=overview)

  User->>ReactFlow: right-click layer node
  ReactFlow->>NodeContextMenu: open at cursor with layer context
  User->>NodeContextMenu: select action (e.g. kill/eat/retry/auto-layout)
  NodeContextMenu->>ReactFlow: invoke *_GivenRow helper or fitView
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

devdays26

Suggested reviewers

  • lithorus
  • DiegoTavares

Poem

🐇 Hop, hop — the graph grows wide,
Layer nodes now rendered with pride!
Double-click to dash away,
Right-click for actions in the fray.
Context menus, kill and retry—
This rabbit's graph reaches the sky! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and concisely summarizes the three main changes: showing layers, adding right-click layer menu, and switching to double-click navigation for opening jobs.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
cueweb/components/ui/job-dependency-graph.tsx (1)

619-641: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider hoisting Item and Sep components outside NodeContextMenu.

These helper components are redefined on every render of NodeContextMenu. While the menu is short-lived and the impact is minimal, hoisting them to module scope (or memoizing) would improve React reconciliation and follow idiomatic patterns.

Suggested approach
+// Hoisted outside NodeContextMenu for stable identity
+const MenuSep = () => <div className="my-1 h-px bg-border" />;
+
+const MenuItem = ({
+  label,
+  icon,
+  onClick,
+  danger,
+}: {
+  label: string;
+  icon: React.ReactNode;
+  onClick: () => void;
+  danger?: boolean;
+}) => (
+  <button
+    type="button"
+    onClick={onClick}
+    className={`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-accent hover:text-accent-foreground ${
+      danger ? "text-red-500" : ""
+    }`}
+  >
+    {icon}
+    <span className="truncate">{label}</span>
+  </button>
+);

 function NodeContextMenu({ ... }) {
   const layer = data.layer;
   const row = layer ? ({ original: layer } as any) : null;

   function run(fn: () => void) {
     fn();
     onClose();
   }

-  const Item = ({ ... }) => ( ... );
-  const Sep = () => <div className="my-1 h-px bg-border" />;
+  // Use hoisted MenuItem/MenuSep, wrapping onClick with run()
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cueweb/components/ui/job-dependency-graph.tsx` around lines 619 - 641, The
Item and Sep components are currently defined inside the NodeContextMenu
component and are recreated on every render. Move both the Item component (which
accepts label, icon, onClick, and danger props) and the Sep component outside of
NodeContextMenu to module scope, placing them before the NodeContextMenu
definition. This ensures these helper components are defined only once instead
of being redefined on each render, improving React reconciliation performance.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@cueweb/components/ui/job-dependency-graph.tsx`:
- Around line 619-641: The Item and Sep components are currently defined inside
the NodeContextMenu component and are recreated on every render. Move both the
Item component (which accepts label, icon, onClick, and danger props) and the
Sep component outside of NodeContextMenu to module scope, placing them before
the NodeContextMenu definition. This ensures these helper components are defined
only once instead of being redefined on each render, improving React
reconciliation performance.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0af8779e-6362-4342-8961-b494ffa5ec2e

📥 Commits

Reviewing files that changed from the base of the PR and between 14bc5ae and 6017376.

⛔ Files ignored due to path filters (4)
  • docs/assets/images/cueweb/cueweb_dependency_graph.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_dependency_graph_dark.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_dependency_graph_menu_options.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_dependency_graph_menu_options_dark.png is excluded by !**/*.png
📒 Files selected for processing (8)
  • cueweb/components/ui/job-dependency-graph.tsx
  • docs/_docs/concepts/cueweb-rest-gateway.md
  • docs/_docs/developer-guide/cueweb-development.md
  • docs/_docs/other-guides/cueweb.md
  • docs/_docs/quick-starts/quick-start-cueweb.md
  • docs/_docs/reference/cueweb.md
  • docs/_docs/tutorials/cueweb-tutorial.md
  • docs/_docs/user-guides/cueweb-user-guide.md

@ramonfigueiredo

Copy link
Copy Markdown
Collaborator Author

@DiegoTavares / @lithorus
Ready for review!

@ramonfigueiredo ramonfigueiredo merged commit 39d6abe into AcademySoftwareFoundation:master Jun 23, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants