[WEB-2213] fix: group by persistence for list view
[WEB-2213]
Changes:
- This PR adds the functionality of persisting the "state of groupings" for List View, by storing the applied grouping in the store and the localStorage.
- The state of "Groupings" is shared among the List View and the Kanban View.
- Correct values for the keys were not set previously, now they are set correctly.
New State:
- The shared state is now persisted in the list view too.
- Demonstrated only for "States" but changes apply to all "Group By" grouping states.
https://github.com/user-attachments/assets/2371c5bc-cf62-4d31-a4c8-b9e13442b2bd
Previous State:
- Neither is the state for list view persisted nor is it shared with the kanban view
https://github.com/user-attachments/assets/054bc6d9-b33c-438e-a452-d432bb1cf052
[WEB-2213]
Summary by CodeRabbit
Release Notes
-
New Features
- Enhanced functionality for managing issue filters in Kanban and list layouts, allowing users to filter issues based on grouping preferences.
- Introduced dynamic management of collapsed groups, improving interactivity and user experience.
-
Bug Fixes
- Updated filter handling to correctly target specific categories (e.g., archived, cycle, draft, profile) instead of general project issues.
-
Improvements
- Improved type safety for filter functions, reducing potential runtime errors and enhancing code maintainability.
-
Documentation
- Added comments to clarify potential issues with filter storage, aiding future development efforts.
Walkthrough
The changes introduce enhancements across several components, focusing on managing issue grouping and filtering in the Kanban layout. Key functionalities include the addition of handleCollapsedGroups to toggle grouping states and the introduction of collapsedGroups to track current filter states. These updates improve the interactivity and responsiveness of the components based on user actions, streamlining the overall control flow.
Changes
| File Path | Change Summary |
|---|---|
web/core/components/issues/issue-layouts/list/base-list-root.tsx |
Enhanced BaseListRoot with handleCollapsedGroups for managing filter states and added collapsedGroups to track current filter states. |
web/core/components/issues/issue-layouts/list/default.tsx |
Updated IList interface to include handleCollapsedGroups and collapsedGroups for improved management of issue grouping states. |
web/core/components/issues/issue-layouts/list/headers/group-by-card.tsx |
Removed toggleListGroup from IHeaderGroupByCard and added handleCollapsedGroups for structured state management. |
web/core/components/issues/issue-layouts/list/list-group.tsx |
Added handleCollapsedGroups and collapsedGroups to manage issue groups dynamically, simplifying state management logic. |
web/core/components/issues/issue-layouts/kanban/base-kanban-root.tsx |
Refactored handleKanbanFilters to handleCollapsedGroups, updating its logic to manage collapsed groups. |
web/core/components/issues/issue-layouts/kanban/default.tsx |
Replaced kanbanFilters with collapsedGroups in IKanBan interface and updated the logic in the KanBan component accordingly. |
web/core/components/issues/issue-layouts/kanban/headers/group-by-card.tsx |
Updated IHeaderGroupByCard to use collapsedGroups and handleCollapsedGroups, modifying event handlers for group management. |
web/core/components/issues/issue-layouts/kanban/headers/sub-group-by-card.tsx |
Renamed kanbanFilters to collapsedGroups and updated the handler to handleCollapsedGroups in IHeaderSubGroupByCard. |
web/core/components/issues/issue-layouts/kanban/swimlanes.tsx |
Consistently renamed kanbanFilters to collapsedGroups across multiple interfaces and updated related handler functions. |
Possibly related PRs
- #5232: Modifications to the
HeaderGroupByCardcomponent introduce thehandleCollapsedGroupsmethod, directly related to the main PR's enhancements. - #5269: Changes to the
visibilityGroupByfunction in theKanBancomponent are relevant to the main PR's updates on managing collapsed groups. - #5559: Addresses alignment issues in the
HeaderGroupByCardcomponent, relevant to the main PR's changes. - #5664: Enhances rendering logic for kanban groups, closely related to the main PR's updates on handling collapsed groups.
- #5703: Includes fixes related to issue title rendering, indirectly connecting to the overall improvements in issue management discussed in the main PR.
Suggested labels
🌟improvement
Suggested reviewers
- sriramveeraghanta
- rahulramesha
- SatishGandham
Poem
🐇 In the meadow where filters play,
Hopping through issues, bright and gay.
With groups that toggle, oh what a sight,
Kanban's magic makes coding feel right!
So let us leap and dance with glee,
For every change brings joy, you see! 🌼
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?
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Generate unit testing code for this file.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai generate unit testing code for this file.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read src/utils.ts and generate unit testing code.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
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)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.