fix(cosh-ng): [shell] review marked on enter - #2274
Conversation
There was a problem hiding this comment.
[P1] 标记状态下 Enter 归一化逻辑过于依赖 pending_panel 匹配,部分场景仍可能误触发 resume,建议基于 selected_for_clear 显式覆盖 Enter 的行为路径。
🤖 Generated by Qoder • View workflow run
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb1e6fef55
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
cb1e6fe to
f579a19
Compare
- Emit marked Enter as non-releasing delete at the raw capture source. - Keep unmarked resume behavior and make picker hints state-aware. - Cover capture ownership and width-agnostic picker rendering. Fixes: 0e8ca63 ("feat(cosh-ng): add interactive session recovery") Signed-off-by: kongche-jbw <kongche.jbw@alibaba-inc.com>
f579a19 to
e09c401
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e09c4017c3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if *has_clear_marks { | ||
| return Some(RawInputEvent::SessionDelete(id.clone())); |
There was a problem hiding this comment.
Re-evaluate Enter after queued mark toggles
When Space and Enter arrive in one raw-input read, as can happen with fast typing or pasted input, consume_split first queues SessionToggle but submit still consults this immutable pre-toggle has_clear_marks value. Starting unmarked therefore queues a toggle followed by SessionResume, so the main loop marks the row and then closes the picker by resuming it—the exact unintended action this change is meant to prevent; unmarking the final row and pressing Enter in the same read has the inverse stale-state problem. Defer Enter until the toggle has updated the capture, or track the effective mark state while consuming the chunk.
Useful? React with 👍 / 👎.
Why
Marking sessions for clear and pressing Enter resumed the focused session
instead of entering the clear-confirmation flow. This contradicted the picker
state and could select a session when the user intended to clear marked items.
What changed
Related issue
closes #1709
User / Agent impact
With marked sessions, Enter now opens clear confirmation and a second Enter or
yperforms the clear. Without marks, Enter continues to resume the focusedsession.
Risk and compatibility
The interactive Enter behavior changes only while clear marks exist. Existing
protection filtering, multi-select clearing, confirmation, and
dbehavior arereused unchanged.
Validation
cargo fmt --all -- --checkcargo test --package cosh-shell --lib(1278 passed)cargo test --package cosh-shell --test logic(9 passed)cargo test --package cosh-shell --test raw_cli session::raw_cli_session_picker_space_then_enter_confirms_and_deletes_without_resuming -- --exactcrates/cosh-shell/scripts/check-layout.shDocumentation and rollback
No standalone documentation changes are required because the picker footer is
updated with the behavior. Revert commit
cb1e6fefto restore the previousEnter behavior.