Improve ECA Menu UX and Streamline Workflow#245
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refines the Emacs Code Assistant (ECA) integration in ai-code-interface.el by improving transient menu UX, making ECA session startup behaviors more distinct, and adjusting upgrade workflows to be more user-directed.
Changes:
- Updates ECA transient menu labels, key ordering, and backend-specific menu injection behavior.
- Changes ECA “start for project” flow to always prompt for a workspace root (instead of overloading prefix-arg behavior).
- Switches the backend
:upgradeentry to open the upgrade status UI (ai-code-eca-upgrade-show) and updates tests accordingly.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
ai-code-eca.el |
Updates ECA menu text/order, gates menu injection on selected backend, revises workspace-session start flow, and streamlines package upgrade confirmation. |
ai-code-backends.el |
Points ECA backend :upgrade to ai-code-eca-upgrade-show. |
test/test_ai-code-eca.el |
Updates menu-group tests for backend gating, layout keys reorder, and batch-mode transient availability. |
test/test_ai-code-backends.el |
Updates backend spec contract test to match new :upgrade function. |
- Upgrade menu now shows status buffer instead of running binary upgrade directly - Distinct behavior for E vs a: E always prompts for workspace, a reuses existing session - Clearer menu descriptions for ECA commands - Removed y-or-n-p confirmation from package upgrade (user already clicked upgrade button) - Added backend check to ai-code-eca--add-menu-group - Fixed tests to handle batch mode limitations
|
please help review and feed back |
|
codex-cli reported two high level points to look into.
Let me know when it is ready to merge. |
|
@davidwuchn 你的PR summary很漂亮, 这是怎么做的? |
Issue #1: ai-code-upgrade-backend was not forwarding prefix arg - Added optional ARG parameter - Use call-interactively with current-prefix-arg to forward prefix Issue #2: ai-code-eca-create-session-for-workspace always created new sessions - Added ai-code-eca--find-session-by-workspace to find existing sessions - Reuse existing session if workspace matches instead of creating new - Fixes duplicate session problem reported by codex-cli Tests: Added tests for prefix forwarding and session finding
Fixes AppliedIssue #1: Prefix arg not forwarded ✅File: Fix: Added (defun ai-code-upgrade-backend (&optional arg)
(interactive "P")
...
(let ((current-prefix-arg arg))
(call-interactively upgrade))
...)Now Issue #2: Session not reused ✅File: Fix: Added (defun ai-code-eca--find-session-by-workspace (workspace-root)
"Find an existing session that has WORKSPACE-ROOT in its workspace folders."
(when (boundp 'eca--sessions)
(let ((target (expand-file-name workspace-root)))
(cl-find-if
(lambda (session)
(member target (mapcar #'expand-file-name
(eca--session-workspace-folders session))))
(eca-vals eca--sessions)))))If a session exists with the selected workspace, it's reused instead of creating a duplicate. Tests Added
|
Summary
This PR improves the ECA menu user experience with clearer descriptions, streamlined workflows, and better differentiation between similar commands.
Changes
1. Upgrade Menu Shows Status Buffer by Default
ai-code-eca-upgradeto show status buffer by default (no prefix arg)C-c a unow shows the ECA upgrade status bufferC-u C-c a uupgrades the ECA binary from GitHub releasesC-u C-u C-c a uupgrades the ECA Emacs package2. Distinct Behavior for
EvsaC-c a a(Start AI CLI): Quick start - reuses existing session if availableC-c a E(Start ECA for project): Always prompts for workspace selection3. Clearer Menu Descriptions
EDAXFMB4. Streamlined Package Upgrade
y-or-n-pprompt fromai-code-eca-upgrade-package5. Menu Item Reorder
B(Add clipboard as file context) aboveY(Clear shared) for logical grouping of "add" actions6. Backend Check in Menu Addition
ai-code-eca--add-menu-groupnow checks if ECA is the selected backend before adding menu items7. Safe Project Detection
ai-code-eca-create-session-for-workspaceto safely handle cases where no project is detectedFiles Changed
ai-code-eca.el- All UX improvementstest/test_ai-code-eca.el- Test fixesTesting