TableTower/docs/DESIGN.md
RobinFiredrake 0c9ab1aa71 Slim DESIGN.md to a status page; add parallel test runner
DESIGN.md (read every session) keeps status, names and the agreed plan;
architecture and history move to ARCHITECTURE.md and HISTORY.md, read on
demand. tools/run_tests.sh runs the suites in parallel and fails on SCRIPT
ERROR as well as on a missing PASS line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:03:10 -06:00

7.4 KiB

Table Tarot (repo: TableTower) — Status and Plan

Engine: Godot 4.7.2 (GDScript) · Started: 2026-11-08 · Last updated: 2026-11-10

The short page to read at the start of every session. Everything else is read only when needed:

  • docs/ARCHITECTURE.md: feature summary, file map, key implementation facts, data/storage, known gaps.
  • docs/HISTORY.md: decisions on record, the private Traveller board, the old ideas list, history.
  • docs/LOGIC.md (rule language), docs/PLAIN.md (plain-language layer), README.md (CLI flags).

1. What it is

A desktop (soon Android) app for building random roll tables as cards on a board, joined by threads (code: pipes). A roll flows card to card; a logic layer adds choices, values, repeats, branches and sheets.

Product principles (from the user)

  • General-purpose. The Traveller board is only a capability test. No game-specific features.
  • Intuitive for non-technical people. Flag anything programmer-y. Play mode stays simple.
  • Plain words by default; rule text stays stored and reachable ("Edit as text").
  • Themed names are welcome as long as they stay easy to understand.

2. Names (decided 2026-11-10; UI text only; code and JSON keys keep old names)

UI word Was (UI) Code / JSON
Table Tarot (app) TableTower project, classes, user:// folder unchanged
Spread (a saved set of cards) Board / Collection TowerBoard, LibraryStore, collections/
Thread Pipe pipes, PipeLayer
Deck mode Card mode card_mode
Book / Page (reusable results) — new
Branch (if… / otherwise) Router router
Repeat Loop loop
The Collection card kind needs a new UI name (not "List", not "Collection"); undecided.
Card, Result, Change, Reset, Dice wording rules: docs/HISTORY.md §6 "Terminology".

3. Plan (agreed 2026-11-10, in order)

  1. Theme system first. Style constants become a runtime theme (tokens + gradients), so per-card/per-thread colours are overrides of the same tokens. Options menu theme editor: colours (cards, threads, background, panels, text…), gradients for large areas, font, logo, background pattern; save themes as sets. Ship two: Tarot (default: dark jewel-tone purple cloth with a faint gradient shine, colours from assets/art/fortune_teller.svg and assets/ui/frame_*.svg) and Felt (inspired by the current green/copper look).
  2. Rename and reskin. Table Tarot text, mascot/logo/icon assets/art/fortune_teller.svg, scaling card borders from assets/ui/frame_border.svg + frame_corner.svg. Magical particles on the thread glow and the selected-result glow (CPUParticles2D for mobile). Thread string art comes later (user hasn't drawn it).
  3. Board interaction. Remove the drag walls. Empty-space drag = selection box (groups can be box-selected and moved together even if not groupable). Pan = middle-drag, Space+drag fallback, two fingers on touch. Cards resizable in width and height (results scroll inside).
  4. One menu system. Right-click menus for cards, threads and background (create card/group, search, shuffle all, list view, Book…), shared with the card ⋯ menu, mobile long-press, and a top-bar menu button (keep a visible button: more intuitive than right-click for some). Zoomed-out Build: names become tooltips, only drag + right-click; Play: click rolls.
  5. Small UI items. Tray chips show the source card name clearly (bold/contrast). Inspector lists threads in (from where) and out (to where). Range low > high: warning + disabled roll, no auto-fix. Template "Update template" (edit existing). Export menu: odd formats under "Other formats…". Test board explains "lint".
  6. Deck mode. Rename; show drawn-out options on the card; surface Reshuffle-vs-Stop (exists: RollTable "When the deck runs out"); Stop gives a custom result (default "Empty"); Shuffle all (menu + right-click).
  7. Nested groups, then List view (folders = groups; reorder; own search; thread icons with tooltips), then the mobile layout (List view default; Android export template download OK'd).
  8. Book and Pages. Library of reusable results (name, BBCode text, details, tags, image), searchable, with an editor; drag a Page onto a table slot. Pages are linked (edit once, updates everywhere; "unlink"). Same linking mechanism as linked templates. Stored in the spread file so exports keep them. Closable; open from top bar or background right-click.
  9. Roll features. "Roll N times, then: keep all / add / highest / lowest / let me choose" (one feature; "keep all" from a card = batches). Pause: a thread can wait; the paused roll is set aside as a "Continue ▸" chip in the tray. Costs on choice options (greyed out with a reason when unaffordable). Adjust later rolls: plain builder over values/modifiers for "next roll on X gets +3 / at least Medium / results below X become Y" (engine already can).
  10. Sheets: easier building, export as Text / Markdown / HTML (no PDF).
  11. Images in details/tables, embedded in the spread file (downscaled, size-capped); imported BBCode may only use embedded images.
  12. Help: document major features, hotkey cheat sheet, per-topic "Try a demo" spreads that open unsaved and don't appear in the spread list.

Still open from before: repo privacy on Forgejo (waiting on the user: Niles/sock's username + token); hands-on playtest; size audit of core/describe.gd (731 lines) and the other files over ~530 lines (list in ARCHITECTURE.md §3); known gaps in ARCHITECTURE.md §7.

4. Working on it

  • Godot: ~/apps/Godot_v4.7.2-stable_linux.x86_64. After adding class_name files run godot --headless --path . --import first.
  • Tests: tools/run_tests.sh [filter]: parallel, ~20 s, one line per suite, fails on SCRIPT ERROR too. Prints details only for failures. Use it instead of the old for-loop.
  • Smoke test: godot --headless --path . --quit-after 120 -- --sample (no SCRIPT ERROR).
  • Simulator: godot --headless --path . -s res://tools/simulate_board.gd -- --board=<json> --start=<id> --runs=N [--check] [--quiet].
  • Windowed runs/screenshots: always tools/test_window.sh -- --sample --screenshot=/path.png [flags] (KWin rule keeps it in the background; never plain godot --path .; don't minimize). Flags are in ui/main_cli.gd. Launching for the user to look at: plain godot --path . in the background.
  • Keep files under ~400 lines; split by area into RefCounted helpers holding m: Main with one-line delegators. Reuse shared builders (list in ARCHITECTURE.md §3).
  • Coderstanding (structure scanner) for audits: clone https://forgejo.smhub.duckdns.org/digit/coderstanding into the scratchpad, venv, pip install, XDG_CONFIG_HOME=<scratch>/xdgconf, coderstanding add tabletower <repo> --data <scratch>/cs_data. Commands: outline, hotspots, dupes, warnings, find, uses, brief.
  • Git: origin git@forgejo.smhub.duckdns.org:RobinFiredrake/TableTower.git. Feature branch, fast-forward merge to main when the user asks. Co-Authored-By line on commits.
  • Agents: only for large, separate features (each rereads context). Worktree briefs start with git reset --hard <branch>, own specific files, keep public APIs as delegators. Remove worktrees after merging.
  • Keep this page short. Update §3 as items land; put history in HISTORY.md, not here.