summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-01 17:41:56 +0100
committersalmonik <salmonik@tuta.io>2026-11-01 17:41:56 +0100
commitdc8c03f265b7475cfc122a1221abf68f5d0a9ae9 (patch)
treeeb9926e9aa274e344284bb97e166038759160522
parentdocs: record the GUI architecture and version lockstep; adopt GPL-3.0-or-later (diff)
downloadzagan-bet-dc8c03f265b7475cfc122a1221abf68f5d0a9ae9.tar.gz
zagan-bet-dc8c03f265b7475cfc122a1221abf68f5d0a9ae9.zip
docs: add the phased GUI plan
-rw-r--r--docs/GUI-PLAN.md87
1 files changed, 87 insertions, 0 deletions
diff --git a/docs/GUI-PLAN.md b/docs/GUI-PLAN.md
new file mode 100644
index 0000000..0285543
--- /dev/null
+++ b/docs/GUI-PLAN.md
@@ -0,0 +1,87 @@
1# GUI plan
2
3Decisions and rationale live in `docs/adr/0001-gui-frontend-architecture.md` and
4`0002-version-lockstep.md`. This file is the order of work.
5
6## Non-goals
7
8Audio, 3D, macOS, auto-update, a browser client, and pixel-golden tests in CI.
9
10## Phase 0 — version handshake (v4.0.0)
11
12Breaking wire change, released for client and server together.
13
14- `HELLO <version>` is the first line after TLS. The server answers
15 `HELLO <version> latest=<version> url=<download-url>` and rejects every other
16 message with `ERROR HELLO required` until it has seen one.
17- MAJOR.MINOR must match; PATCH may differ. A mismatch is refused before any
18 credentials are sent.
19- The client measures its connect latency with the `HELLO` round trip and
20 prints a notice when the server advertises a newer version.
21- `DOWNLOAD_URL` is read from the environment by the server, with the public
22 site as the fallback.
23
24**Gate:** mismatch refused in both directions, `HELLO` required before auth,
25existing game flows unchanged, new tests for version parsing and gating.
26
27## Phase 1 — core boundary and roulette
28
29- Introduce `Command` and `View`; move terminal-only concerns (prompt editing,
30 wheel animation, interactive prompts) into the TUI adapter.
31- App screens: `Connect`, `Trust`, `TrustMismatch`, `Login`, `Lobby`,
32 `History`, `Game`.
33- Port roulette first: `PlaceBet(BetTarget)`, `SetChip`, `ClearBets`, `Spin`,
34 and a `FeltView` carrying chips, cursor, and the last result.
35- Add `ForgetLogin` so "log out" and "forget saved login" are distinct in both
36 frontends.
37- Auto-login stays: a stored credential for the pinned fingerprint logs in
38 automatically after the trust check.
39
40**Gate:** the TUI behaves exactly as today, its tests now assert on `View`
41instead of text where practical, and `ClientCore` contains no terminal types.
42
43## Phase 2 — the other three games
44
45Slots, blackjack, crash ports with their own `GameView` variants and commands.
46Server push (`CRASH_BUSTED`) feeds the same `View`. The TUI keeps animating the
47crash board from its local clock.
48
49**Gate:** all four games playable in the TUI through `Command`/`View`.
50
51## Phase 3 — `gui/` skeleton and the style spike
52
53- Add the `gui/` workspace member (eframe), no game code yet.
54- Theme module with the agreed tokens, two fonts, spacing scale.
55- One reference screen: the roulette felt with chips, cursor, and a spinning
56 number, plus the persistent header (connection, balance, account).
57- Verify the Windows cross-compile with a hello-world before going further.
58
59**Gate:** your approval of the screenshot at 1080p; binary ≤ 40 MB, idle
60≤ 150 MB, cold start ≤ 1 s, 60 fps on integrated graphics.
61
62## Phase 4 — GUI wiring
63
64- Network thread with channels, request deadlines in the shared adapter.
65- Trust modal, version-mismatch screen, login/register, lobby, history panel.
66- All four games, per-frame painting and tier 1–2 effects.
67- Update notice from the handshake in the lobby.
68
69**Gate:** manual checklist per game at 60 fps, `egui_kittest` wiring tests,
70modem-throttled run.
71
72## Phase 5 — packaging
73
74- `publish.sh` emits `zagan-bet-gui-<version>-<platform>-<arch>[.exe]`.
75- Bash and PowerShell installers that verify the SHA-256, install to the user
76 directory, and create `.desktop`/Start-menu entries.
77- Download page lists raw binaries and installers; add the source-code link.
78
79**Gate:** `deploy.sh` verifies both artifact kinds; a clean machine installs
80from the page and launches.
81
82## Testing split
83
84- `View`/`Command` tests in the core: flows, gating, state. Always.
85- The TUI adapter remains the regression net through Phases 1–2.
86- `egui_kittest` for wiring that `View` cannot see; no pixel goldens in CI.
87- Manual for feel, animations, and layout at different window sizes.