Skip to content

Interface refactor + breadcrumbs, reset, and options persistence - #7

Merged
BrandonZacharie merged 5 commits into
mainfrom
feature/local-unpushed-work
May 29, 2026
Merged

Interface refactor + breadcrumbs, reset, and options persistence#7
BrandonZacharie merged 5 commits into
mainfrom
feature/local-unpushed-work

Conversation

@BrandonZacharie

Copy link
Copy Markdown
Owner

Summary

Four previously-unpushed local commits, rebased onto current main:

  • Show breadcrumbs for fileprompts — replace flat menu titles with a ↳ A 〉B breadcrumb trail; menu titles become Sequence[str].
  • Refactor to organize interface logic — extract curses-facing code from chess.py into a new interface/ package (game.py, menu.py, input.py, draw.py). chess.py shrinks from a monolith to a slim entry point.
  • Add menu option to reset config — introduce a Label StrEnum for UI strings; add a "factory reset" entry that clears game state and resets the configuration.
  • Persist options file to user home directoryConfiguration now reads/writes ~/.chessrc; setting log_style persists immediately. Includes round-trip tests (write-on-create, read-existing, set-persists-and-reloads) and an autouse fixture that isolates Path.home() to tmp_path so tests don't touch the real home directory.

Notes on the rebase

The refactor commit predated several merged PRs, so straight replay would have silently regressed them. Carried forward into the new interface/ modules:

Also standardized on from curses import window as Window throughout (removed the now-redundant interface/curses.py TYPE_CHECKING shim), and kept Chess._fileprompt as a thin wrapper over interface.input.fileprompt so existing monkey-patching tests work unchanged.

Test plan

  • Full test suite passes (216 passed, 2 deselected)
  • import chess succeeds against the new package layout
  • Manual smoke: run python chess.py and exercise new game / save / load / options / factory reset / about
  • Confirm ~/.chessrc is created on first run and re-read on subsequent runs

🤖 Generated with Claude Code

@BrandonZacharie
BrandonZacharie merged commit aa775c9 into main May 29, 2026
3 checks passed
@BrandonZacharie
BrandonZacharie deleted the feature/local-unpushed-work branch May 29, 2026 20:42
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.

1 participant