Commit graph

23 commits

Author SHA1 Message Date
d41a6e40aa Tests: 15 s budget, shared Godot workers; a freed Main cancels its roll
tools/run_tests.sh stops every run at 15 s and lists what was not run.
Suites are nodes run by tests/run_suites.gd, several per Godot process;
TestBase no longer compiles the app (AppTestBase does). Audit: fewer
repeats and less setup; 51 suites in about 12 s (was 45 s).

Fix a crash when a roll was still animating as its Main was freed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 16:19:30 -06:00
61a548902f Theme tiers 1-2: theme folders, mascot recolour, background scene and tile, frame sets, picture threads, sounds; nine new built-in themes
- ThemeAssets loads a theme's files; FrameSet + GradientMap (3-stop) generalise the card frame;
  ThreadStrip draws threads from a picture; BoardBackdrop draws scene and tile; MascotArt
  recolours Morgan by role (logo SVG now uses the Keep File importer); SoundBoard plays
  roll / card turn / thread / click / ambient with View > Sound levels.
- Vaporwave, Synthwave, Cozy Autumn, Rustic, Woodsy, Sky Blue, Frutiger Aero, Gothic, Terminal:
  generated art (tools/theme_art), sounds (tools/theme_sounds), settings (tools/theme_defs).
- Ten OFL fonts; --theme=<id> flag; docs/THEMES.md format spec; test_theme_assets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:05:40 -06:00
9fcaf5c123 No more drag walls; drag box selects; middle/Space-drag pans; groups move with the selection
Cards, selections, new cards and inserted templates may sit anywhere,
including left of or above the old edge. In Build a drag on empty space
draws a selection box (Ctrl/Shift adds); middle-drag or Space+drag pans
(a plain drag still pans in Play). The box also picks up collapsed groups
it touches and expanded groups it covers, and dragging any selected card
or group moves the whole selection (MainSelection). Ctrl-click a group's
title to add it to the selection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:30:13 -06:00
ea1e7a6492 Rename to Table Tarot in the UI: spreads, threads, deck mode, branch, repeat
User-facing text only; code names, JSON keys and the project's internal
name (and so the user:// folder) are unchanged. The Collection card kind
keeps its name until a new one is chosen. The window title says Table
Tarot; the top bar shows the theme's logo (the fortune teller, drawn from a
copy of the art without its background square); the app icon is the
mascot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:24:23 -06:00
8f16d337cf UI pass: striped rows, View/Help menus, zoom control, card ⋯ menu, fuller sample
- Striped result rows (parchment tint, on by default, `striped_rows` setting).
- Top bar: View ▾ (Plain words / Rule text, Collapse/Expand all, Striped rows,
  Minimap) and a "− 90% ▾ +" zoom control replace the Plain|Text switch,
  Collapse all, −/Fit/+ and Map. Arrange ▾ folds into Board ▾; Search is an icon.
- Help ▾ and F1 open a Help window; the 17 topics live in help/topics.txt.
- Build cards get a ⋯ menu (settings, template, collapse, delete) instead of
  the gear and footer Delete, sharing Style.overflow_button with group cards.
  Row × buttons show only on hover, focus or selection.
- Sample: Luck value card, Make Camp (pick card) and Search the Ruins
  (1d6 + Luck, with results only a modifier reaches).
- New test suite test_top_bar; Canvas/GraphML round-trip tests compare plain
  tables only, since logic keys are JSON-only.
- DESIGN.md: open items, including the Card Mode UI redesign.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 10:36:38 -06:00
33913889da Roll modifiers and resizable tray/inspector
- Ranged roll tables take a modifier (dice_mod, e.g. @luck). Ranges may run
  past the dice (-3 to 24 on a d20); totals past the ends use the end result.
- Range and chance code moved from RollTable into RollRange; chances follow
  the modifier's current value; plain wording and Why lines name it.
- ModifierEditor builds modifiers in plain words for roll and check cards;
  the inspector's roll section is now InspectorRoll.
- The Earlier tab scrolls; the tray and inspector resize with drag handles
  (PanelSplitter), sizes kept in local settings.
- Demo Room check uses 2d6 + Luck with a luck-only vault; new test_modifier
  suite; docs updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 10:01:10 -06:00
5e34592fec Terminology pass: one set of kind and choice names, 2d6, result/change wording
- Describe.kind_label / choice_label / choice_labels replace six drifting
  label tables. Search no longer calls Check and Router cards "Table", and
  a Check card's dialog is titled "Check settings".
- Choice types read "Which option / How many / Open ended" everywhere
  (menu, settings, inspector, card, preview, details).
- Plain dice read "2d6" / "d6" instead of the 2D-game "2D" / "1D".
- The built-in "2D skill check" template becomes "Skill check (2d6 vs
  target)" (builtin:skill-check), a real Check card with Success and Failure.
- User text says "result" and "change" instead of "entry", "row" and "effect"
  (Test board, settings dialog, lint, variables panel, pipe options).
- Pipes are deleted (link, toast, undo label), like cards and results; the
  reset statement reads "Reset" in the builder and "Reset all X" for
  prefixes. "Clear" stays for a value that really was erased.
- The template-saved toast points at "+ Card ▾".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 09:14:30 -06:00
0f3e8c278f Remove duplicated code found by the coderstanding audit
- Style.menu_button / font_colors / field_colors replace five copies of the
  "copy a bar button's skin onto a MenuButton" block, nine single-colour
  font loops and four field colour blocks.
- GroupCard uses TableCard.vbox/hbox instead of its own copies.
- InspectorKit.focused_tag / clear / refocus / as_text_link replace the
  focus-keeping render frame and "Edit as text" link shared by the
  condition and effects builders.
- InspectorCard._setting_line replaces three copies of a bound setting field.
- Main.file_dialog / export_dialog replace four FileDialog setups.
- JsonIO.entry_line / finish_import replace copies in canvas_io,
  dot_exporter and graphml_io.
- Dead code: TableCard's unused inline-editor fields and the no-op
  --edit-details / --edit-effects flags, an unused error counter in the
  tray, and an unreachable "settings not available" fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 08:21:26 -06:00
2703faf212 Inspector polish: pinned New value, title follows typing, CLI flags, README
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 21:29:59 -06:00
292d45e179 Merge branch 'worktree-agent-a694f3c612ebce597' into undo-options 2026-11-08 19:01:35 -06:00
ff7c2023c2 Undo and redo for every Build edit
EditHistory (ui/edit_history.gd) keeps an undo and a redo stack of
whole-board snapshots per collection. Each table and group is its own
JSON string, shared with the previous snapshot when unchanged, so a step
costs about the size of the cards it changed. Collapsed flags are kept
apart: collapsing isn't a step and undo leaves it as it is. Labels come
from diffing the snapshots ("Delete table Loot", "Add pipe Loot → Gems",
"Move 3 cards", "Group Careers"), or from the caller.

Main.mark_dirty records steps: typing commits when it pauses (0.8 s) and
merges until focus moves, other edits commit at the end of the frame (a
drag is one step), and quick edits to the same card or pipe merge.
Actions in main.gd bracket their changes with _begin_edit/_end_edit.
Undo patches only the changed tables and groups in place and rebuilds
their cards, keeping view, mode, search and lit results, then flashes
what changed. Ctrl+Z, Ctrl+Shift+Z / Ctrl+Y outside text fields (Play
too), Undo/Redo buttons with step tooltips in the Build bar, and the
toast's Undo now goes through the history.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 19:00:47 -06:00
86d1b214c3 Dynamic pick options, show_if and indirect @[expr] names
Pick choice cards can take their options from variables (options_from:
@prefix_* or a @list, filtered by options_where with option, option_label
and option_value bound). A Chosen entry runs for whichever dynamic option
is picked; fixed entries stay as extras, listed first. Random weighs each
dynamic option as the Chosen entry and fixed ones by weight. Any pick
option can have show_if, which hides it from the pop-up and from Random;
with nothing offered the node stops with "No options available".

@[expr] reads or writes the variable named by expr in expressions,
effects (including reset) and text ({@[expr]}); bad computed names are
effect errors. JSON round trip, lint_options in lint_pipes, choice
pop-up value badges and previews, card and settings UI, docs, demo board
(Spend a find) and tests/test_options.gd.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 18:55:38 -06:00
0367d36647 Merge branch 'worktree-agent-a07ea998a8853dd17' into boards-v2
# Conflicts:
#	ui/main.gd
#	ui/pipe_layer.gd
2026-11-08 18:19:11 -06:00
7dca1f2c3b Big-board navigation: search, focus_table, minimap, pack, lazy cards
- Search (top bar button and Ctrl+F): a card-styled pop-over with live
  results from names, result text, details, prompts, variables and group
  names (BBCode stripped, case and accents ignored, exact names first).
  Up/Down, Enter or click jump to a result, Esc closes.
- Main.focus_table(table_id, entry_id): opens a collapsed group (toast),
  expands the card for an entry, glides to it at a readable zoom, scrolls
  the long list and flashes rings around the card and the row.
- Minimap (Map toggle beside Fit, M key): tinted blocks, lit cards in
  brass, the view rect; click or drag to pan. Off by default in Play, on in
  Build, remembered per mode. Redraws only on change.
- Zoom goes down to 0.08 and Fit uses it; far out, cards draw as plain
  cards and group names show large.
- Build > Arrange > Pack collapsed groups closes the gaps collapsed blocks
  leave, in reading order, with undo. Expanding a group whose frame would
  cover its neighbours pushes them right/down to clear it, with undo.
- Performance: cards in collapsed groups aren't built until expanded; the
  pipe, port and card layers redraw only when the board's geometry
  changes; unlit pipes go in per-pipe canvas items so off-screen ones are
  culled; off-screen cards aren't rendered. 792-card board: open 5.0 s ->
  0.38 s, idle frame 36 ms -> 0.7 ms (all groups expanded: 313 ms -> 9 ms).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 18:16:32 -06:00
51bfb93fd0 Router captions and hover summary, Test board run count, README branching
The tray captions router steps with the case taken, router hover
summaries no longer read "d2 · 2 results", the Test board runs selector
starts on the last report's run count, and the README covers
conditional pipes and router cards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 17:55:22 -06:00
be75723aef Test board: BoardTester class, Build-mode dialog, README section
Moves the simulator into core/board_tester.gd (static checks, sliced runs on
fresh variables and decks), keeps tools/simulate_board.gd as a thin wrapper,
adds the Test board dialog with a Build tools button and Board menu item.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 17:49:35 -06:00
9cd1f1ea95 Groups and templates: docs, export filter and screenshot flags
Ship templates/*.json in exports, document groups and templates in the
README and design doc, and add --group-menu, --drag-demo, --insert-form,
--save-group-template and --clear-result for screenshots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 17:08:22 -06:00
38e66501b3 Logic cards UI: choice pop-up, card kinds, Build creation and settings, tray
- ChoiceDialog: card-styled pop-up for pick (option rows with details, Random,
  1-9 / R keys), number (spin box with min/max/default, Enter) and text.
  Cancel, Esc, freeing the dialog, a new roll or a collection switch all
  answer null through a separate Reply object, so a roll never hangs.
- Main: real prompt hook; the steps so far light on the board and in the
  tray before each question; a roll with questions shows the rest at once;
  a new roll cancels an open question cleanly; refresh_live() re-renders
  variable, sheet and question text only after rolls and edits.
- TableCard: "?" badge and question for choice cards, loop icon, rule chip
  and Each time / Afterwards rows, compact live variable cards (reset in
  Build), live sheet cards with one outlet, expression-dice subtitles,
  effect chips in Play and a validated effects editor in Build.
- Build: "+ Table" menu for every kind; kind-specific settings (choice type,
  question, save as, min/max; loop mode and rule; variable name, type,
  starting value; sheet template) checked with Expr.check; expression pipe
  counts in the pipe popover and on pipe labels.
- Tray: effect lines under chips, last 12 steps behind "+N earlier steps",
  sheet headline, Cancelled / action-limit pill, capped indents and Earlier
  rows; Variables tab lists every board variable with Reset all.
- RichText: error markers in red; previews show {@x_*} and {= expr}.
- examples/logic_demo.json and tests/test_logic_ui.gd.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 14:07:57 -06:00
2a79640c9d Add fast roll: Shift-click a die to skip the animation
Holding Shift while clicking a table's die (or "Roll again") skips the
flicker and the beads and shows the whole result at once: every result
and pipe on the path lit, long lists scrolled to their result, and the
full chain in the tray without the chip fade-in. A fast roll started
mid-animation takes over cleanly. The Play hint and roll tooltips
mention Shift-click, and --fast pairs with --roll for screenshots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:53:39 -06:00
667ee1d9f0 Merge play-side UI; connect it to the collection switcher
Combines the play-side integration (refs and variables through the
roller, BBCode rendering, hover details, card decks, variables panel,
copy, reference pipes, pipe options, Build card editors) with the app
shell. Switching collections now loads that collection's decks,
variables and history and relights its last roll. Adds a Quest Hooks
and Towns table to the sample so references and variables show by
default, and updates the README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:45:34 -06:00
8ea83947ff Add a test-window wrapper that keeps test runs in the background
tools/test_window.sh runs the game under the window class "TableTower
Test" (via a temporary override.cfg) so a KWin window rule can keep
automated screenshot runs unfocused and behind other windows, without
affecting normal playtests from the editor. Also ignore override.cfg
and agent worktrees.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:11:55 -06:00
60c2d03147 Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.

- core/: data model (RollTable, TableEntry, TowerBoard), sample board
  with a d100 table of 100 trinkets and a weighted d100 range table,
  and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
  cards, result tray with earlier rolls, undo toasts, and a Collapse all
  / Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
eab10500bc Initial Godot 4.7 project: TableTower
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:38:06 -06:00