fix: Slash Command Autocomplete vs. Auto-Execute Fix (#2257)#2275
fix: Slash Command Autocomplete vs. Auto-Execute Fix (#2257)#2275yunus25jmi1 wants to merge 1 commit intodocker:mainfrom
Conversation
a5614de to
68994bd
Compare
|
@yunus25jmi1 does it fix the the call of a skill with a slash command (#1819)? |
Yes, this is going to resolve the Issue #1819 |
c7a7fd8 to
0030b96
Compare
0030b96 to
68994bd
Compare
|
Hi @dgageot and maintainers, I noticed that PR #2325 by @joshbarrington also addresses issues #2257 and #1819 with a different implementation approach. This PR takes a simpler route by removing AutoComplete from the command interface and driving behavior directly through the Update function. Since both PRs aim to fix the same issues, could you please clarify which direction you'd prefer to proceed with? I'm happy to close #2275 in favor of #2325 if that's the preferred approach, or I can update my PR if needed. Thanks! |
krissetto
left a comment
There was a problem hiding this comment.
same concerns as i described here need to be addressed first
68994bd to
739b523
Compare
Updated Fix - Addressing Both PRs and the RegressionI've updated this PR with a unified fix that addresses:
Changes MadeThe fix implements a rule-based system in the completion.SelectedMsg handler:
Behavior After Fix
This fix combines the best of both approaches while ensuring @attachment UX remains intact. Build and tests pass. |
Addressing Both PRsI want to acknowledge @joshbarrington's PR #2325 which also addresses issues #2257 and #1819 with a different approach. My approach (#2275): Separated Tab and Enter key bindings with an flag in the completion component. Tab sets , Enter sets . Joshbarrington's approach (#2325): Removed from the command interface and drove behavior directly through the Update function. This unified fix combines the best of both:
This addresses @krissetto's feedback about not breaking @attachment functionality while fixing the slash command autocomplete issue. Build and tests pass. |
I have successfully implemented a root-cause fix for the issue where pressing Tab to autocomplete a slash command would immediately execute it instead of just completing the text. Root Cause Analysis: In pkg/tui/components/completion/completion.go, both Enter and Tab were bound to the same key binding, causing auto-submit completions (like slash commands) to execute immediately upon selection with either key. Solution Implemented: - Separate Tab and Enter key bindings in completion.go. - Tab now autocompletes text only (AutoExecute=false). - Enter executes the command (AutoExecute=true). - Updated editor.go to handle the AutoExecute flag. - Added comprehensive tests in pkg/tui/components/completion/autocomplete_test.go. Verification: - pkg/tui/components/completion tests: 6/6 PASS - pkg/tui/components/editor tests: PASS - Successful build of project and binary Fixes docker#2257
739b523 to
47f949b
Compare
Updated: Refactored to match joshbarrington's naming conventionI've refactored the variable naming to align with @joshbarrington's PR #2325:
The unified fix now includes:
Build and tests pass. |
I have successfully implemented a root-cause fix for the issue where pressing Tab to autocomplete a slash command would immediately execute it instead of just completing the text.
Root Cause Analysis:
In pkg/tui/components/completion/completion.go, both Enter and Tab were bound to the same key binding, causing auto-submit completions (like slash commands) to execute immediately upon selection with either key.
Solution Implemented:
Verification:
Fixes #2257