feat(ui): add default selection to menus and unify ESC cancellation b…#7
Merged
feat(ui): add default selection to menus and unify ESC cancellation b…#7
Conversation
added 3 commits
July 21, 2025 01:45
…ehavior - Add select_with_default() method to UserInterface trait - Set default selection to first item (position 0) for all menus - Fix ESC cancellation to return Ok(false) instead of error in switch_worktree - Improve error handling for input operations in rename_worktree - Add #[allow(dead_code)] to unused select() method This improves user experience by having a default selection in all menus and provides consistent behavior when users press ESC to cancel operations.
…stants - Add 150+ new constants to constants.rs for all UI messages and prompts - Replace hardcoded strings in file_copy.rs with named constants - Update git.rs to use TIME_FORMAT constant - Update all test files to use constants instead of literals - Fix EMOJI_DETACHED constant to match test expectations This improves maintainability by centralizing all string literals and makes the codebase more consistent and easier to update.
- Fix worktree detection to check if .git is a file (not directory) - Add path normalization to resolve '..' components in commondir - Display parent repository name in format 'parent-repo (worktree-name)' - Update tests to handle new worktree detection logic - Bump version to 0.6.0 - Add .windsurf to .gitignore This fixes the issue where worktrees only showed their own name instead of the parent repository name with worktree name in parentheses.
added 2 commits
July 21, 2025 01:55
The test now expects worktrees to display parent repository name with worktree name in format 'parent-repo (worktree-name)' instead of just the worktree name alone.
Update test expectations to match the new display format where worktrees show 'parent-repo (worktree-name)' instead of just the worktree name. This fixes CI failures on both macOS and Ubuntu runners.
📊 CI Results✅ All Checks Passed 📋 Coverage & Testing
🎯 Quality Metrics❌ Coverage: 29.2% 🚀 Build Status
📦 Test Suite Optimization
|
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.
Description
This PR introduces significant UI/UX improvements to git-workers by adding default menu selections and unifying ESC cancellation behavior across all interactive operations.
What's Changed
Default Menu Selection
select_with_default()method to UserInterface traitUnified ESC Cancellation Behavior
switch_worktreenow returnsOk(false)instead of error when user cancelsrename_worktreefor input and confirmation operationsCode Quality Improvements
Type of Change
Testing
cargo testChecklist
cargo fmt)cargo clippy)Screenshots (if applicable)
Please add screenshots to help explain your changes.