Skip to content

Show a spinner overlay on ingredients that are being crafted - #209

Merged
rubensworks merged 3 commits into
master-1.21-ltsfrom
claude/integrated-terminals-138-spinner
Aug 29, 2026
Merged

Show a spinner overlay on ingredients that are being crafted#209
rubensworks merged 3 commits into
master-1.21-ltsfrom
claude/integrated-terminals-138-spinner

Conversation

@rubensworks

Copy link
Copy Markdown
Member

Closes #138

The storage terminal now indicates which ingredients are being produced by running crafting jobs, by drawing an animated spinner over their slot. The spinner is colored by the crafting job status (reusing the existing TerminalCraftingJobStatus colors), and the tooltip shows the quantity that is still being crafted together with the job status and its description.

This applies to all ingredient tabs (items, fluids, energy, ...) and to the crafting tab, both on stored ingredients and on craftable ingredients.

How it works

  • TerminalStorageTabIngredientComponentServer#updatePendingCraftingJobOutputs walks all running crafting job plans of the network (including their dependencies), and collects the outputs that they are still expected to produce for its own ingredient component. Finished jobs are skipped, and jobs that occur multiple times within a plan (due to job splitting) are only counted once.
  • These are aggregated per channel and per instance into PendingCraftingJobOutputs, where quantities are summed and the most relevant status is kept (statuses that need the player's attention, such as missing inputs, take precedence over crafting).
  • They are sent to the client with the new TerminalStorageIngredientCraftingJobsPacket. Just like the crafting jobs gui, this is throttled by guiTerminalCraftingJobsUpdateFrequency, only happens for the active tab, and nothing is sent as long as no crafting jobs are running. When no crafting handler is installed, no work is done at all.
  • Client-side, TerminalStorageSlotIngredient looks up the pending output for its instance, draws the spinner in the background layer, and adds the tooltip lines. The instance that is being moved around by the player does not get an overlay.

Changes

  • New spinner animation frames in icons.png (8 frames of 8x8, at y=64), exposed as Images.SPINNER.
  • New translation key gui.integratedterminals.terminal_storage.tooltip.crafting, the existing gui.integratedterminals.craftingplan.status[.desc] keys are reused for the status.
  • Documented the feature in the info book's autocrafting section.

Testing

  • ./gradlew build passes.
  • ./gradlew runGameTestServer passes (17 tests), including 6 new game tests in GameTestPendingCraftingJobOutputs that cover the aggregation of pending outputs (quantity-independent lookups, summing of quantities, status precedence, empty instances and multiple channels).

Generated by Claude Code

claude added 2 commits August 27, 2026 19:05
The storage terminal now indicates which ingredients are being produced by
running crafting jobs, by drawing an animated spinner over their slot.
The spinner is colored by the crafting job status, and the tooltip shows
the quantity that is still being crafted together with the job status.

The server-side ingredient tab periodically collects the outputs that all
running crafting jobs are still expected to produce, and sends them to the
client. Just like the crafting jobs gui, this is throttled by
guiTerminalCraftingJobsUpdateFrequency, and nothing is sent as long as no
crafting jobs are running.

Closes #138

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FzSYcpDAVUfCpTPpjMmeoz
Running crafting jobs report the FINISHED status in-between the batches that
they hand to their crafting interface. As the storage terminal skipped the
outputs of finished jobs, the spinner disappeared as soon as the job started
producing, even though the job was still running. Such a job is not actually
done: jobs that are done are not exposed as running jobs anymore. Their
remaining outputs are now shown as actively being crafted.

Ingredients that are both stored and craftable were showing the spinner twice.
The crafting option slot now defers to the stored ingredient slot when the
same instance is also shown as a stored ingredient.

The collecting of pending crafting job outputs moved into
PendingCraftingJobOutputs, so that it can be covered by a game test that runs
an actual crafting job. This test needs a network with item storage, for which
Integrated Tunnels was added as a dependency, just like Integrated Crafting
does for its own game tests.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FzSYcpDAVUfCpTPpjMmeoz
The storage terminal always shows a single channel, so the pending crafting
job outputs are now collected for the selected channel instead of for all
channels at once. This channel is propagated from the container into the
server tab, and the client only applies the received outputs as long as that
channel is being shown.

The priority that decides which status is shown when multiple crafting jobs
produce the same ingredient is now a field of TerminalCraftingJobStatus.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FzSYcpDAVUfCpTPpjMmeoz
@rubensworks
rubensworks merged commit 3717d2c into master-1.21-lts Aug 29, 2026
3 checks 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.

2 participants