plane icon indicating copy to clipboard operation
plane copied to clipboard

[WEB-2213] fix: group by persistence for list view

Open sharma01ketan opened this issue 1 year ago • 1 comments

[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.

sharma01ketan avatar Sep 12 '24 09:09 sharma01ketan

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 HeaderGroupByCard component introduce the handleCollapsedGroups method, directly related to the main PR's enhancements.
  • #5269: Changes to the visibilityGroupBy function in the KanBan component are relevant to the main PR's updates on managing collapsed groups.
  • #5559: Addresses alignment issues in the HeaderGroupByCard component, 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?

❤️ Share
🪧 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 @coderabbitai in 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 @coderabbitai in 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 pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file 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.

coderabbitai[bot] avatar Sep 12 '24 09:09 coderabbitai[bot]