Skip to content

feat(map): settlement (city/town) map site + generator - #319

Merged
deepiq2022 merged 2 commits into
mainfrom
feat/settlement-map-generator
Jul 21, 2026
Merged

feat(map): settlement (city/town) map site + generator#319
deepiq2022 merged 2 commits into
mainfrom
feat/settlement-map-generator

Conversation

@deepiq2022

Copy link
Copy Markdown
Contributor

Summary

P1 of the map-hierarchy epic — a city/town generator as a first-class map site (parallel to DungeonSite).

  • Model: Building + SettlementSite; MapState.settlements/activeSettlementId (reuses juice.map.v1, JSON omitted when empty → legacy byte-stable).
  • Oracle: settlementName()/buildingType() over the existing authored settlement_* tables (no new data rail, facts-only).
  • State (MapNotifier): generateSettlement (name + N buildings), add/switch/rename/kind/note/remove, anchor/unanchor to a hex, building CRUD.
  • UI: a new Maps → Town subtab (settlement_pane.dart) — switcher, Generate town / New, rename+kind editor, hex anchoring, building list with add/edit/delete.

Cross-nesting (building → dungeon), a hex-card "Town here" chip, and richer town tables are deferred to P2/P3 — see docs/superpowers/specs/2026-07-21-settlement-map-generator-design.md.

Gotcha fixed: the subtab host measures off-screen panes under unbounded width; the header uses fixed-size IconButtons (immune) + a LayoutBuilder width bound so Material text buttons don't assert.

Test plan

  • flutter analyze clean (pre-existing embark info lint only)
  • flutter test passes (2186)
  • New: settlement_test.dart (model + notifier), settlement_pane_test.dart (widget), maps_tab Town assertion

🤖 Generated with Claude Code

jttaylor63 and others added 2 commits July 21, 2026 18:28
Adds a Settlement map site parallel to DungeonSite — the P1 slice of the
map-hierarchy epic (city/town generator). A settlement holds a flat list
of buildings and can be anchored to a world hex.

- Model: Building + SettlementSite; MapState.settlements/activeSettlementId
  (reuses juice.map.v1, JSON omitted when empty -> legacy byte-stable).
- Oracle: settlementName()/buildingType() over the existing authored
  settlement_* tables (no new data rail, facts-only).
- MapNotifier: generateSettlement (name + N buildings), add/switch/rename/
  kind/note/remove, anchor/unanchor, and building CRUD.
- UI: a new Maps -> Town subtab (settlement_pane.dart) with a switcher,
  Generate town / New, rename+kind editor, hex anchoring, and a building
  list with add/edit/delete.

Cross-nesting (building -> dungeon), a hex-card "Town here" chip, and
richer town tables are deferred to P2/P3 — see the design doc.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The subtab host keeps every pane mounted and measures the off-screen
ones under unbounded width, where Material text buttons assert "forces an
infinite width" (the documented tool-host loose-constraint gotcha). This
crashed unrelated shell tests once the Town pane joined the maps stack.
Bound the pane width via a LayoutBuilder and use fixed-size IconButtons
(immune) for the Generate/New header actions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@deepiq2022
deepiq2022 merged commit f4f11a8 into main Jul 21, 2026
1 check passed
@deepiq2022
deepiq2022 deleted the feat/settlement-map-generator branch July 21, 2026 22:57
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