Auto scroll to show this item when its tab becomes active
fixes #6029
Description
Contribution Checklist:
- [x] The pull request only addresses one issue or adds one feature.
- [x] The pull request does not introduce any breaking changes
- [ ] I have added screenshots or gifs to help explain the change if applicable.
- [z] I have read the contribution guidelines.
- [x] Create an issue and link to the pull request.
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.
@dssagar93 Thanks for the PR! Would you mind sharing a short demo video to showcase the feature in action?
Hi @helloanoop, sure, here you go, added a small clip to showcase the feature
https://github.com/user-attachments/assets/0642f352-4fd8-415e-80c8-f6e6e49da94c
Also, here's what happens right now in the current release build -- without the fix
https://github.com/user-attachments/assets/fcd1eb54-456b-42cc-be92-65d42f8bc3e6
@Pragadesh44-Bruno , @lohit-bruno , @helloanoop - can somebody review it please? Thanks
@dssagar93 Thanks for the PR! I will review this and share it with the team for further review and merging.
@Pragadesh44-Bruno Sounds good.
Hello folks, any reason or issues? What's with the holdup? @Pragadesh44-Bruno
Rain check. Did you folks review it internally? Any updates?
Hey @dssagar93 Just checked out your changes. Woeks like a charm 🔥 good work!
@sreelakshmi-bruno Can we prioritise to get this merged in December?
Walkthrough
Adds an auto-scroll effect to collection items in the sidebar that triggers when a tab becomes active. The effect scrolls the item into view with smooth behavior, wrapped in error handling for compatibility with environments lacking smooth scroll support.
Changes
| Cohort / File(s) | Summary |
|---|---|
Sidebar Collection Item Auto-Scroll packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js |
Adds effect hook that auto-scrolls collection item into view when its corresponding tab becomes active; uses scrollIntoView with smooth behavior and try-catch for cross-browser compatibility |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~8 minutes
- Verify effect dependency array (
isTabForItemActive) is correctly configured - Confirm try-catch error handling is appropriate for the smooth scroll compatibility use case
- Check that ref is properly initialized and won't cause null reference issues
Poem
📌 A sidebar scroll, so smooth and neat,
When tabs take focus, items greet,
No more hunting through endless lists,
Your active request? Never missed. ✨
Pre-merge checks and finishing touches
✅ Passed checks (5 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: auto-scrolling a collection item into view when its tab becomes active, matching the core functionality implemented. |
| Linked Issues check | ✅ Passed | The PR implements the exact requirement from issue #6029: auto-scrolling the selected request item into view when its tab becomes active, improving navigation in the sidebar. |
| Out of Scope Changes check | ✅ Passed | All changes are scoped to the CollectionItem component and directly address the linked issue without introducing unrelated modifications. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✨ Finishing touches
- [ ] 📝 Generate docstrings
🧪 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.