fix: align sidebar requests with and without examples - #9187
Conversation
Reserve the chevron slot for rows without examples so sibling method labels and request names stay aligned. Add an isolated Electron regression test for collapsed and expanded examples. Fixes usebruno#9186
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughThe sidebar now reserves chevron space for request rows without examples. A request-method test locator and Playwright coverage verify method and name alignment in collapsed and expanded states. ChangesSidebar alignment
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Requests without examples now reserve the chevron column so sidebar method labels and names align with requests that have examples. The change is covered for collapsed and expanded example states and is ready to merge. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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 |
Description
I fixed the sidebar alignment for requests with and without examples. The method labels and request names now start at the same position for requests at the same level.
I used AI to help with the fix and regression test.
Problem
Fixes #9186.
Requests without examples didn't reserve space for the chevron, so their method labels and names started 16 pixels to the left of requests with examples.
Fix
I added an empty 16-pixel slot when a row has no chevron, using the same spacing pattern as the existing example rows. The slot isn't a button, and expanding or collapsing examples still works as before.
I also added an Electron regression test that compares the rendered method and name positions with examples collapsed and expanded. It uses an isolated app and a temporary copy of the existing collection fixture.
Testing
TZ=UTC. Two existing date-format tests depend on the local timezone.Screenshots
Before, from the issue report:
After, from the local build:
Contribution Checklist:
Summary by CodeRabbit
Bug Fixes
Tests