feat: add sort toggle for RHS items (Created vs Updated)#1025
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a client-side sort dropdown to ChangesSidebar sort feature
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant ReactSelect
participant SidebarRight
participant GithubItems
User->>ReactSelect: select sort option
ReactSelect->>SidebarRight: handleSortChange(selectedOption)
SidebarRight->>SidebarRight: update state.sortBy
SidebarRight->>SidebarRight: compute sortedItems
SidebarRight->>GithubItems: render(sortedItems)
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
avasconcelos114
left a comment
There was a problem hiding this comment.
Hello and thank you for the contribution! 🎉 :)
Before diving into reviewing the implementation I tested a build with your PR and noticed that the style of the select will need to be adjusted to match what the issue had it
Refer to the comment in #242 (comment) to view the Figma prototype and let me know if you have any questions, thanks again!
|
This PR has been automatically labelled "stale" because it hasn't had recent activity. |
- Replace native <select> with ReactSelect using getStyleForReactSelect(theme) - Convert hardcoded styles to makeStyleFromTheme for dark/light theme support - Add aria-label='Sort items' for accessibility - Use menuPortalTarget=document.body to prevent clipping in RHS panel
|
Hi @avasconcelos114, I've addressed your review feedback in commit 394e874:
The dropdown is |
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 `@webapp/src/components/sidebar_right/sidebar_right.jsx`:
- Around line 223-235: The section header layout is missing a flex row, so the
new sort dropdown will stack under the title instead of sitting beside it.
Update the style returned by makeStyleFromTheme for sectionHeader in
sidebar_right.jsx to use a horizontal flex layout (while keeping the existing
padding), so the title link and sortDropdownContainer render on the same row.
- Around line 161-174: The unread-items sort logic in sidebar_right.jsx is using
created_at as the default for RHSStates.UNREADS, but those notification threads
only have updated_at, so the “Sort: Created” selection ends up comparing
undefined dates. Update the sorting branch around the sortedItems and
sortOptions/selectedSortOption logic to fall back to updated_at for unread
items, or hide/disable the Created option in this view so the selected label
matches the actual sort behavior.
🪄 Autofix (Beta)
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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 55e1de93-0482-46c7-babd-2c1e4f0c3c26
📒 Files selected for processing (1)
webapp/src/components/sidebar_right/sidebar_right.jsx
…unread sorting 1. sectionHeader now uses display:flex so the sort dropdown renders beside the title instead of stacking below it. 2. Notification threads (UNREADS) don't expose created_at, so sorting by 'Created' compared undefined dates. Fall back to updated_at when created_at is missing. Addresses CodeRabbit review feedback.
|
Addressed both CodeRabbit issues in 5d55c5d:
|
Summary
Adds a sort dropdown to the GitHub plugin RHS sidebar, allowing users to sort items by "Created" (default, existing behavior) or "Updated" date.
Resolves #242
Changes
<select>dropdown in the RHS header with two options: "Sort: Created" and "Sort: Updated"created_atorupdated_atfield (descending)Release Notes
Change Impact: 🟡 Medium
Reasoning: This is a localized UI change in the sidebar, but it alters the rendering and ordering of user-visible items and introduces new client-side sorting behavior. The blast radius is limited, though it affects a core browsing flow and has some regression potential around sorting and dropdown behavior.
Regression Risk: Moderate — existing default behavior is preserved, but the new sort path, theme styling, and dropdown interaction add untested UI states that could affect item ordering or display in the RHS panel.
QA Recommendation: Manual QA recommended, especially to verify default “Created” sorting, “Updated” sorting, dark/light theme styling, and dropdown behavior in the sidebar. Skipping manual QA is not advised.