Skip to content

Blockilization: a worker's card says what it's doing, how far along, and when it's done - #39

Merged
Potrock merged 1 commit into
mainfrom
claude/project-thread-2fvywv
Oct 25, 2026
Merged

Potrock merged 1 commit into
mainfrom
claude/project-thread-2fvywv

Conversation

@Potrock

@Potrock Potrock commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Requested by Patrick · project thread

What this is

Up to now, a worker's card showed what it was doing as a hammer and "2 turns" in its stats row, and every build button looked the same while one of them was under way. This change makes the work easy to see:

  • Its own block on the card: what it's doing ("Building a Farm", "Clearing the Forest", "Repairing the pillaged Mine"...), a progress bar, the turns left, and what the improvement gives when it's done ("When done: +1 food here").
  • The button for the build under way is lit orange. Hovering any other build button says that switching drops the progress made so far. The hint line says moving the worker stops the work.
  • No moves left: a worker that walked to the tile and used up its moves says "No moves left this turn: the work starts next turn", and that turn is counted in the turns left.
  • On its way to recommended work: the "Moving to…" line ends with what the worker will build when it gets there.
  • Units overview names the build ("Farm (2t)"), and the small sign on a working unit on the map is the build's glyph instead of a hammer.

Fixes found along the way:

  • The turns left were wrong. They ignored the work rate (Pyramids, Citizenship, Young Pioneers) and that no work gets done on a turn the worker ends with no moves. The new workLeft (in rules/game.ts) handles both, and the view now also sends progress (0 to 1).
  • Ordering a worker to build what it's already building used to restart that work from zero. Now the order does nothing and the progress is kept.

Screenshot or clip

Before, the work was a "2 turns" chip and the buttons looked the same. After, the card has the work's own block with a progress bar, the turns left and what it gives, and the Farm button is lit. With no moves left, the block says the work starts next turn. I've put screenshots in the project thread.

Checklist

  • npm run build passes: tsc --noEmit, the boundary and presentation checks, vite build and check:bundle all ran locally. The engine came from npm run wasm without wasm-opt, because the binaryen download is blocked here.
  • npm run test:headless: the four blockilization-* headless tests pass. The rules suite (tests/effects.ts) passes 258 of 258, including a new case for turns left, progress, work rate and "told again, it carries on".
  • Checked in the browser: a worker at work, one out of moves, the overview list and the map signs.
  • Names are original
  • No new assets

Generated by Claude Code

…and when it's done

The card showed only a hammer and "N turns" in its stats row, and every build button looked
the same while one was under way. Now a worker at work gets its own lines on the card: what it's
building ("Building a Farm", "Clearing the Forest"), a progress bar, the turns left and what the
improvement brings when done. The build under way is marked on its button, and the other buttons
say switching loses what's done; the hint says moving it stops the work. A worker on its way to
recommended work says what it builds when it gets there; the units overview names the build,
and the map's sign on a working unit is the build's glyph rather than a hammer.

The turns left were also wrong: they ignored the work rate (Pyramids, Citizenship...) and that a
worker with no moves left does no work this turn. `workLeft` counts both, and the view sends how
far along the work is. Ordering a worker to build what it's already building no longer starts it
over from nothing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SiC4oAGGVGYdsEpbfMuweF
@Potrock Potrock self-assigned this Oct 25, 2026
@Potrock
Potrock merged commit 6ab545f into main Oct 25, 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