Skip to content

Fix collapsed group spacing for empty groups#495

Open
jeffscottward wants to merge 3 commits intoRunMaestro:mainfrom
jeffscottward:group-css-fix
Open

Fix collapsed group spacing for empty groups#495
jeffscottward wants to merge 3 commits intoRunMaestro:mainfrom
jeffscottward:group-css-fix

Conversation

@jeffscottward
Copy link
Contributor

@jeffscottward jeffscottward commented Mar 1, 2026

Description

  • Hide collapsed group palette rendering when a collapsed group has no top-level agents.
  • Remove extra vertical spacing below empty collapsed groups in the left session sidebar.

Closes #494

Summary by CodeRabbit

  • Performance
    • Improved session list rendering—collapsed group view now renders more efficiently, reducing redundant work and speeding up list display.

@coderabbitai
Copy link

coderabbitai bot commented Mar 1, 2026

📝 Walkthrough

Walkthrough

Precomputes non-parent session items per group in SessionList.tsx and uses that collection for collapsed-group rendering; adds two new repository artifact files (payload.XXXXXX.json, prompt.XXXXXX.txt); reformats release notes and minor formatting tweaks in FilePreview.tsx and useBatchProcessor.ts.

Changes

Cohort / File(s) Summary
Collapsed Group Rendering Optimization
src/renderer/components/SessionList.tsx
Introduce groupCollapsedPills = groupSessions.filter(session => !session.parentSessionId) and iterate that precomputed array for the collapsed-group palette instead of filtering inline multiple times.
CI Payload Artifact
payload.XXXXXX.json
Add JSON payload capturing repository/PR metadata and failing check-run details (test, lint-and-format). No runtime code changes.
Agent Guidance Prompt
prompt.XXXXXX.txt
Add guidance prompt file containing Goal/Context and failing-check payload to steer minimal safe fixes for PR #495.
Release Notes Reflow
docs/releases.md
Large reflow and standardization of release notes formatting across versions (line reorders and minor wording adjustments), no semantic changes.
UI / Clipboard Formatting
src/renderer/components/FilePreview.tsx
Minor formatting/whitespace changes in rehype-raw details wrapper and clipboard notification message ternaries; behavior unchanged.
Batch Hook Formatting
src/renderer/hooks/batch/useBatchProcessor.ts
Minor formatting change collapsing a console.warn call to a single line; no control-flow changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The pull request contains several out-of-scope changes: payload.XXXXXX.json and prompt.XXXXXX.txt appear to be test/metadata artifacts; docs/releases.md reformatting is unrelated to the spacing fix; and FilePreview.tsx and useBatchProcessor.ts contain only formatting changes unrelated to the objective. Remove payload and prompt files (test artifacts), revert docs/releases.md reformatting, and remove unrelated formatting changes in FilePreview.tsx and useBatchProcessor.ts to keep the PR focused on the spacing fix.
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: fixing collapsed group spacing when groups are empty, which directly addresses the core objective of the pull request.
Linked Issues check ✅ Passed The pull request addresses the linked issue #494 by implementing changes to remove extra vertical spacing below empty collapsed groups, as evidenced by the SessionList.tsx optimization and the file modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link

greptile-apps bot commented Mar 1, 2026

Greptile Summary

This PR fixes a UI spacing bug where collapsing a group that contains no top-level agents (i.e., groupCollapsedPills.length === 0) would still render the empty pill container div — including its mt-1 mb-2 vertical margin — producing unwanted whitespace in the left sidebar.

Changes made:

  • Introduces a pre-computed groupCollapsedPills variable at the top of the sortedGroups.map callback, filtering groupSessions to only top-level sessions (!session.parentSessionId). This is a clean refactor that avoids the repeated inline .filter() call that existed before.
  • Converts the else branch for the collapsed group pill container into a guarded ternary: the pill div is rendered only when groupCollapsedPills.length > 0, and null is returned otherwise — correctly suppressing both the container and its spacing.

The fix is minimal, targeted, and logically correct. No side effects are introduced for the expanded-group path or for groups that do have top-level sessions.

Confidence Score: 5/5

  • This PR is safe to merge — it is a minimal, targeted UI fix with no logic regressions.
  • The change is small (one new variable + one ternary guard), touches only the render path for collapsed groups in the sidebar, and the fix directly matches the described bug. The pre-computed groupCollapsedPills filter is equivalent to the existing inline filter, so no behavioral change is introduced for groups that do have top-level sessions.
  • No files require special attention.

Important Files Changed

Filename Overview
src/renderer/components/SessionList.tsx Adds groupCollapsedPills pre-filter and changes the collapsed-state branch from an unconditional else to a guarded ternary that renders null when no top-level sessions exist, eliminating the empty pill container and its vertical spacing.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Render Group] --> B{group.collapsed?}
    B -- No --> C[Render expanded session list\nwith border-l]
    B -- Yes --> D{groupCollapsedPills\n.length > 0?}
    D -- Yes --> E[Render collapsed pill container\nml-8 mr-3 mt-1 mb-2]
    D -- No --> F[Render null\nno spacing / no container]
Loading

Last reviewed commit: 5002a82

@pedramamini
Copy link
Collaborator

This looks safe, but on the fact chance that it causes some regression or is going to hold off on 0.15.0 ... first merge after i publish that version.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 `@prompt.XXXXXX.txt`:
- Around line 1-17: Delete the generated artifact file "prompt.XXXXXX.txt" from
the branch (remove it from the PR changes) so it is no longer tracked or part of
the commit set; locate the file by name in the diff/commit and remove it (git rm
/ delete and commit/push) and ensure it is not reintroduced (optionally add the
filename pattern to .gitignore) so lint/format and tests no longer fail due to
this non-product file.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5002a82 and 051a29d.

📒 Files selected for processing (2)
  • payload.XXXXXX.json
  • prompt.XXXXXX.txt
✅ Files skipped from review due to trivial changes (1)
  • payload.XXXXXX.json

Comment on lines +1 to +17
You are an autonomous coding agent fixing a GitHub pull request for Maestro.

Goal:
- Fix only what is necessary to make the failing checks pass for PR #495.
- Use the failure payload below to focus changes.
- Keep changes minimal and scoped.
- Do not add broad refactors or formatting churn.
- If no safe fix exists, do not force risky behavior and return without edits.

Context:
- PR repo: RunMaestro/Maestro
- PR number: 495
- Head branch: group-css-fix
- Head SHA: 5002a82e9a19591e7de9323fb2876e6b90989660

Failing check payload:
{"repo":"RunMaestro/Maestro","number":495,"title":"Fix collapsed group spacing for empty groups","htmlUrl":"https://github.com/RunMaestro/Maestro/pull/495","head":"5002a82e9a19591e7de9323fb2876e6b90989660","failures":[{"source":"check-run","id":65325337465,"name":"test","status":"completed","conclusion":"failure","htmlUrl":"https://github.com/RunMaestro/Maestro/actions/runs/22552813651/job/65325337465","detailsUrl":"https://github.com/RunMaestro/Maestro/actions/runs/22552813651/job/65325337465","summary":"","notes":".github:48776:failure Process completed with exit code 1. | src/__tests__/renderer/components/TerminalOutput.test.tsx:243:failure Error: expect(received).toBeInTheDocument()\n\nreceived value must be an HTMLElement or an SVGElement.\nReceived has type: Null\nReceived has value: null\n ❯ src/__tests__/renderer/components/TerminalOutput.test.tsx:243:33\n\n","completedAt":"2026-03-01T21:23:04Z"},{"source":"check-run","id":65325337460,"name":"lint-and-format","status":"completed","conclusion":"failure","htmlUrl":"https://github.com/RunMaestro/Maestro/actions/runs/22552813651/job/65325337460","detailsUrl":"https://github.com/RunMaestro/Maestro/actions/runs/22552813651/job/65325337460","summary":"","notes":".github:10:failure Process completed with exit code 1.","completedAt":"2026-03-01T21:16:29Z"}]} No newline at end of file
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Remove generated prompt artifact from the PR scope.

This file is not part of the product fix and looks like agent/tooling output. Keeping it adds review noise and can contribute to lint/format failures (notably the very long JSON on Line 17). Please drop this file from the PR.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~17-~17: The official name of this software platform is spelled with a capital “H”.
Context: ...job/65325337465","summary":"","notes":".github:48776:failure Process completed with ex...

(GITHUB)


[uncategorized] ~17-~17: The official name of this software platform is spelled with a capital “H”.
Context: ...job/65325337460","summary":"","notes":".github:10:failure Process completed with exit ...

(GITHUB)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@prompt.XXXXXX.txt` around lines 1 - 17, Delete the generated artifact file
"prompt.XXXXXX.txt" from the branch (remove it from the PR changes) so it is no
longer tracked or part of the commit set; locate the file by name in the
diff/commit and remove it (git rm / delete and commit/push) and ensure it is not
reintroduced (optionally add the filename pattern to .gitignore) so lint/format
and tests no longer fail due to this non-product file.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/releases.md`:
- Line 35: Fix typos and grammar in the release notes by replacing the incorrect
tokens: change "FIle" to "File" in the sentence that begins "🗄️ Document
Graphs. Launch from file preview...", change "built in" to "built-in", change
"You will received" to "You will receive", and change "Github" to "GitHub" so
the release notes read with correct spelling and hyphenation.
- Line 41: Update the subsection headings in the releases document to use
consistent third-level headings (###) under each release's second-level heading
(## vX.Y.x) and fix the typo in the release title "Smaller Changes in 014.x" to
"Smaller Changes in 0.14.x"; specifically replace any stray top-level (#) or
second-level (##) headings within release sections (e.g., the "Smaller Changes
in 014.x" heading and the other subsections currently using `#/`##) with ### so
the document hierarchy and generated TOC remain correct.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 051a29d and d0637e0.

📒 Files selected for processing (4)
  • docs/releases.md
  • payload.XXXXXX.json
  • src/renderer/components/FilePreview.tsx
  • src/renderer/hooks/batch/useBatchProcessor.ts
✅ Files skipped from review due to trivial changes (1)
  • src/renderer/hooks/batch/useBatchProcessor.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • payload.XXXXXX.json


The major contributions to 0.14.x remain:

🗄️ Document Graphs. Launch from file preview or from the FIle tree panel. Explore relationships between Markdown documents that contain links between documents and to URLs.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix user-facing release note typos/grammar.

Line 35 (FIle), Line 110 (built inbuilt-in), Line 114 (You will received), and Line 135 (GithubGitHub) should be corrected for publication quality.

Also applies to: 110-110, 114-114, 135-135

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/releases.md` at line 35, Fix typos and grammar in the release notes by
replacing the incorrect tokens: change "FIle" to "File" in the sentence that
begins "🗄️ Document Graphs. Launch from file preview...", change "built in" to
"built-in", change "You will received" to "You will receive", and change
"Github" to "GitHub" so the release notes read with correct spelling and
hyphenation.


🧙‍♂️ Added an in-tab wizard for generating Auto Run Playbooks via `/wizard` or a new button in the Auto Run panel.

# Smaller Changes in 014.x
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Normalize subsection heading levels to preserve document hierarchy.

Line 41, Lines 104-116, Line 137, and Lines 229-259 switch to #/## headings inside release sections. This breaks the heading structure and can degrade generated TOC/navigation. These should be consistent subsection levels (typically ### under each ## vX.Y.x section). Also, Line 41 should read 0.14.x, not 014.x.

Also applies to: 104-116, 137-137, 229-259

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/releases.md` at line 41, Update the subsection headings in the releases
document to use consistent third-level headings (###) under each release's
second-level heading (## vX.Y.x) and fix the typo in the release title "Smaller
Changes in 014.x" to "Smaller Changes in 0.14.x"; specifically replace any stray
top-level (#) or second-level (##) headings within release sections (e.g., the
"Smaller Changes in 014.x" heading and the other subsections currently using
`#/`##) with ### so the document hierarchy and generated TOC remain correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Minor CSS Fix extra spacing for collapsed empty groups in left sidebar

2 participants