Add error popup - #6
Conversation
|
Warning Review limit reached
Next review available in: 45 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds a dismissable error popup to the picker UI: ChangesError Popup Feature
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant PickerLoop
participant Backend
participant SurfaceModel
participant UI as render_surface
User->>PickerLoop: trigger action (activate/rename/kill/delete)
PickerLoop->>Backend: call backend operation
Backend-->>PickerLoop: Err(failure)
PickerLoop->>PickerLoop: set error, restore state, continue loop
PickerLoop->>SurfaceModel: build model with error
SurfaceModel->>UI: render_surface(model)
UI->>UI: render_error_popup(message)
User->>PickerLoop: press any key
PickerLoop->>PickerLoop: take() error, dismiss popup
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/wisp-bin/src/main.rs (1)
1891-1898: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winDismiss the error popup before translating the key
translate_keyreturnsNonefor every unhandledKeyCode—for exampleTab,Home,End,Delete, page keys, and function keys—so those keys never reacherror.take()and the popup stays open despite the “press any key to dismiss” copy. Move the modal dismissal before intent translation.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/wisp-bin/src/main.rs` around lines 1891 - 1898, The key handling in main’s event loop dismisses the error popup only after translate_key runs, so unhandled keys never clear the modal. Update the event flow around event::poll, event::read, and translate_key so the error.take() check happens immediately after reading a Key event and before translating it into an intent. Keep the modal-dismiss behavior in the same loop, but ensure any key press can close the popup regardless of whether translate_key recognizes the key.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/wisp-ui/src/lib.rs`:
- Around line 110-142: The popup sizing in the error rendering logic is
underestimating wrapped height because `message_len.div_ceil(inner_width)` does
not match `Paragraph::wrap(Wrap { trim: true })` word-based wrapping, which can
cause the dismiss hint to be clipped. Update the height calculation in the error
popup rendering path around `wrapped_lines`, `height`, and
`Paragraph::new(text)` to compute the body height using the same wrapping
behavior as `Paragraph`, and keep the “press any key to dismiss” line reserved
as its own row below the message.
---
Outside diff comments:
In `@crates/wisp-bin/src/main.rs`:
- Around line 1891-1898: The key handling in main’s event loop dismisses the
error popup only after translate_key runs, so unhandled keys never clear the
modal. Update the event flow around event::poll, event::read, and translate_key
so the error.take() check happens immediately after reading a Key event and
before translating it into an intent. Keep the modal-dismiss behavior in the
same loop, but ensure any key press can close the popup regardless of whether
translate_key recognizes the key.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: da649f5d-a7e3-4d38-9a5c-c394fde62c90
📒 Files selected for processing (2)
crates/wisp-bin/src/main.rscrates/wisp-ui/src/lib.rs
Summary by CodeRabbit