Skip to content

feat: add colourful CLI presentation - #8

Merged
davison merged 2 commits into
mainfrom
task/7-add-colours-and-icons-to-the-game-cli
Aug 24, 2026
Merged

davison merged 2 commits into
mainfrom
task/7-add-colours-and-icons-to-the-game-cli

Conversation

@davison

@davison davison commented Aug 24, 2026

Copy link
Copy Markdown
Owner

Closes #7

Summary

  • add a colourful icon-led interface for interactive terminals
  • preserve clean plain text for redirected/injected output, NO_COLOR, and TERM=dumb
  • cover styled output and fallback detection with unit tests
  • document colour behaviour and the opt-out

Requirements

This task has no directly assigned milestone requirement IDs. It fulfils the M2 goal of a visually engaging, accessible, and testable CLI.

Verification

  • python3 -m unittest -v
  • python3 -m py_compile numberguess.py tests/test_numberguess.py
  • deterministic styled CLI smoke run
  • git diff --check

Decisions

See the dependency-free styling and fallback decision recorded on #7.

@davison davison linked an issue Aug 24, 2026 that may be closed by this pull request
@davison

davison commented Aug 24, 2026

Copy link
Copy Markdown
Owner Author

Review finding addressed: The initial compatibility check assumed every interactive TTY could encode the Unicode icon set. An ASCII-configured pseudo-TTY disproved that premise and raised UnicodeEncodeError. The implementation now checks the stream encoding before enabling styled mode and has a regression test for ASCII output.

Deviation: Compatibility detection now includes output-encoding capability in addition to TTY, NO_COLOR, and TERM=dumb.
Why: This is required to fulfil the planned graceful plain-text fallback on terminals that cannot represent the icons.

@davison-review-bot davison-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed independently against task #7 and milestone #6. The encoding-aware fallback fixes the prior UnicodeEncodeError: an ASCII-encoded pseudo-TTY now remains plain and completes successfully. The full 10-test suite, py_compile, diff check, and current CI all pass; the diff matches the recorded plan and no blocking findings remain.

@davison
davison merged commit 6b47228 into main Aug 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add colours and icons to the game CLI

1 participant