Preview zoxide#3
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughRoutes previews through a new CombinedPreviewProvider, adds zoxide directory matches as SessionListItemKind::Zoxide, changes session creation to create_session_with_basename (basename or basename+hash from canonical path), updates picker filtering/preview generation for zoxide, and adjusts tests/stubs accordingly. Changes
Sequence DiagramsequenceDiagram
actor User
participant Input as Filter Input
participant Zoxide as Zoxide
participant Picker as Picker / SessionList
participant Preview as CombinedPreviewProvider
participant Tmux as Tmux Client
participant Creator as create_session_with_basename
User->>Input: type query
Input->>Zoxide: query_directory(trimmed_query)
Zoxide-->>Input: directory match (path) / none
Input->>Picker: append SessionListItem(kind=Zoxide) if match
Picker->>Preview: request preview for selected item
Preview-->>Picker: render preview (dir/file/session) or "preview not supported"
User->>Picker: select Zoxide item
Picker->>Tmux: list_sessions()
Tmux-->>Picker: existing session names
Picker->>Creator: create_session_with_basename(basename, path)
Creator->>Tmux: create/attach session (basename or basename-hash) at canonicalized path
Tmux-->>User: session created/attached
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
1 similar comment
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
1 similar comment
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
1 similar comment
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
1 similar comment
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
1 similar comment
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@crates/wisp-bin/src/main.rs`:
- Around line 877-879: The zoxide.query_directory(&query) call is being invoked
on every UI redraw when InputMode::Filter is active, causing repeated
shell/zoxide invocations; introduce a small cache (e.g., last_query: String and
last_zoxide_match: Option<...>) at the enclosing scope (where the main UI loop
and InputMode::Filter handling live) and only call
zoxide.query_directory(&query) when query.trim() != last_query.trim(); update
last_query and last_zoxide_match when you perform the lookup, and use
last_zoxide_match in place of re-calling zoxide.query_directory (preserving the
existing handling of Ok(Some(zoxide_match))). Ensure comparisons use trimmed
query and handle clearing the cache when the filter becomes empty or InputMode
changes.
- Around line 877-905: The zoxide match is being pushed into filtered
unconditionally when InputMode::Filter is active, which lets zoxide directories
appear even in worktree-only picker mode; update the condition that wraps the
zoxide.query_directory and filtered.push (the block creating SessionListItem) to
also require the picker mode be PickerMode::AllSessions (or the equivalent
variable representing the current PickerMode) before adding the zoxide item, so
that in worktree-only mode the zoxide row is skipped (or alternatively, change
the picker mode contract and associated help text if surfacing zoxide entries in
worktree mode is intended).
In `@crates/wisp-core/src/view.rs`:
- Line 84: The preview code currently treats SessionListItemKind::Zoxide as an
unknown kind and falls through to the session-preview branch; update
generate_preview to add a dedicated arm/case for SessionListItemKind::Zoxide
that uses the entry's worktree_path to produce a directory preview (instead of
constructing a synthetic tmux session like "zoxide:/..."). Locate the
generate_preview function and the match on SessionListItemKind, add a branch for
Zoxide that calls the same directory-preview logic used for worktree entries
(using worktree_path) so highlighting a Zoxide row shows the directory contents.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 3c571b31-1873-42cf-bb27-0474714dac05
📒 Files selected for processing (3)
crates/wisp-bin/src/main.rscrates/wisp-core/src/view.rscrates/wisp-ui/src/lib.rs
|
@coderabbitai review |
1 similar comment
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
1 similar comment
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@crates/wisp-bin/src/git.rs`:
- Around line 224-226: The temp cleanup currently swallows errors from
fs::remove_dir_all when removing `path`, which can leave stale files; change
this to handle the Result: call fs::remove_dir_all(&path) and if it Errs,
inspect the io::ErrorKind — ignore only NotFound but return/propagate or panic
on any other error so tests fail fast; update the code around the existing
path.exists() / fs::remove_dir_all call to check and handle the error instead of
discarding it.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: b298cf8d-7a5b-4c52-b5d7-0297034d917d
📒 Files selected for processing (4)
crates/wisp-bin/src/git.rscrates/wisp-bin/src/main.rscrates/wisp-core/src/view.rscrates/wisp-ui/src/lib.rs
Summary by CodeRabbit
New Features
Tests