Skip to content

frontend: ClusterSettings page refactor#5063

Open
sniok wants to merge 2 commits intokubernetes-sigs:mainfrom
sniok:cluster-settings-refactor
Open

frontend: ClusterSettings page refactor#5063
sniok wants to merge 2 commits intokubernetes-sigs:mainfrom
sniok:cluster-settings-refactor

Conversation

@sniok
Copy link
Copy Markdown
Contributor

@sniok sniok commented Apr 6, 2026

Fixes #5062

Simplify cluster settings by having SettingsCluster own the settings state and pass it down to child components, removing duplicated load/store logic

  • Added useClusterSettings hook for loading/storing cluster settings from localStorage
  • SettingsCluster now passes settings to NodeShellSettings, PodDebugSettings, and ClusterNameEditor as props
  • Appearance changes (accent color, icon) apply immediately, consistent with all other settings
  • Removed debouncing (localStorage writes are fast) and per-component localStorage calls

Steps to Test

  1. Have at least two clusters in headlamp
  2. Go to Cluster Settings page
  3. Go to cluster1 and set a setting like allowed namespace
  4. Switch to cluster2
  5. Switch back to cluster1
  6. Repeat steps 4,5

Extract shared cluster settings load/store logic into a dedicated
hook that keeps React state and localStorage in sync. This provides
a single source of truth that parent components can share with
children via props.
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sniok

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 6, 2026
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 6, 2026
@Athang69
Copy link
Copy Markdown
Contributor

Athang69 commented Apr 6, 2026

@sniok ig it the issue number #5062
You mentioned #5060 in PR description

@sniok
Copy link
Copy Markdown
Contributor Author

sniok commented Apr 6, 2026

whoops, thanks for pointing that out

SettingsCluster now owns the settings via useClusterSettings and
passes them to NodeShellSettings, PodDebugSettings, and
ClusterNameEditor as props, removing duplicated load/store logic
and debounce timers from each child.

Appearance changes (accent color, icon) apply immediately instead
of requiring a separate save button. ColorPicker no longer needs
an onError callback and both picker dialogs get consistent form
field styling.

Stories supply settings through props instead of pre-seeding
localStorage, and snapshots are updated accordingly.
@sniok sniok force-pushed the cluster-settings-refactor branch from 52ffda4 to 3b2d0de Compare April 6, 2026 16:57
@sniok sniok changed the title Cluster settings refactor frontend: ClusterSettings page refactor Apr 6, 2026
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. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'Cluster Settings' page is broken when switching between clusters

3 participants