Skip to content

fix: mirror Expand layout in Collapse split-button group#242

Open
R-Hart80 wants to merge 1 commit into
CatholicOS:devfrom
R-Hart80:fix/collapse-toolbar-button-order
Open

fix: mirror Expand layout in Collapse split-button group#242
R-Hart80 wants to merge 1 commit into
CatholicOS:devfrom
R-Hart80:fix/collapse-toolbar-button-order

Conversation

@R-Hart80
Copy link
Copy Markdown
Contributor

@R-Hart80 R-Hart80 commented May 11, 2026

Problem

Closes #208.

The Collapse split-button group had the opposite layout from the Expand group:

Group Left (main, labeled) Right (icon-only)
Expand (before & after) ChevronDown → expand one level ChevronsDown → expand all
Collapse (before) ChevronsRight → collapse all ChevronRight → collapse one level
Collapse (after) ChevronRight → collapse one level ChevronsRight → collapse all

A user who learned "labeled button = conservative one-step action" from the Expand group would accidentally collapse the entire tree on first click of Collapse.

Fix

Swapped the onClick handlers, icons, and aria-label attributes in the Collapse group so both split-button clusters follow the same convention: labeled main button = one step, icon-only add-on = all levels.

Testing

  • Clicking Collapse (labeled) collapses one level only
  • Clicking the double-caret add-on collapses all levels
  • aria-label on each button matches its action
  • No regressions in existing test suite (158/159 pass; 1 pre-existing failure in LanguagePicker.test.tsx unrelated to this change)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Reordered collapse buttons in the editor toolbar for improved clarity.

Review Change Stack

The labeled main button now triggers collapse-one-level (conservative)
and the icon-only add-on triggers collapse-all, matching the Expand
group's convention. Fixes CatholicOS#208.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9b8b6ed7-4bef-49b0-88a9-39ea35f60453

📥 Commits

Reviewing files that changed from the base of the PR and between 0233a83 and f02a0b0.

📒 Files selected for processing (1)
  • components/editor/shared/EntityTreeToolbar.tsx

📝 Walkthrough

Walkthrough

The Collapse split-button group in the entity tree toolbar is reordered to align with the Expand group's layout: the left labeled button now performs the conservative one-level action, and the right icon-only button performs the all-levels action.

Changes

Collapse Split-Button Layout Alignment

Layer / File(s) Summary
Collapse Split-Button Group Reordering
components/editor/shared/EntityTreeToolbar.tsx
Left button swapped from onCollapseAll + ChevronsRight + "Collapse all" to onCollapseOneLevel + ChevronRight + "Collapse one level"; right button swapped from onCollapseOneLevel + ChevronRight + "Collapse one level" to onCollapseAll + ChevronsRight + "Collapse all".

🎯 1 (Trivial) | ⏱️ ~3 minutes

🐰 A button swap so neat and precise,
Left for one step, right for splice,
Now Collapse matches Expand's design,
Icons and actions in perfect align! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: reordering the Collapse split-button group to mirror the Expand group's layout.
Linked Issues check ✅ Passed All done criteria from issue #208 are met: labeled Collapse button now collapses one level [#208], right add-on collapses all levels [#208], aria-labels updated to match new actions [#208], and the layout now mirrors the Expand group [#208].
Out of Scope Changes check ✅ Passed The PR changes only the Collapse split-button group's order, icons, handlers, and aria-labels in EntityTreeToolbar.tsx, which is directly in scope per issue #208. No icon direction change (e.g., to up-carets) or unrelated modifications are present.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

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

@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

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.

Tree toolbar: Collapse split-button is inverted relative to Expand (icons + actions)

1 participant