Skip to content
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

frontend: PluginSettings: Fix non responsive enable toggle #2667

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

vyncent-t
Copy link
Contributor

@vyncent-t vyncent-t commented Dec 11, 2024

Description

fixes issue #2666

This PR fixes a UI issue in the plugin settings page when running Headlamp in app mode. Previously, toggling the enable/disable switches for plugins did not visually reflect the updated state. The switches remained in their original positions until the save button was clicked and the page reloaded. This issue was limited to the UI, as the save functionality correctly updated the plugin state on reload.

Key Changes

  1. Real-Time Switch Updates:

    • Fixed the UI behavior to ensure that the enable/disable switches visually reflect the updated state immediately after being toggled.
    • The switches now display the correct position without requiring a page reload.
  2. Enhanced State Handling:

    • Updated the component logic to synchronize the UI state with the underlying plugin state upon toggle.

Steps to Test

  1. Open Headlamp in app mode and navigate to the plugin settings page.

  2. Ensure you have at least one plugin installed.

  3. Toggle the enable/disable switch for a plugin and verify:

    • The switch visually updates to the correct position immediately after toggling.
    • The save functionality still works as expected, correctly persisting the state across reloads.
  4. Reload the page and confirm that the plugin state matches the toggled positions.

@vyncent-t vyncent-t added the regression Bugs for things that used to work in previous releases. label Dec 11, 2024
@vyncent-t vyncent-t self-assigned this Dec 11, 2024
@vyncent-t vyncent-t requested a review from sniok December 11, 2024 21:43
@vyncent-t vyncent-t marked this pull request as ready for review December 11, 2024 21:50
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Dec 11, 2024
@vyncent-t vyncent-t marked this pull request as draft December 11, 2024 21:53
@vyncent-t vyncent-t force-pushed the fix-plugin-settings-toggle branch from 0a5006f to c9e15b0 Compare December 11, 2024 22:02
@vyncent-t vyncent-t marked this pull request as ready for review December 11, 2024 22:02
@joaquimrocha joaquimrocha added this to the v0.27.0 milestone Dec 11, 2024
Copy link
Collaborator

@joaquimrocha joaquimrocha left a comment

Choose a reason for hiding this comment

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

Nice. Thanks!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 11, 2024
@joaquimrocha joaquimrocha merged commit e8cd1d2 into main Dec 11, 2024
18 checks passed
@joaquimrocha joaquimrocha deleted the fix-plugin-settings-toggle branch December 11, 2024 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer regression Bugs for things that used to work in previous releases. size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
Development

Successfully merging this pull request may close these issues.

2 participants