Skip to content

Improve UI controls and state handling - #23

Merged
fidoriel merged 1 commit into
fidoriel:mainfrom
allkhor:fix-fan-controls
Sep 30, 2025
Merged

Improve UI controls and state handling#23
fidoriel merged 1 commit into
fidoriel:mainfrom
allkhor:fix-fan-controls

Conversation

@allkhor

@allkhor allkhor commented Sep 27, 2025

Copy link
Copy Markdown
Contributor

Summary

Introduce SmartControls, a reusable abstraction for managing local UI state,
debounced commits, and synchronization with backend values. This resolves the
issue where adjusting a slider was overwritten by incoming backend updates.

Changes

  • SmartControls
    • Added createSmartControl to handle UI interaction, pending state, and
      timed commits.
  • Helper Functions
    • toPercent – converts UI values (0‑15) to percentage display.
    • scaleSliderToBackend – maps UI range (0‑15) to backend range (0‑255).
  • Slider Updates
    • Step size set to 1.5.
    • Percentage display now uses toPercent.
    • Slider actions go through the new SmartControls API.
  • Light Toggle
    • Refactored to use SmartControls for consistent state handling.
  • Layout Adjustments
    • Switched to flex rows with gaps for cleaner, responsive UI.

Testing

  • Verified that slider adjustments persist despite concurrent backend updates.
  • Confirmed percentage values correctly reflect fan speeds when tested with Orcaslicer; the displayed values match the backend values.
  • Checked that the light toggle behaves consistently.
  • Performed visual inspection of the updated layout on various screen sizes.

Please review the changes and let me know if any further adjustments are needed.

@allkhor

allkhor commented Sep 28, 2025

Copy link
Copy Markdown
Contributor Author

Deleted stray console.log calls that were left in the code during debugging and fix lint errors

@fidoriel

Copy link
Copy Markdown
Owner

@allkhor Thank you. I will take a look tonight.

@allkhor

allkhor commented Sep 29, 2025

Copy link
Copy Markdown
Contributor Author

I think the Action failed and it's unrelated to this PR.
Could we skip the build and push job for pull‑request runs and only execute it after the branch is merged into main?

@fidoriel

Copy link
Copy Markdown
Owner

Id like to keep the build. But the push to ghcr.io fails for some auth reason. We might only push on main. I am fine with not having the action succeed.

@fidoriel

Copy link
Copy Markdown
Owner

Thank you for your contribution.

@fidoriel
fidoriel merged commit 6991284 into fidoriel:main Sep 30, 2025
2 of 3 checks passed
@allkhor

allkhor commented Sep 30, 2025

Copy link
Copy Markdown
Contributor Author

Thanks! That’s exactly what this project is about — giving users freedom and control over their devices.

@allkhor
allkhor deleted the fix-fan-controls branch October 5, 2025 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants