Make Escape activate No on the update-available dialog#14
Open
blindndangerous wants to merge 4 commits intomasonasons:masterfrom
Open
Make Escape activate No on the update-available dialog#14blindndangerous wants to merge 4 commits intomasonasons:masterfrom
blindndangerous wants to merge 4 commits intomasonasons:masterfrom
Conversation
Adds no_default parameter to question() and question_from_thread(). The update check passes no_default=True so No is the default button — pressing Escape (or Enter) declines the update instead of accepting it. All other yes/no dialogs in the app are unaffected. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
conftest.py adds the project root to sys.path so top-level modules (config, repo_sync, etc.) are importable from the tests/ subdirectory. pytest.ini sets --basetemp=.pytest_tmp to avoid Windows temp-dir permission errors when using the tmp_path fixture. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove wx.NO_DEFAULT — it made No the default button so Enter would activate No immediately, which was wrong. Standard wx.YES_NO keeps Yes as the default (Enter = Yes, Tab to No then Enter = No). When the user presses Escape on a YES_NO dialog, wx returns ID_CANCEL which is not ID_YES, so question() already returns 2 (No) — no special handling needed. Applies to all yes/no dialogs including the update-available prompt. Co-Authored-By: Claude Sonnet 4.6 <claude[bot]@users.noreply.github.com>
10 tests: Yes click returns 1, No click returns 2, Escape (ID_CANCEL) returns 2, dialog style never includes NO_DEFAULT flag (Yes stays default), dialog is always destroyed, question_from_thread() maps all three paths correctly when invoked via CallAfter. Co-Authored-By: Claude Sonnet 4.6 <claude[bot]@users.noreply.github.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
ID_CANCELwhen Escape is pressed on a dialog with no Cancel button, andquestion()already treats any non-ID_YESresult as Nono_default=True/wx.NO_DEFAULTapproach from the previous attempt, which incorrectly made No the default (Enter = No)How it works
wx.MessageDialogwithwx.YES_NOshows Yes as the default button. When the user presses Escape, wx returnswx.ID_CANCEL(notwx.ID_YESorwx.ID_NO). Sincequestion()only returns 1 forID_YESand 2 for everything else, Escape naturally becomes No — no extra flags needed.Test plan
pytest tests/test_application_question.py→ 10 passedNO_DEFAULT(Yes stays default)question_from_thread()maps all three paths correctly🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.6 <claude[bot]@users.noreply.github.com>
Human Testing Verification: blindndangerous