Interface refactor + breadcrumbs, reset, and options persistence - #7
Merged
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <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
Four previously-unpushed local commits, rebased onto current
main:↳ A 〉Bbreadcrumb trail; menu titles becomeSequence[str].chess.pyinto a newinterface/package (game.py,menu.py,input.py,draw.py).chess.pyshrinks from a monolith to a slim entry point.LabelStrEnumfor UI strings; add a "factory reset" entry that clears game state and resets the configuration.Configurationnow reads/writes~/.chessrc; settinglog_stylepersists immediately. Includes round-trip tests (write-on-create, read-existing, set-persists-and-reloads) and an autouse fixture that isolatesPath.home()totmp_pathso 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:case key if 0 <= key < 0x100guard infileprompt(PR Add UI tests for chess.py and fix four latent bugs they exposed #1)panel.hide()runs once ondisplay()exit, not after every keypress (PR Add UI tests for chess.py and fix four latent bugs they exposed #1)len(self.pages) - 1clamp inMenu.navigate()(PR Add cli.py UI tests, mark slow PGN tests, fix promotion filter #2)self.items = list(items)to avoid shared-list mutation (PR Add cli.py UI tests, mark slow PGN tests, fix promotion filter #2)Also standardized on
from curses import window as Windowthroughout (removed the now-redundantinterface/curses.pyTYPE_CHECKINGshim), and keptChess._filepromptas a thin wrapper overinterface.input.filepromptso existing monkey-patching tests work unchanged.Test plan
import chesssucceeds against the new package layoutpython chess.pyand exercise new game / save / load / options / factory reset / about~/.chessrcis created on first run and re-read on subsequent runs🤖 Generated with Claude Code