From 10ff558853f549d3f3c7c8432488bfad9da6973a Mon Sep 17 00:00:00 2001 From: salmonik Date: Sun, 1 Nov 2026 19:58:59 +0100 Subject: 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. --- docs/TESTING.md | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) (limited to 'docs/TESTING.md') 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 @@ ## Automated suite ```sh -cargo test +cargo test --workspace ``` The suite is deterministic and headless: no network, no PTY, no sleeps, no @@ -46,10 +46,14 @@ or a vendored OpenSSL. | `tests/slots.rs` | Server slots payout rules and overflow handling. | | `tests/storage.rs` | Client/server SQLite storage helpers. | | `tests/tofu.rs` | SPKI fingerprint and TOFU decisions. | +| `gui/tests/layout.rs` | GUI presentation maths: money grouping, wheel angle, table aspect, bet names. | `tests/tofu.rs` and `tests/server_setup.rs` shell out to `openssl`, so run them on a machine where the `openssl` CLI is available. +The GUI has its own integration tests because the root package cannot depend on +the GUI (`gui/tests/`); `cargo test --workspace` runs both halves. + ## Development resets The server creates `server.db` in its working directory. The client keeps @@ -67,6 +71,21 @@ rm -rf ~/.local/share/zagan-bet The audit schema is not auto-migrated from the pre-2.0 slots-only `plays` table. Starting against an old database will fail until it is removed. +## Building the GUI + +The GUI is a workspace member, so it never enters the TUI or server build graph: + +```sh +cargo build -p zagan-bet-gui # debug +cargo build -p zagan-bet-gui --profile gui-release # release +cargo build -p zagan-bet-gui --target x86_64-pc-windows-gnu \ + --profile gui-release # Windows +``` + +`gui-release` is declared at the workspace root; a profile inside a member's +manifest would be ignored. Fonts are embedded, so there is no runtime asset +directory to ship. + ## Manual TUI checklist 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. under a single fingerprint, because the certificate key is the same. 11. Windows: repeat 2-10 and confirm keys are not duplicated or printed twice. +## Manual GUI checklist + +The GUI is a style spike until Phase 4: the table and wheel are painted from a +demo `RouletteView`, and no network connection is made. Run it on Linux and on +Windows 10 before approving the look. + +1. `cargo run -p zagan-bet-gui` at 1440x900, then at 1920x1080. The header + keeps its right margin at both sizes and shows ONLINE, host, ping, account + and balance; the table is centred and the sidebar is full height. +2. The felt shows 0, the 3x12 numbers, dozens, columns and the six outside + cells. Chips sit on their targets: a straight in the cell, a corner on the + lattice crossing, an outside bet in its box. +3. Click a pocket: a chip of the selected denomination appears and the slip + gains a row. Chips are 10/25/50/100; the selected one has a cyan ring. +4. Arrow keys move the cursor. Over the numbers the cyan marker sits on the + cell or lattice point and the covered cells tint; leaving the table walks + dozens, columns and outside. +5. Space or SPIN animates the wheel for about 2.4 s and stops with the winning + pocket under the pointer. The winning cell gets a gold outline, RESULT names + the number and colour, and LAST gains a dot. SPIN is disabled during the + spin. +6. Clear bets empties the slip and the total. Resize to 1100x720: the sidebar + scrolls, nothing overlaps the header, and the table keeps its aspect ratio. +7. Compare the 1080p window against the approved reference screenshot. + ## Manual roulette checklist 1. `play roulette` draws the full felt: 0, the 3x12 numbers, dozens, columns, -- cgit v1.2.3