diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-01 19:58:59 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-01 19:58:59 +0100 |
| commit | 10ff558853f549d3f3c7c8432488bfad9da6973a (patch) | |
| tree | 271b05fead384e2d91e5c8332fea9d00b540f0cc /docs | |
| parent | v4.0.7: finish the Phase 1 boundary with a command shell (diff) | |
| download | zagan-bet-10ff558853f549d3f3c7c8432488bfad9da6973a.tar.gz zagan-bet-10ff558853f549d3f3c7c8432488bfad9da6973a.zip | |
v4.1.0: add the egui workspace member and the roulette style spike
Phase 3 of the GUI plan. gui/ is a separate package that depends on the core with default features off, so egui never enters the TUI or server build graph. It carries the theme tokens and two embedded fonts (Open Sans OFL, Hack MIT), paints the felt, chips, cursor and wheel from RouletteView, and composes the persistent header with the betting sidebar.
The reference screen runs on demo state: arrow keys move the shared Cursor, clicks place chips, and SPIN animates a 2.4 s wheel that settles with the winning pocket under the pointer. No network until Phase 4.
Verified x86_64-pc-windows-gnu cross-compile. Measured on Linux at 1080p with llvmpipe: 6.0 MB binary (4.7 MB on Windows), 52 ms to window, 137 MB idle RSS, 0% idle CPU.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/GUI-PLAN.md | 43 | ||||
| -rw-r--r-- | docs/TESTING.md | 46 | ||||
| -rw-r--r-- | docs/screenshots/gui-roulette-1080p.png | bin | 0 -> 126927 bytes | |||
| -rw-r--r-- | docs/screenshots/gui-roulette-result-1080p.png | bin | 0 -> 127523 bytes |
4 files changed, 80 insertions, 9 deletions
diff --git a/docs/GUI-PLAN.md b/docs/GUI-PLAN.md index 2789b81..8c3db0a 100644 --- a/docs/GUI-PLAN.md +++ b/docs/GUI-PLAN.md | |||
| @@ -69,16 +69,43 @@ crash board from its local clock. | |||
| 69 | 69 | ||
| 70 | ## Phase 3 — `gui/` skeleton and the style spike | 70 | ## Phase 3 — `gui/` skeleton and the style spike |
| 71 | 71 | ||
| 72 | - Add the `gui/` workspace member (eframe), no game code yet. | 72 | **Code complete in v4.1.0; awaiting the screenshot sign-off.** |
| 73 | - Theme module with the agreed tokens, two fonts, spacing scale. | 73 | |
| 74 | - One reference screen: the roulette felt with chips, cursor, and a spinning | 74 | - `gui/` is a workspace member (`zagan-bet-gui`). It depends on the core with |
| 75 | number, plus the persistent header (connection, balance, account). | 75 | `default-features = false`, so neither egui nor native-tls enters the TUI or |
| 76 | - Verify the Windows cross-compile with a hello-world before going further. | 76 | server build graph. The build uses the workspace's `gui-release` profile |
| 77 | 77 | (opt-level `z`, LTO, stripped). | |
| 78 | **Gate:** your approval of the screenshot at 1080p; binary ≤ 40 MB, idle | 78 | - `gui/src/theme.rs` holds the tokens: the terminal-derived dark palette, felt |
| 79 | ≤ 150 MB, cold start ≤ 1 s, 60 fps on integrated graphics. | 79 | green kept for the table, a 4/8/12/16/24 spacing scale, radii, and the type |
| 80 | scale. Two embedded fonts: Open Sans (OFL) for text, Hack (MIT) for numbers, | ||
| 81 | chips and labels. Licences sit next to the files in `gui/assets/fonts/`. | ||
| 82 | - `gui/src/roulette.rs` draws the felt, chips, the fine lattice cursor and the | ||
| 83 | wheel from a `RouletteView`; it owns the geometry, not the rules. | ||
| 84 | - `gui/src/app.rs` composes the persistent header (connection, account, | ||
| 85 | balance) with the table and the betting sidebar. The demo state animates a | ||
| 86 | 2.4 s wheel spin and highlights the winning pocket and cell. | ||
| 87 | - `gui/tests/layout.rs` covers the pure maths (money grouping, wheel angle, | ||
| 88 | table aspect, bet names). UI wiring tests arrive with `egui_kittest` in | ||
| 89 | Phase 4. | ||
| 90 | |||
| 91 | Measured on Linux at 1080p with llvmpipe software GL: | ||
| 92 | |||
| 93 | | Check | Result | | ||
| 94 | | --- | --- | | ||
| 95 | | Linux binary | 6.0 MB | | ||
| 96 | | Windows x86_64 binary | 4.7 MB | | ||
| 97 | | Cold start to window | 52 ms | | ||
| 98 | | Idle RSS | 137 MB | | ||
| 99 | | Idle CPU | 0% | | ||
| 100 | |||
| 101 | The approved reference lives at `docs/screenshots/gui-roulette-1080p.png`, with | ||
| 102 | the result state at `docs/screenshots/gui-roulette-result-1080p.png`. | ||
| 103 | |||
| 104 | **Gate:** the screenshot needs your approval. Frame rate on integrated graphics | ||
| 105 | still needs a run on real hardware. | ||
| 80 | 106 | ||
| 81 | ## Phase 4 — GUI wiring | 107 | ## Phase 4 — GUI wiring |
| 108 | ## Phase 4 — GUI wiring | ||
| 82 | 109 | ||
| 83 | - Network thread with channels, request deadlines in the shared adapter. | 110 | - Network thread with channels, request deadlines in the shared adapter. |
| 84 | - Trust modal, version-mismatch screen, login/register, lobby, history panel. | 111 | - Trust modal, version-mismatch screen, login/register, lobby, history panel. |
diff --git a/docs/TESTING.md b/docs/TESTING.md index 23e3a19..f42b84a 100644 --- a/docs/TESTING.md +++ b/docs/TESTING.md | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | ## Automated suite | 3 | ## Automated suite |
| 4 | 4 | ||
| 5 | ```sh | 5 | ```sh |
| 6 | cargo test | 6 | cargo test --workspace |
| 7 | ``` | 7 | ``` |
| 8 | 8 | ||
| 9 | The suite is deterministic and headless: no network, no PTY, no sleeps, no | 9 | The suite is deterministic and headless: no network, no PTY, no sleeps, no |
| @@ -46,10 +46,14 @@ or a vendored OpenSSL. | |||
| 46 | | `tests/slots.rs` | Server slots payout rules and overflow handling. | | 46 | | `tests/slots.rs` | Server slots payout rules and overflow handling. | |
| 47 | | `tests/storage.rs` | Client/server SQLite storage helpers. | | 47 | | `tests/storage.rs` | Client/server SQLite storage helpers. | |
| 48 | | `tests/tofu.rs` | SPKI fingerprint and TOFU decisions. | | 48 | | `tests/tofu.rs` | SPKI fingerprint and TOFU decisions. | |
| 49 | | `gui/tests/layout.rs` | GUI presentation maths: money grouping, wheel angle, table aspect, bet names. | | ||
| 49 | 50 | ||
| 50 | `tests/tofu.rs` and `tests/server_setup.rs` shell out to `openssl`, so run them | 51 | `tests/tofu.rs` and `tests/server_setup.rs` shell out to `openssl`, so run them |
| 51 | on a machine where the `openssl` CLI is available. | 52 | on a machine where the `openssl` CLI is available. |
| 52 | 53 | ||
| 54 | The GUI has its own integration tests because the root package cannot depend on | ||
| 55 | the GUI (`gui/tests/`); `cargo test --workspace` runs both halves. | ||
| 56 | |||
| 53 | ## Development resets | 57 | ## Development resets |
| 54 | 58 | ||
| 55 | The server creates `server.db` in its working directory. The client keeps | 59 | The server creates `server.db` in its working directory. The client keeps |
| @@ -67,6 +71,21 @@ rm -rf ~/.local/share/zagan-bet | |||
| 67 | The audit schema is not auto-migrated from the pre-2.0 slots-only `plays` | 71 | The audit schema is not auto-migrated from the pre-2.0 slots-only `plays` |
| 68 | table. Starting against an old database will fail until it is removed. | 72 | table. Starting against an old database will fail until it is removed. |
| 69 | 73 | ||
| 74 | ## Building the GUI | ||
| 75 | |||
| 76 | The GUI is a workspace member, so it never enters the TUI or server build graph: | ||
| 77 | |||
| 78 | ```sh | ||
| 79 | cargo build -p zagan-bet-gui # debug | ||
| 80 | cargo build -p zagan-bet-gui --profile gui-release # release | ||
| 81 | cargo build -p zagan-bet-gui --target x86_64-pc-windows-gnu \ | ||
| 82 | --profile gui-release # Windows | ||
| 83 | ``` | ||
| 84 | |||
| 85 | `gui-release` is declared at the workspace root; a profile inside a member's | ||
| 86 | manifest would be ignored. Fonts are embedded, so there is no runtime asset | ||
| 87 | directory to ship. | ||
| 88 | |||
| 70 | ## Manual TUI checklist | 89 | ## Manual TUI checklist |
| 71 | 90 | ||
| 72 | There is no CI. Run this on Linux and on a Windows VM before a release. | 91 | There is no CI. Run this on Linux and on a Windows VM before a release. |
| @@ -97,6 +116,31 @@ Use an 80-column terminal because several output lines are width-sensitive. | |||
| 97 | under a single fingerprint, because the certificate key is the same. | 116 | under a single fingerprint, because the certificate key is the same. |
| 98 | 11. Windows: repeat 2-10 and confirm keys are not duplicated or printed twice. | 117 | 11. Windows: repeat 2-10 and confirm keys are not duplicated or printed twice. |
| 99 | 118 | ||
| 119 | ## Manual GUI checklist | ||
| 120 | |||
| 121 | The GUI is a style spike until Phase 4: the table and wheel are painted from a | ||
| 122 | demo `RouletteView`, and no network connection is made. Run it on Linux and on | ||
| 123 | Windows 10 before approving the look. | ||
| 124 | |||
| 125 | 1. `cargo run -p zagan-bet-gui` at 1440x900, then at 1920x1080. The header | ||
| 126 | keeps its right margin at both sizes and shows ONLINE, host, ping, account | ||
| 127 | and balance; the table is centred and the sidebar is full height. | ||
| 128 | 2. The felt shows 0, the 3x12 numbers, dozens, columns and the six outside | ||
| 129 | cells. Chips sit on their targets: a straight in the cell, a corner on the | ||
| 130 | lattice crossing, an outside bet in its box. | ||
| 131 | 3. Click a pocket: a chip of the selected denomination appears and the slip | ||
| 132 | gains a row. Chips are 10/25/50/100; the selected one has a cyan ring. | ||
| 133 | 4. Arrow keys move the cursor. Over the numbers the cyan marker sits on the | ||
| 134 | cell or lattice point and the covered cells tint; leaving the table walks | ||
| 135 | dozens, columns and outside. | ||
| 136 | 5. Space or SPIN animates the wheel for about 2.4 s and stops with the winning | ||
| 137 | pocket under the pointer. The winning cell gets a gold outline, RESULT names | ||
| 138 | the number and colour, and LAST gains a dot. SPIN is disabled during the | ||
| 139 | spin. | ||
| 140 | 6. Clear bets empties the slip and the total. Resize to 1100x720: the sidebar | ||
| 141 | scrolls, nothing overlaps the header, and the table keeps its aspect ratio. | ||
| 142 | 7. Compare the 1080p window against the approved reference screenshot. | ||
| 143 | |||
| 100 | ## Manual roulette checklist | 144 | ## Manual roulette checklist |
| 101 | 145 | ||
| 102 | 1. `play roulette` draws the full felt: 0, the 3x12 numbers, dozens, columns, | 146 | 1. `play roulette` draws the full felt: 0, the 3x12 numbers, dozens, columns, |
diff --git a/docs/screenshots/gui-roulette-1080p.png b/docs/screenshots/gui-roulette-1080p.png new file mode 100644 index 0000000..b6c9b17 --- /dev/null +++ b/docs/screenshots/gui-roulette-1080p.png | |||
| Binary files differ | |||
diff --git a/docs/screenshots/gui-roulette-result-1080p.png b/docs/screenshots/gui-roulette-result-1080p.png new file mode 100644 index 0000000..0f37133 --- /dev/null +++ b/docs/screenshots/gui-roulette-result-1080p.png | |||
| Binary files differ | |||
