Repository navigation
Blockilization: a worker's card says what it's doing, how far along, and when it's done - #39
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Fixes found along the way:
workLeft(inrules/game.ts) handles both, and the view now also sendsprogress(0 to 1).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 buildpasses:tsc --noEmit, the boundary and presentation checks,vite buildandcheck:bundleall ran locally. The engine came fromnpm run wasmwithout wasm-opt, because the binaryen download is blocked here.npm run test:headless: the fourblockilization-*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".Generated by Claude Code