-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Remove sorting button (#1392) #1396
Conversation
📝 Walkthrough📝 WalkthroughWalkthroughThis pull request implements significant changes by removing the sorting functionality from the Changes
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
packages/frontend/src/components/FosToolbar/FosToolbar.tsx (2)
13-18
: Update JSDoc comment to remove sorting referencesThe component's documentation still mentions sorting functionality that has been removed.
Apply this change to the JSDoc comment:
/* - * FosToolbar is a floating toolbar that is only visible on mobile and contains action buttons for filtering, sorting and saving search. + * FosToolbar is a floating toolbar that is only visible on mobile and contains action buttons for filtering and saving search. * @param onFilterBtnClick - Function that is called when the filter button is clicked. * @param onSaveBtnClick - Function that is called when the save button is clicked. * @param hideSaveButton - Optional boolean that determines if the save button should be hidden. Default is false - * @returns A floating toolbar with action buttons for filtering, sorting and saving search. + * @returns A floating toolbar with action buttons for filtering and saving search. */
Sorting functionality removal needs attention
The verification reveals some remaining sort-related code that needs to be addressed:
- The
SortOrderDropdown
component still exists in Storybook (packages/storybook/src/stories/SortOrderDropdown/
)- Sort-related translations are present in both
en.json
andnb.json
- The FosToolbar component's JSDoc still mentions "sorting" functionality
- There are sort-related utility functions in
dateInfo.ts
The sorting functionality hasn't been completely removed from the codebase. Please:
- Remove the SortOrderDropdown story from Storybook
- Clean up sort-related translations from i18n files
- Update FosToolbar's documentation to remove sorting references
- Review if the sort functions in dateInfo.ts are still needed
🔗 Analysis chain
Line range hint
1-36
: Verify complete removal of sorting functionalityLet's ensure there are no remaining references to sorting functionality in connected components or features.
Let me gather more information to verify if there are any remaining sort-related components or implementation files.
Let me try one more search with a different approach to check for any remaining sort-related implementation code.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for any remaining references to sorting in the codebase echo "Checking for remaining sort-related code..." rg -i "sort" --type tsx --type ts echo "Checking for any remaining imports of removed SortOrderDropdown..." rg -i "SortOrderDropdown" echo "Checking for any remaining sort-related translations..." rg -i "sort" --glob "*.json"Length of output: 1665
Script:
#!/bin/bash # Check for any SortOrderDropdown component files fd -e tsx -e ts "SortOrderDropdown" # Check for any sort-related component files fd -e tsx -e ts -i "sort" # Look for sort-related code in the frontend package rg -i "sort" --type ts --type tsx packages/frontend/src/Length of output: 225
Script:
#!/bin/bash # Search for sort-related code in frontend package using find and grep find packages/frontend/src -type f -name "*.tsx" -o -name "*.ts" | xargs grep -i "sort" # Check if SortOrderDropdown component still exists in frontend find packages/frontend/src -type f -name "SortOrderDropdown*" # Look for any sort-related props or interfaces ast-grep --pattern 'interface $_ { $$$ sort$_?: $_ $$$ }'Length of output: 1469
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (9)
packages/frontend/src/components/FosToolbar/FosToolbar.tsx
(1 hunks)packages/frontend/src/components/SortOrderDropdown/SortOrderDropdown.tsx
(0 hunks)packages/frontend/src/components/SortOrderDropdown/index.ts
(0 hunks)packages/frontend/src/components/SortOrderDropdown/sortOrderDropdown.module.css
(0 hunks)packages/frontend/src/components/index.ts
(0 hunks)packages/frontend/src/i18n/resources/en.json
(0 hunks)packages/frontend/src/i18n/resources/nb.json
(0 hunks)packages/frontend/src/pages/Inbox/Inbox.tsx
(3 hunks)packages/frontend/src/pages/Inbox/queryParams.ts
(0 hunks)
💤 Files with no reviewable changes (7)
- packages/frontend/src/components/SortOrderDropdown/SortOrderDropdown.tsx
- packages/frontend/src/components/SortOrderDropdown/index.ts
- packages/frontend/src/components/SortOrderDropdown/sortOrderDropdown.module.css
- packages/frontend/src/components/index.ts
- packages/frontend/src/i18n/resources/en.json
- packages/frontend/src/i18n/resources/nb.json
- packages/frontend/src/pages/Inbox/queryParams.ts
🔇 Additional comments (4)
packages/frontend/src/components/FosToolbar/FosToolbar.tsx (1)
Line range hint 19-36
: Implementation changes look good
The sorting functionality has been cleanly removed while maintaining the existing filter and save features. The component structure remains clear and focused.
packages/frontend/src/pages/Inbox/Inbox.tsx (3)
33-33
: LGTM: Import statement correctly updated
The import statement has been properly updated to remove sorting-related imports while maintaining necessary filter functionality.
79-79
: LGTM: State management simplified
The state management has been correctly simplified by removing sorting-related state while maintaining necessary search parameter functionality for filters.
102-103
: LGTM: Data processing simplified
The itemsToDisplay memoization has been correctly simplified to only handle filtering, aligning with the removal of sorting functionality.
Let's verify that the filterDialogs function doesn't contain any residual sorting logic:
✅ Verification successful
Verification complete: No sorting logic present in filterDialogs
After examining the implementation of filterDialogs
, I can confirm that the function only handles filtering logic and contains no sorting-related code. The function:
- Groups filters by their IDs
- Applies AND logic across different filter groups
- Applies OR logic within each filter group
- Handles specific filtering for senders, receivers, dates, and status
- Returns filtered results without any sorting operations
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check if filterDialogs function contains any sorting-related code
# Expected: No sorting-related terms in the implementation
rg -i "sort" "packages/frontend/src/pages/Inbox/filters.ts"
Length of output: 57
Script:
#!/bin/bash
# Let's first check if the file exists and see its content
fd "filters.ts" packages/frontend/src/pages/Inbox/
# If the file exists, let's examine the filterDialogs function implementation
ast-grep --pattern 'export function filterDialogs($_) {
$$$
}'
# As a fallback, let's search for any file containing filterDialogs function
rg -A 10 "function filterDialogs"
Length of output: 198
Script:
#!/bin/bash
# Let's examine the content of the filters.ts file
cat packages/frontend/src/pages/Inbox/filters.ts
Length of output: 4962
Hva er endret?
Related Issue(s)
Dokumentasjon / Storybook / testdekning
stories
iStorybook
, eller så er ikke dette relevant.Skjermbilder eller GIFs (valgfritt)
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores