Skip to content

frontend: components: redux: Add feature to keep resource maps expanded by default#4524

Open
mudit06mah wants to merge 1 commit intokubernetes-sigs:mainfrom
mudit06mah:feat/map_always_expand
Open

frontend: components: redux: Add feature to keep resource maps expanded by default#4524
mudit06mah wants to merge 1 commit intokubernetes-sigs:mainfrom
mudit06mah:feat/map_always_expand

Conversation

@mudit06mah
Copy link
Contributor

@mudit06mah mudit06mah commented Feb 2, 2026

Summary

This PR adds switch in Settings to keep resource map groups expanded by default.

Related Issue

Fixes #4486

Changes

  • Added Switch in Settings to toggle feature
  • Modified configSlice.ts to add setting
  • Modified Expansion logic in GraphView.tsx and graphGrouping.tsx

Screenshots

collapse_graph.mp4

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 2, 2026
@mudit06mah mudit06mah force-pushed the feat/map_always_expand branch from ea68857 to 64a75d8 Compare February 2, 2026 16:47
@illume illume requested a review from Copilot February 2, 2026 16:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a configurable setting to keep resource map groups expanded by default, addressing user feedback that manually re-expanding groups after each map reload was cumbersome. The feature allows users to disable the auto-collapse behavior for graphs with more than 50 nodes.

Changes:

  • Added a new resourceMapAlwaysExpand boolean setting to the Redux config store
  • Modified GraphView component to respect the new setting and conditionally show the "Expand All" button
  • Added UI toggle in Settings panel for users to enable/disable the feature
  • Updated translation files across all supported locales

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
frontend/src/redux/configSlice.ts Adds resourceMapAlwaysExpand setting initialization with default value of false
frontend/src/components/resourceMap/GraphView.tsx Implements expansion logic using the new setting, auto-expands on setting change, and conditionally shows "Expand All" button
frontend/src/components/App/Settings/Settings.tsx Adds switch control for the new setting with proper state management
frontend/src/i18n/locales/*/translation.json Adds translation key for the setting label (English only, others left empty)
frontend/src/components/App/Settings/snapshots/Settings.General.stories.storyshot Updates snapshot to include the new setting UI element

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mudit06mah mudit06mah force-pushed the feat/map_always_expand branch from 64a75d8 to 79512d4 Compare February 2, 2026 18:00
@mudit06mah
Copy link
Contributor Author

@illume I have made the changes suggested by copilot, Please Review this PR again :)

@illume illume added this to the v0.41.0 milestone Feb 3, 2026
@mudit06mah mudit06mah force-pushed the feat/map_always_expand branch from 79512d4 to 3ef32aa Compare February 4, 2026 09:55
@mudit06mah
Copy link
Contributor Author

@illume will merging be paused untill the release of v0.40.0?

@illume
Copy link
Contributor

illume commented Feb 6, 2026

@illume will merging be paused untill the release of v0.40.0?

Yeah, we usually slow down for some days before the release to be a bit more careful about what to merge in.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@illume illume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please address the open review comments?

I would make the context a bit more specific than components and redux.

frontend: Settings: resourceMap: configSlice: Add feature to keep resource maps expanded by default

Perhaps add the changes section from the PR description to the git message body?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 10, 2026
@mudit06mah mudit06mah force-pushed the feat/map_always_expand branch from 3ef32aa to 7c3d775 Compare February 10, 2026 20:05
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 10, 2026
@illume
Copy link
Contributor

illume commented Feb 10, 2026

There’s some typescript issues in the failing GitHub checks.

@mudit06mah mudit06mah force-pushed the feat/map_always_expand branch 2 times, most recently from b4c946f to b3aba26 Compare February 10, 2026 20:15
@mudit06mah
Copy link
Contributor Author

There’s some typescript issues in the failing GitHub checks.

Hi, Sorry! These occurred because I added two new props to the ConfigState without updating the storybooks. Changes should be good now!

@illume
Copy link
Contributor

illume commented Feb 10, 2026

, Sorry! These occurred because I added two new props to the ConfigState without updating the storybooks. Changes should be good now!

Cool, all checks are passing now.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mudit06mah mudit06mah force-pushed the feat/map_always_expand branch from b3aba26 to 0ba64ac Compare February 11, 2026 04:42
@mudit06mah
Copy link
Contributor Author

@illume I have made changes instructed by copilot, PTAL :)

Copy link
Contributor

@illume illume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 🎉

Nice work checking with the original reporter if this solves their problem.

I’ll leave this open a bit longer before merging to give others a chance to provide feedback.

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 12, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mudit06mah mudit06mah requested a review from illume February 12, 2026 12:24
@mudit06mah mudit06mah force-pushed the feat/map_always_expand branch from 5353cfd to abe1736 Compare February 12, 2026 12:55
@mudit06mah
Copy link
Contributor Author

@illume Made the suggested changes, PTAL

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: illume, mudit06mah

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. resourceMap size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option to keep large group expanded

3 participants