feat(tui): add terminal UI layer with ratatui - #58
Open
Xaxxoo wants to merge 1 commit into
Open
Conversation
Add a TUI module (`src/tui/mod.rs`) built on ratatui and crossterm with bordered panels, colour-coded difficulty indicators, countdown timer progress bar, real-time score display, and keyboard shortcut footer. The existing CLI module is preserved as a `--no-tui` fallback flag. Fixes pre-existing build errors (duplicate module declarations, missing time module, clippy warnings). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ratatuiandcrosstermas native-only dependencies inCargo.tomltuimodule (src/tui/mod.rs) with full TUI rendering components:PuzzleViewwith bordered panels showing title, description, difficulty badge, and remaining hintsTimerBarcountdown timer as a progress bar (Gauge widget)ScoreDisplaywith real-time score updates and colour codingFooterBarwith persistent keyboard shortcuts (h=Hint, Enter=Submit, q=Quit, ?=Help)TuiAppstate management struct with tick-based timer, auto-fail on expiry--no-tuiCLI flag preserves the existing CLI module for headless environments#[cfg(not(feature = "wasm"))]for WASM compatibilitytimemodule, clippy warnings)Test plan
cargo test)cargo clippy -- -D warningspasses cleancargo fmt --checkpasses cleanCloses #41
🤖 Generated with Claude Code