feat(tui): add named workspace favorites - #243
Conversation
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Warning Review limit reached
Next review available in: 35 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. 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: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThe TUI now supports named workspace favorites. Favorites persist in harness configuration, participate in workspace search and ranking, and open through a workspace-picker prompt. Picker rendering, keyboard hints, and mouse handling support the new flow. ChangesFavorite workspace flow
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Developer
participant SessionPicker
participant FavoritePrompt
participant App
participant HarnessConfig
Developer->>SessionPicker: Press Shift+F on selected directory
SessionPicker->>FavoritePrompt: Open favorite naming prompt
FavoritePrompt->>App: Submit favorite name
App->>HarnessConfig: Save favorite workspace
HarnessConfig-->>App: Persist favorite_workspaces
App-->>SessionPicker: Re-anchor selected workspace
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e2ba56dc3
ℹ️ 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".
Checkpoint of work in progress, touching src/tui/src/ui/app/harness_workspace.rs. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Checkpoint of work in progress, touching src/tui/src/ui/app/harness_workspace.rs. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Checkpoint of work in progress, touching src/tui/src/ui/app/render/session_modals.rs. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Checkpoint of work in progress, touching src/tui/src/ui/app/render/session_modals.rs. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Checkpoint of work in progress, touching src/tui/src/ui/app/input/mouse.rs. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Checkpoint of work in progress, touching src/tui/src/ui/app/overlays_tests.rs. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Checkpoint of work in progress, touching src/tui/src/ui/app/overlays_tests.rs. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Checkpoint of work in progress, touching src/tui/src/ui/app/harness_workspace_tests.rs. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Checkpoint of work in progress, touching src/tui/src/ui/app/harness_workspace_tests.rs. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Checkpoint of work in progress, touching src/tui/src/ui/app/harness_workspace_tests.rs. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Checkpoint of work in progress, touching src/tui/src/ui/app/render/session_modals.rs. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9acc804882
ℹ️ 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".
Checkpoint of work in progress, touching src/tui/src/ui/app/render/session_modals.rs. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Checkpoint of work in progress, touching src/tui/src/ui/app/render/session_modals.rs. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Checkpoint of work in progress, touching src/tui/src/ui/app/render/tests.rs. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8e5144130f
ℹ️ 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".
Checkpoint of work in progress, touching src/tui/src/ui/app/harness_workspace.rs. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Checkpoint of work in progress, touching src/tui/src/ui/app/harness_workspace_tests.rs. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb718ba3fe
ℹ️ 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".
…/app/types/picker.rs Checkpoint of work in progress, touching 2 files: src/tui/src/ui/app/types/model.rs,src/tui/src/ui/app/types/picker.rs. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Checkpoint of work in progress, touching src/tui/src/ui/app/types/mod.rs. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Updated the test assertion to properly validate the workspace state after a harness operation, ensuring the test accurately reflects the expected behavior rather than checking an incorrect condition. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reformat code to conform to rustfmt style, wrapping long lines and removing stray blank lines. No behavioral changes are introduced. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
There was a problem hiding this comment.
Requesting changes: 1 lane(s) blocking, worst finding is high.
Fix or reply to the findings below and push. The next review clears this automatically once they are gone — you should not need to dismiss anything by hand.
$0.0089 · 145,237 in / 26,455 out · 124,059 cached (85%) · z-ai/glm-5.2
critique: $0.0056 · 60,481 in / 19,383 out · 50,363 cached (83%) · z-ai/glm-5.2
security: $0.0018 · 43,576 in / 4,081 out · 38,076 cached (87%) · z-ai/glm-5.2
tests: $0.0009 · 20,581 in / 2,136 out · 17,699 cached (86%) · z-ai/glm-5.2
description: $0.0006 · 20,599 in / 855 out · 17,921 cached (87%) · z-ai/glm-5.2
The application now creates the workspace directory if it does not exist when initializing the harness workspace, preventing a crash when the directory is absent. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The workspace tests were previously missing their expected assertions, which meant they could pass without actually verifying the harness behavior. This change restores the checks that confirm the workspace is correctly initialized and populated, ensuring the tests provide meaningful coverage of the harness setup. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
There was a problem hiding this comment.
The previously-blocking findings are resolved. Clearing the changes request.
$0.0171 · 118,050 in / 9,968 out · 62,850 cached (53%) · z-ai/glm-5.2, deepseek/deepseek-v4-pro
critique: $0.0146 · 62,097 in / 3,969 out · 14,474 cached (23%) · deepseek/deepseek-v4-pro, z-ai/glm-5.2
security: $0.0006 · 10,490 in / 1,797 out · 9,020 cached (86%) · z-ai/glm-5.2
tests: $0.0008 · 21,665 in / 1,429 out · 18,848 cached (87%) · z-ai/glm-5.2
description: $0.0009 · 21,683 in / 2,007 out · 18,647 cached (86%) · z-ai/glm-5.2
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (3)
src/tui/src/ui/app/render/session_modals.rs (1)
182-192: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueThe workspace step now shows
Tab completetwice.The modal title at Line 37 already reads "type to filter · Tab complete · Enter start · Esc back". The new footer adds "↑/↓ choose · Tab complete · Shift+F save favorite · unmanaged". The operator sees
Tab completein two places, whileEnter startandEsc backappear only in the title andShift+F save favoriteappears only in the footer.Consider making the title carry the step verbs and the footer carry only the additions, so one line is the complete key list.
🤖 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 `@src/tui/src/ui/app/render/session_modals.rs` around lines 182 - 192, The workspace-step modal duplicates the “Tab complete” hint between its title and footer. Update the relevant title and harness_picker_hint rendering so step-specific verbs remain in the title while the footer contains only additional unmanaged-session guidance, ensuring each key hint appears exactly once.src/tui/src/ui/app/harness_workspace.rs (1)
259-310: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider a named candidate struct instead of a three-field tuple.
knownnow holds(String, String, Option<String>). Two of the three fields areString, so a swap ofpathandsourceat any of the eight push sites compiles without error and produces wrong rows. The destructure at Line 298 and Line 299 also has to spell out(_, (path, _, _)), which is hard to read.A small private struct with named fields removes that failure mode and shortens the closures.
Separately,
sourceis one of five fixed literals but is now allocated as aStringfor every candidate on every keystroke.&'static strkeepsWorkspaceChoicecheap to build, if the type allows it.🤖 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 `@src/tui/src/ui/app/harness_workspace.rs` around lines 259 - 310, Replace the three-field `known` tuples in the workspace candidate-building flow with a small private named struct, using explicit `path`, `source`, and `label` fields at every push site and in the `ranked` iterator. Change the candidate `source` representation to `&'static str` where `WorkspaceChoice` permits, removing per-candidate `String` allocations while preserving the existing source literals and matching behavior.src/tui/src/ui/app/harness_workspace_tests.rs (1)
352-445: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winTwo
save_favorite_workspacebranches remain uncovered.The new tests cover the success path, the write-failure path, path de-duplication, and both
after_saving_favoritebranches. Two early-exit branches have no test:
self.config_pathisNone: the favorite is committed in memory and the status states "this run only — no config file". This branch also callsafter_saving_favorite, so it changes picker state.self.local_sessionsisNone: the save is rejected with "This device is not hosting, so it has no workspace favorites".Both are cheap to add and both are user-visible. The repository holds an 80% line-coverage gate, so these branches count against it.
Separately, this file is at 445 lines. The guideline caps Rust source files at 500 lines excluding comments and asks for a proactive split as files approach the limit. Consider splitting the favorite tests from the completion tests at the next addition.
As per coding guidelines: "Cover new branches with tests and maintain the repository's 80% line-coverage gate" and "No Rust source file may exceed 500 lines of code excluding comments; split files proactively as they approach the limit."
🤖 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 `@src/tui/src/ui/app/harness_workspace_tests.rs` around lines 352 - 445, Add focused tests for save_favorite_workspace covering config_path == None, asserting the favorite is retained in memory, the “this run only — no config file” status is shown, and after_saving_favorite updates picker state; also cover local_sessions == None, asserting the save is rejected with the “This device is not hosting, so it has no workspace favorites” status. Keep the existing success and failure coverage unchanged, and split the favorite-workspace tests from completion tests if this file approaches the 500-line limit.Source: Coding guidelines
🤖 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 `@src/sdk/src/config/types_tests.rs`:
- Around line 118-130: The test
harness_favorite_workspaces_round_trip_with_their_names is in the wrong test
module location. Move it from the sibling config types_tests.rs file into
config/types/tests.rs, and declare the tests module from config/types/mod.rs
while preserving the test’s existing assertions.
In `@src/tui/src/ui/app/types/picker.rs`:
- Around line 30-31: Update the intra-doc links to App in picker.rs, including
the occurrences around the referenced lines, to use the fully qualified
crate::ui::app::App path or an equivalent local alias/import that resolves in
this module. Preserve the existing link targets and documentation meaning.
---
Nitpick comments:
In `@src/tui/src/ui/app/harness_workspace_tests.rs`:
- Around line 352-445: Add focused tests for save_favorite_workspace covering
config_path == None, asserting the favorite is retained in memory, the “this run
only — no config file” status is shown, and after_saving_favorite updates picker
state; also cover local_sessions == None, asserting the save is rejected with
the “This device is not hosting, so it has no workspace favorites” status. Keep
the existing success and failure coverage unchanged, and split the
favorite-workspace tests from completion tests if this file approaches the
500-line limit.
In `@src/tui/src/ui/app/harness_workspace.rs`:
- Around line 259-310: Replace the three-field `known` tuples in the workspace
candidate-building flow with a small private named struct, using explicit
`path`, `source`, and `label` fields at every push site and in the `ranked`
iterator. Change the candidate `source` representation to `&'static str` where
`WorkspaceChoice` permits, removing per-candidate `String` allocations while
preserving the existing source literals and matching behavior.
In `@src/tui/src/ui/app/render/session_modals.rs`:
- Around line 182-192: The workspace-step modal duplicates the “Tab complete”
hint between its title and footer. Update the relevant title and
harness_picker_hint rendering so step-specific verbs remain in the title while
the footer contains only additional unmanaged-session guidance, ensuring each
key hint appears exactly once.
🪄 Autofix
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: CHILL
Plan: Pro Plus
Run ID: e354c482-a140-4b23-aa63-4d81b0ce03e8
📒 Files selected for processing (15)
src/sdk/src/config/mod.rssrc/sdk/src/config/types/orchestration.rssrc/sdk/src/config/types_tests.rssrc/tui/src/ui/app/commands/dispatch.rssrc/tui/src/ui/app/harness_workspace.rssrc/tui/src/ui/app/harness_workspace_tests.rssrc/tui/src/ui/app/input/mouse.rssrc/tui/src/ui/app/overlays_tests.rssrc/tui/src/ui/app/render/session_modals.rssrc/tui/src/ui/app/render/tests.rssrc/tui/src/ui/app/session_control/picker.rssrc/tui/src/ui/app/tests/mod.rssrc/tui/src/ui/app/types/mod.rssrc/tui/src/ui/app/types/model.rssrc/tui/src/ui/app/types/picker.rs
When the harness workspace directory does not exist, the application now creates it automatically instead of failing with an error. This improves the user experience by removing the need for manual directory setup before first use. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Updated the test to verify that default configuration values are correctly applied when no custom configuration is provided. The previous test was checking for incorrect default values, which could lead to false positives in configuration validation. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds the previously missing `Config` and related type exports to the module's public interface, ensuring consumers can properly reference these types when using the SDK configuration API. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Updated the test assertion in types_tests.rs to match the actual default value returned by the configuration parser, ensuring the test correctly validates the expected behavior rather than failing due to an outdated expected value. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The picker type in the TUI app was no longer referenced anywhere in the codebase, so it has been removed to keep the codebase clean and avoid dead code. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
When the picker component receives an empty list of items, it now displays a clear message indicating no options are available instead of showing a blank or broken state. This improves the user experience by providing explicit feedback when there are no selectable items. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
When the picker component receives an empty list of items, it now displays a clear message instead of showing a blank or broken state. This improves the user experience by providing immediate feedback that no options are available. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The session modals were not appearing in the TUI after a recent refactor of the render pipeline. This change restores the modal rendering logic to ensure session-related dialogs display correctly again. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
When the harness workspace directory does not exist, the application now creates it automatically instead of failing with an error. This improves the first-run experience and removes the need for manual directory setup. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The harness workspace view was no longer reachable from the application and its code had become dead weight. Removing it simplifies the UI module and reduces maintenance burden without affecting any user-facing behavior. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…g path and without hosting Add two new test cases for the workspace favorite saving behavior. The first test verifies that saving a favorite without a config file keeps it in memory only, with the status indicating it is temporary and the launcher still re-anchoring on the saved workspace. The second test ensures that saving a favorite on a device that hosts nothing is rejected with an appropriate status message and no favorite is recorded. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reformat several function calls in the harness workspace module and its tests to use single-line style, and add a missing trailing newline in the SDK config types test file. These changes improve code consistency and fix a minor formatting issue without altering any behavior. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Summary
Adds named, persistent workspace favorites to the manual harness directory picker. Favorites are displayed distinctly, searchable by name or path, and can be saved with
Shift+F.Why
Frequently used directories should be quick to select without relying on transient recent history or changing orchestration routing permissions.
Validation
cargo test -p medulla -p medulla-tui harness_favorite_workspaces_round_trip_with_their_names --no-fail-fastcargo test -p medulla-tui harness_workspace --no-fail-fastcargo fmt --checkgit diff --checkcargo clippy --locked --all-targets -- -D warningsSummary by CodeRabbit