Repository navigation
Open
Labels
area: tuiTextual terminal user interfacebugSomething isn't workingdev sprintPythonlings Community Dev Sprint August 2026help wantedExtra attention is neededsize: MMedium, self-contained contribution
Description
Motivation
F2 currently resets learner code immediately. Reset is destructive from a learner perspective, so the default TUI path must make cancellation easy and failures visible.
Current evidence
- The documented interface maps
F2to reset the current exercise. - Reset snapshots live under
.pythonlings/originals/, and reset failures are possible when a snapshot is missing or unreadable. - The TUI suite already uses Textual pilot tests for interactive behaviour.
Exact scope
Add a safe-default confirmation modal for F2 reset. y confirms; n and Esc cancel. Reset errors must render visibly in the TUI instead of propagating as a crash.
Acceptance checklist
- Pressing F2 opens a confirmation modal before any learner file is changed.
-
yperforms the reset and refreshes the current exercise view. -
nand Esc cancel without changing the learner file or progress state. - Missing/broken reset snapshots show an actionable visible error and leave the TUI running.
- Focus and key handling remain predictable while the modal is open.
- Textual pilot tests cover confirm, cancel via
n, cancel via Esc, and visible reset failure.
Explicit exclusions
Do not change CLI pythonlings reset confirmation semantics, add a bulk-reset flow, auto-save destructive changes, or redesign unrelated TUI navigation.
Likely files
pythonlings/screens/track.pyand/orpythonlings/app.pypythonlings/widgets/orpythonlings/screens/modal component (new as needed)pythonlings/pythonlings.tcsstests/tui/test_app_pilot.py
Verification
python -m pytest tests/tui -q
python -m pytest -qManually run the TUI against a fixture workspace and exercise confirm, both cancel keys, and a deliberately missing snapshot.
Sprint coordination
See the sprint Discussion. This issue is unassigned and is not a reservation.
Reacted by coderabbitai
Metadata
Metadata
Assignees
Labels
area: tuiTextual terminal user interfacebugSomething isn't workingdev sprintPythonlings Community Dev Sprint August 2026help wantedExtra attention is neededsize: MMedium, self-contained contribution
Activity
coderabbitai commentedon Aug 9, 2026
🔗 Related PRs
#31 - feat: overall progress, completion celebration, first-launch welcome (
#14,#15,#16) [merged]📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!