feat(tui): group and sort the Agents sidebar from Appearance - #230
Conversation
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe PR adds Agents-sidebar grouping and sorting configuration. It exposes the settings through appearance controls, persists them, organizes rail sections and sessions, renders group headers, preserves selection behavior, and adds coverage for organization and paging. ChangesAgents sidebar configuration
Agents rail organization
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Operator
participant AppearanceSettings
participant AppearanceConfig
participant RailOrganizer
participant RailRenderer
Operator->>AppearanceSettings: select grouping or sorting
AppearanceSettings->>AppearanceConfig: update and persist setting
AppearanceConfig->>RailOrganizer: provide sidebar configuration
RailOrganizer->>RailRenderer: return ordered sections and sessions
RailRenderer-->>Operator: render grouped Agents sidebar
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5594d653f5
ℹ️ 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".
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.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/tui/src/ui/app/rail/organize_tests.rs`:
- Around line 143-152: Add tests in the existing organize-tests module covering
SidebarSort::Recent for agent ordering via sort_agents and section ordering via
order_sections. Use deterministic fixtures with distinct activity timestamps,
including agents and path or harness groups, and assert the expected
recent-first ordering while preserving existing session coverage.
🪄 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
Run ID: d6303295-ba0e-4a89-a2b9-ab177eb5f513
📒 Files selected for processing (17)
config.example.tomlgitbooks/developers/configuration.mdsrc/sdk/src/config/appearance/mod.rssrc/sdk/src/config/appearance/types.rssrc/sdk/src/config/mod.rssrc/sdk/src/config/types_tests.rssrc/tui/src/ui/app/appearance.rssrc/tui/src/ui/app/rail/cursor.rssrc/tui/src/ui/app/rail/mod.rssrc/tui/src/ui/app/rail/organize.rssrc/tui/src/ui/app/rail/organize_tests.rssrc/tui/src/ui/app/rail/tests.rssrc/tui/src/ui/app/rail/types.rssrc/tui/src/ui/app/render/agents/rail/mod.rssrc/tui/src/ui/app/render/agents/summary.rssrc/tui/src/ui/app/render/settings/appearance_usage.rssrc/tui/tests/feature_settings.rs
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d8489551ee
ℹ️ 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".
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: 1e2adaacfc
ℹ️ 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".
The organize step now flattens host sections before applying path or harness grouping, and sorts by declaration order when the sidebar sort is set to Created. This prevents agents from different hosts from being interleaved in a way that breaks the intended declaration order. 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: fe6323187a
ℹ️ 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".
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
medulla/src/tui/src/ui/app/rail/mod.rs
Line 697 in bba2703
When a task beyond task_limit is retained because it is anchored or has an active workflow run, group.hidden still includes that now-visible task. The rail therefore overstates +N more, and if every nominally hidden task is retained it presents an overflow action even though no task is actually omitted; derive the hidden count and overflow state from the filtered task set instead of reusing the fold's pre-retention values.
ℹ️ 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".
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: af0ee14e81
ℹ️ 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".
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.
Actionable comments posted: 2
🤖 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/tui/src/ui/app/rail/merge_tests.rs`:
- Around line 169-188: Update the test setup around owner and push_group to
assign distinct last_at timestamps to the tasks, then invoke sort_sessions with
SidebarSort::Recent before calling push_group. Preserve the existing
anchor-retention assertions while ensuring the test exercises the Recent sorting
path.
In `@src/tui/src/ui/app/rail/mod.rs`:
- Around line 639-705: Move the task paging and rendering logic from push_group
into a cohesive child module such as paging.rs, including visible-task
selection, pinned-anchor retention, workflow-run retention, overflow
calculation, and row emission. Keep mod.rs limited to module documentation,
child-module declarations, re-exports, and a thin wiring call to the new
implementation, preserving push_group behavior and its existing inputs and
outputs.
🪄 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
Run ID: 09a1b6f7-3cdb-4cd9-bda1-1502b0ef9724
📒 Files selected for processing (5)
src/tui/src/ui/app/rail/merge_tests.rssrc/tui/src/ui/app/rail/mod.rssrc/tui/src/ui/app/rail/organize/mod.rssrc/tui/src/ui/app/rail/organize/tests.rssrc/tui/src/ui/app/rail/organize/types.rs
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: 6ba749c3e8
ℹ️ 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".
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/tui/src/ui/app/rail/paging/tests.rs`:
- Around line 84-89: Update the test around split_fold to match its current
return contract: assign the result directly to groups rather than destructuring
a tuple, then replace the nonexistent group.visible_tasks assertion with a check
that group.sessions.len() equals 10. Preserve the existing hidden and overflow
assertions.
In `@src/tui/src/ui/app/render/sessions/rail/mod.rs`:
- Around line 270-275: Move rail row rendering, including rail_row_line and its
related formatting logic, from mod.rs into a focused child module such as
rows.rs. Keep mod.rs limited to module documentation, declarations, and wiring,
and update references/imports so the existing rendering behavior remains
unchanged.
🪄 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
Run ID: fcf7db7a-3f02-47f6-9721-89d2235c4b84
📒 Files selected for processing (13)
config.example.tomlgitbooks/developers/configuration.mdsrc/tui/src/ui/app/rail/cursor.rssrc/tui/src/ui/app/rail/merge_tests.rssrc/tui/src/ui/app/rail/mod.rssrc/tui/src/ui/app/rail/organize/mod.rssrc/tui/src/ui/app/rail/organize/tests.rssrc/tui/src/ui/app/rail/paging/tests.rssrc/tui/src/ui/app/rail/tests.rssrc/tui/src/ui/app/rail/types.rssrc/tui/src/ui/app/render/sessions/rail/mod.rssrc/tui/src/ui/app/render/settings/appearance_usage.rssrc/tui/tests/feature_settings.rs
🚧 Files skipped from review as they are similar to previous changes (8)
- config.example.toml
- gitbooks/developers/configuration.md
- src/tui/src/ui/app/rail/cursor.rs
- src/tui/src/ui/app/render/settings/appearance_usage.rs
- src/tui/tests/feature_settings.rs
- src/tui/src/ui/app/rail/organize/mod.rs
- src/tui/src/ui/app/rail/organize/tests.rs
- src/tui/src/ui/app/rail/mod.rs
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cca1e7a729
ℹ️ 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".
The rail now builds agent group sessions directly from ordered lane tasks instead of flattening pre-assembled agent rows, which simplifies the split_fold logic and removes the need for the offers_session parameter in paging. This change also introduces a visible_tasks field to track how many task-backed sessions the lane pager reveals, and replaces the Lane overflow row with a dedicated Overflow variant. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The rail row rendering functions were moved from the main rail module into the dedicated rows module to keep related formatting logic together. The test call site was updated to pass the new empty lanes argument. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds a regression test verifying that paging applies name sorting before selecting which tasks are visible, ensuring the correct task appears when the group has hidden and overflow tasks. Auto-committed-on: dragonfly 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.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cfd468ce7a
ℹ️ 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".
Updated the module-level documentation to more accurately describe the types as covering appearance configuration for resource displays and the Agents-sidebar layout, rather than only resource display formats. Auto-committed-on: dragonfly 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.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb9d30797a
ℹ️ 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".
When retaining a task consumes the final hidden row, the overflow anchor can no longer be retained. Previously, resolving by the old offset would select the newly revealed task; now the cursor relocates to the lane's first remaining row, which is stable as sessions appear beneath it. This also removes the now-unused `agent_rows_in` helper and `push_sessions` function. 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: ba6c84d631
ℹ️ 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".
The module documentation now reflects the addition of a grouping heading between hosts and sessions in the row taxonomy, updating the description of the tree shape and the list of possible row types. Auto-committed-on: dragonfly 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.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c314b2e8c5
ℹ️ 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".
The rail previously dropped a second declared host from the shared host tree once it was no longer the only remote machine. The appearance preferences now control grouping and ordering of the Agents sidebar, and the host tree retains all declared hosts so the grouping and sort controls can operate on the complete set. Tests were updated to verify the second declared host remains present alongside the local machine. 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.
Actionable comments posted: 1
🤖 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/tui/src/ui/app/rail/tests.rs`:
- Around line 310-321: Update the assertions in the host-tree test to use the
computed local-host flag from the hosts collection. Explicitly assert that at
least one entry has is_local set to true, while retaining the existing
studio-host and minimum-length assertions.
🪄 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
Run ID: 225c5468-c151-4b89-8fb3-0762714a1c57
📒 Files selected for processing (15)
src/sdk/src/config/appearance/types.rssrc/tui/src/ui/app/appearance.rssrc/tui/src/ui/app/input/mod.rssrc/tui/src/ui/app/input/nav.rssrc/tui/src/ui/app/rail/cursor.rssrc/tui/src/ui/app/rail/cursor_tests.rssrc/tui/src/ui/app/rail/merge_tests.rssrc/tui/src/ui/app/rail/mod.rssrc/tui/src/ui/app/rail/organize/tests.rssrc/tui/src/ui/app/rail/paging/mod.rssrc/tui/src/ui/app/rail/paging/tests.rssrc/tui/src/ui/app/rail/tests.rssrc/tui/src/ui/app/rail/types.rssrc/tui/src/ui/app/render/sessions/rail/mod.rssrc/tui/src/ui/app/render/sessions/rail/rows.rs
🚧 Files skipped from review as they are similar to previous changes (6)
- src/tui/src/ui/app/rail/merge_tests.rs
- src/tui/src/ui/app/rail/organize/tests.rs
- src/tui/src/ui/app/appearance.rs
- src/sdk/src/config/appearance/types.rs
- src/tui/src/ui/app/rail/types.rs
- src/tui/src/ui/app/rail/mod.rs
The test now verifies that the second declared host is not local and that a local machine remains in the shared tree, improving coverage of the host filtering behavior. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The test previously checked that the second declared host was not local, but the assertion only needs to verify the host remains in the tree. The kind check was redundant and has been removed to focus the test on tree membership. 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.
What
Settings › Appearance gains an Agents sidebar group with two controls:
host(default, drawn only once a second host exists) ·path·harness·nonecreated(default) ·recent·nameBoth apply live and persist to
[appearance]assidebarGrouping/sidebarSort.Grouping only moves the section headers: every agent keeps its own sessions
under it, so no row disappears whichever way it is set. Sorting applies at both
levels the eye reads — the agents in a section, and the sessions under an agent
(
recentis last output / last task event;createdis oldest-first, which isexactly the order the rail used before this existed).
How
medulla::config::{SidebarGrouping, SidebarSort}onAppearanceConfig.ui/app/rail/organize.rs— the sectioning and ordering rules, kept apartfrom the assembly in
rail/mod.rs, which stays about what exists.RailRow::Groupheader row, so nothing downstream has to guess whether a▸ ~/work/medullaheader names a machine.ui/app/appearance.rs.Validation
cargo test(2500+ tests, all green), including newrail::organize_tests(grouping/sorting, plus a property that no grouping loses an agent),
feature_settings(the two rows cycle, wrap, and persist), and configround-trip tests.
cargo clippy --all-targets -- -D warnings,cargo fmt --check.pathsections the sidebar live.Summary by CodeRabbit
New Features
Bug Fixes