Skip to content

Add a graph view for crafting plans - #233

Open
rubensworks wants to merge 22 commits into
master-1.21-ltsfrom
feature/crafting-plan-graph
Open

rubensworks wants to merge 22 commits into
master-1.21-ltsfrom
feature/crafting-plan-graph

Conversation

@rubensworks

@rubensworks rubensworks commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

Adds a pannable, zoomable, left-to-right graph view of the crafting plan tree, inspired by the vanilla advancements screen. It is available in the plan preview (before starting a job) and in the live plan of a running job. The graph is now the default view. The compact view stays. The tree list view is now hidden by default behind a client config option.

What changed

  • Graph view (GuiCraftingPlanGraph): root on the left, one column per depth.
    • The root is a larger tile than the other nodes, so the goal of the plan is clear even with only one or two children. Its quantity label keeps the regular text size, so it stays crisp.
    • Crafting jobs are neutral tiles framed in a status colour: waiting (yellow), blocked (orange), crafting (blue), done (green), failed (red).
      • Blocked covers jobs waiting for inputs, for room in output storage, or for a target that refused their inputs (INVALID_INPUTS, see below).
      • Nodes that are actually missing ingredients are tinted red with a ! marker, and the whole path to them is red.
      • Ingredients taken from storage are drawn as inventory slots.
    • Jobs that are being crafted have a light running around their frame, and light dashes flow along the edge to their parent. Jobs that crafting interfaces report as finished in between their crafting operations are shown as crafting while crafts remain (with a crafting table, this is how active jobs are reported almost all the time).
    • Running jobs show progress as done/total, and jobs that are partially done also show a thin progress bar along the bottom of their tile.
    • Completed sub-jobs stay in place as done nodes instead of disappearing from the plan, and keep the icon of their output.
      • They are not folded away, so the layout never changes by itself. Instead, done jobs are faded while the rest of the plan is still running, so the remaining work stands out.
      • When the whole job is done, the screen keeps showing the plan as completed ("Crafting plan - Completed", no cancel button, nothing faded) instead of "Empty crafting job".
      • A job that disappears with crafts still remaining (for example cancelled elsewhere) still shows the empty message.
    • Collapsed nodes look like a small stack of tiles (one layer for a single hidden node, two for more), with a short edge into a rounded pill that shows the number of hidden nodes.
    • Drag or arrow keys to pan, scroll or +/- to zoom (around the cursor for scrolling), F to fit, click a node to collapse/expand it. Zoom levels 0.5, 0.75, 1, 1.5, 2; counts hidden at 0.5.
    • Hover shows the ingredient tooltip plus status, status description, stored/crafting/missing counts, other outputs and a collapse/expand hint. Tooltips are drawn outside the scissor, so they are not clipped.
    • Overlay buttons: zoom in, zoom out (both disabled at their limit), fit, fullscreen. Their tooltips mention the keys. They do not keep a focus outline after a mouse click.
    • Legend at the bottom left, always visible in both screens, with swatches that look like the nodes: to craft, stored and missing in the preview; stored, waiting, blocked, crafting, done and missing for running jobs. It wraps over multiple rows on narrow windows. The controls hint is at the bottom right when it fits next to the legend.
    • Previews open at up to 1.5x and centred. Running jobs open at up to 1x, so the plan has room to grow.
    • Camera, collapsed nodes and completed jobs are kept across live updates, fullscreen toggles and window resizes. A press or drag in progress also continues across live updates.
    • Large plans open as an overview: if a plan does not fit at a zoom level where quantities are shown (0.75), its deepest levels are collapsed until it does.
  • Progress bar for running jobs.
    • The live plan gui shows the same progress bar as the crafting jobs overview (elapsed time, completed percentage, estimated remaining time) in its bottom row, between the view buttons and the cancel button, in every view.
    • In the graph view, the percentage also counts the jobs that are already done and kept in the graph. The flattened plan that the overview and compact view use no longer contains those, so its percentage can drop when a sub-job finishes.
    • The plan header no longer repeats the elapsed and remaining durations for running jobs. Previews keep their estimate in the header, as they have no progress bar. Hovering an unknown remaining duration in the bar explains it, as the header did.
    • The overview's bar drawing moved into GuiCraftingPlanProgressBar, which both guis use.
  • Refused inputs are shown as blocked, not failed.
  • Integrated Crafting is updated from 1.7.1-765 to the dev build 1.7.2-840, which includes Stop reporting invalid inputs for jobs that only wait for their interface IntegratedCrafting#246.
  • Completed plans in the other views: the tree list and compact views of a completed job show the outputs of its jobs with the total crafted quantity, instead of empty slots. The compact view no longer counts finished jobs with nothing left to craft as crafting.
  • Default view and config:
    • terminalStorageDefaultToCraftingPlanTree now defaults to true, and its comment now says the tree-based view is the graph. Existing config files keep their saved value, so only new installs get the graph by default.
    • New client option terminalStorageCraftingPlanTreeListEnabled (default false) makes the tree list view available. While it is disabled, a tree list that was picked earlier falls back to the default view.
    • The view a player picks is remembered on the client for the rest of the session.
    • Plans too large to be sent as a tree still open in compact.
  • View switching: the single text button is replaced by icon buttons in the order graph, compact, tree list (only when enabled). The active one is outlined and the others are faded. With only one view available, no buttons are shown.
  • Pure layout and camera classes (CraftingPlanGraphLayout, CraftingPlanGraphCamera) with no Minecraft imports, so the 26.x upmerge only touches the thin rendering/input layer.
  • Window size: the graph window adapts to the screen (60% x 80%, between 256x222 and 400x300). Fullscreen fills the screen minus a margin and is remembered for the session. List and compact views keep 256x222 and their textures; button positions reduce to the previous constants there.
  • Refactors:
    • The preview and running job screens share ContainerScreenTerminalCraftingPlanBase, which holds the view switching, sizing, background and input routing they used to duplicate.
    • Shared IGuiCraftingPlanView interface, with a single activeView per screen, replaces the if (tree) ... else if (flat) chains.
    • The duplicated header drawing moved into GuiCraftingPlanHeader, which also shows the completed title.
    • View and overlay buttons live in GuiCraftingPlanButtons; GuiCraftingPlanToggler only resolves the display mode and window size.
    • The 9-slice panel drawing was extracted from ContainerScreenTerminalStorage.renderBgTab into a static drawPanel.
    • TerminalCraftingPlanStatic.asCompleted creates the completed copy of a plan, optionally with the last known outputs of its jobs.
  • Enter-to-craft in the preview now works in every view, not just the tree list.
  • New icons in row 4 of icons.png, new lang keys in en_us.json (unused view.tree key removed).

Deviations from the plan

  • The view buttons are 18x18 (same style as the terminal's sort buttons, vertically centred on the 20 px button row) instead of 20x20.
  • The hint also mentions arrow keys and clicking to collapse, and sits at the bottom right instead of the bottom left.
  • Node styling uses a status-coloured frame instead of a full status-coloured fill, and the legend is shown in both screens with more entries than the planned four.
  • Collapsed nodes use a stack and a count pill instead of a +N badge.
  • The root node is larger than the other nodes.
  • The initial preview zoom can go up to 1.5 instead of 1.
  • Animated edges, crafting animations and progress bars were out of scope in the plan; they were added on request.
  • Edges are 2 px wide at zoom 1.5 and 2, and nodes and edges are drawn in whole screen pixels instead of through a scaled pose, so lines stay crisp at fractional zoom levels.
  • The tree list is hidden by default, and the tree list and compact views still show sub-jobs disappearing when they complete; only the graph keeps them.

Testing

  • ./gradlew build: 69 unit tests pass (43 new: layout, camera, pruning, default view selection including the tree list option, flowing dashes, completed jobs, display status, refused inputs, progress, completed plans).
  • ./gradlew runGameTestServer: all 82 game tests pass, also with Integrated Crafting 1.7.2-840.
  • Visual checks with clientdevbridge on a real network (storage terminal, crafting interfaces with a crafting table and a furnace, crafting jobs terminal):
    • preview, missing ingredients, cancelling a job, keyboard controls (including Enter to craft and Escape);
    • real jobs followed from start to completion with the tree logged after every update, and the completed plan in all three views;
    • collapse and completed jobs kept across updates;
    • zoom 0.5 and 2, pan clamping, fit, fullscreen on/off;
    • GUI scales 2/3/4 on 1080p, including the legend at the smallest window, and tooltips at the viewport edge;
    • the remembered view, the button order with the tree list option off and on, and the unchanged list/compact views;
    • the progress bars during a running job with furnace smelting and at completion, with the graph's percentage compared to the overview's on every update.
  • The tooltip for an unknown remaining duration in the progress bar was not checked in game, as all recipes in the test world had measured durations.
  • The refused-inputs case was reproduced with a furnace that was busy smelting raw gold during a hopper minecart job, and checked in all three views.
    • With Integrated Crafting 1.7.2-840, both iron jobs only report INVALID_INPUTS while the furnace is busy with the gold. Once one of them starts, the other waits as queued instead of staying INVALID_INPUTS until the first job is done.
  • Animations were recorded frame by frame and the dash coverage was measured on the captured frames.
  • Load test with a synthetic plan at the 64-leaf limit (about 200 nodes). Frame rate with the graph open was about 12 FPS versus 13-14 with the other views or no screen, which is within noise on the software renderer (llvmpipe), so not measured on a real GPU.
  • JEI/EMI are not in the dev environment, so their overlay interaction with the fullscreen window is not verified.

Screenshots

To be added (they could not be uploaded from the agent session).

🤖 Generated with Claude Code

https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y

claude added 18 commits October 11, 2026 13:43
Also extracts the duplicated crafting plan header drawing into a shared helper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
The graph is shown in the crafting plan preview and in the plan of running
jobs, next to the existing tree list and compact views, and replaces the tree
list as the default tree-based view. It supports zooming around the cursor,
fitting the plan to the view, collapsing nodes, and a fullscreen mode, and
keeps its state across live updates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
The config option now defaults to the graph view. The view a player picks is
reused for the next crafting plans they open during the session.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
Plans that do not fit in the viewport at a zoom level where quantities are
shown initially have their deepest levels collapsed. Live updates keep the
exact collapsed state, with new nodes expanded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
The toggler only resolves the display mode and window size now. Graph overlay
buttons also no longer keep a focus outline after a mouse click.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
Nodes are neutral tiles framed in a status color, and only nodes that are
actually missing ingredients are highlighted. Ingredients from storage look
like inventory slots instead of finished jobs, and the legend groups the
waiting states into waiting and blocked. Plan previews open at up to 1.5x and
centered, while running jobs keep room to grow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
The stub out of a parent and the trunk were shared by all children, so only
the last part of an edge into a failed or crafting node was colored. The trunk
is now split per child, and each segment takes the most severe color of the
nodes it leads to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
Nodes that are being crafted show the same spinner as crafting ingredients in
the storage terminal, their frame pulses, and light dashes flow along the edge
from them to their parent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
Comparison only, behind a temporary switch. Not meant to be merged as is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
Crafting nodes now only show a light running around their frame, replacing the
spinner and the pulsing frame.

The dashes flowing along edges skipped the last dash of each edge for some
animation phases, leaving a plain blue gap next to the crafting node. Dashes
are now computed up to the end of each edge, and drawn after all edge colors so
that overlapping edges cannot hide them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
Running plans only contain jobs that are still in the network, so completed
sub-jobs used to vanish together with their sub-trees, and the result of a
finished job was replaced by an empty job message.

- Completed sub-jobs stay in place as done nodes, with their own completed
  sub-jobs folded away, and keep the icon of their last known outputs.
- Jobs that crafting interfaces report as finished in between their crafting
  operations are shown as crafting while they have crafts remaining.
- When a job is done, its screen keeps showing the plan as completed, with a
  completed title and without the cancel button.
- The graph can be zoomed with + and -, fitted with F, and panned with the
  arrow keys.
- The selected view button is outlined, and the other ones are faded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
Collapsed nodes now look like a stack of one or two tiles, and a short edge
leads to a rounded pill with the number of hidden nodes, instead of a dark box
attached to the node.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
… jobs

The legend was only shown for running jobs on wide windows. It is now always
shown, lists what the nodes of each screen can look like, and wraps over
multiple rows on narrow windows. The controls hint moves to the bottom right
and is only shown when it fits next to the legend.

Completed sub-jobs no longer fold away by themselves, so the layout does not
change on its own. Instead, done jobs are faded while the rest of the plan is
still running, so that the remaining work stands out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
- Move the code shared by the preview and running job screens into
  ContainerScreenTerminalCraftingPlanBase.
- Show the outputs of completed jobs in all views, scaled to the total
  number of crafts, instead of the empty remaining outputs.
- Do not count finished jobs with nothing left to craft as crafting in the
  compact view.
- Continue an ongoing press or drag in the graph when a live plan updates.
- Build the plan header in one place, fix the tick cast in the graph, and
  skip empty output alternatives in tooltips.
- Remove the unused graph hit test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
With only a few nodes, it was not clear which node is the goal of the plan.
The root is now larger and its ingredient is enlarged with it, while its
quantity label keeps the regular size so that it stays crisp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
…iled

Crafting interfaces report that their target did not accept a job's inputs
while the target is busy, for example a furnace that is still smelting
something else. They insert the inputs again later, so this is not a failure.
The graph showed these jobs as failed with a red tile and a "!" marker, the
tree list colored them red, and the compact view counted them as missing.

They now use the orange blocked color everywhere and are counted as to craft
in the compact view. The status is renamed to "Inputs Not Accepted", and its
description says that the inputs will be inserted again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
The graph is the default crafting plan view, so its button now comes first,
followed by the tree list and compact buttons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
The graph shows everything the tree list shows, so the tree list is now only
offered when the new client config option
terminalStorageCraftingPlanTreeListEnabled is enabled. A tree list that was
picked earlier in the session falls back to the default view while it is
disabled. The view buttons are now ordered graph, compact, tree list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
This version stops reporting crafting jobs as having invalid inputs while they
only wait for their crafting interface (CyclopsMC/IntegratedCrafting#246).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
Running jobs now show the same progress bar as the crafting jobs overview,
with the elapsed time, the completed percentage and the estimated remaining
time, in the bottom row of the crafting plan gui. In the graph view, the
percentage also counts the jobs that are already done. Jobs in the graph that
are partially done also show their own progress along the bottom of their
tile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
… jobs

The plan header showed the elapsed and the estimated remaining duration of
running jobs, which the progress bar now shows as well. The header keeps them
for plan previews, which have no progress bar. Hovering an unknown remaining
duration in the progress bar explains why it is unknown, as the header did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
…n header

The durations that used to be on the top line are now in the progress bar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
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.

2 participants