Skip to content

Sun light UI scrollbar setting parameter persistence#181

Merged
lightningpixel merged 4 commits into
lightningpixel:devfrom
iammojogo-sudo:3d-light-settings-consistency
Jun 19, 2026
Merged

Sun light UI scrollbar setting parameter persistence#181
lightningpixel merged 4 commits into
lightningpixel:devfrom
iammojogo-sudo:3d-light-settings-consistency

Conversation

@iammojogo-sudo

Copy link
Copy Markdown
Contributor

Persist 3D viewer lighting settings (Sun / Fill) across sessions.

The lighting panel sliders reset to defaults on every page load.
This saves them to localStorage on change and restores them on
startup, so they persist across generations, tab switches, and
app restarts until the user changes them or hits Reset.

One file changed: GeneratePage.tsx.
image

@iammojogo-sudo iammojogo-sudo changed the title Update GeneratePage.tsx Sun light UI scrollbar setting parameter persistence Jun 10, 2026
@Lorchie

Lorchie commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the PR. A couple of points before this can be merged:

1. Doesn't follow the existing persistence pattern

The project already persists state through the zustand persist middleware (src/shared/stores/appStore.ts:133, key modly-store, with partialize for generationOptions, uiScale, etc.). This PR reimplements persistence by hand (manual localStorage get/set + JSON.parse + field-by-field validation + error handling) when zustand already handles all of that.

lightSettings should live in appStore and be added to its partialize. Otherwise we end up with two competing persistence mechanisms, which is harder to maintain.

2. Diff noise / out-of-scope changes (~9 of ~13 hunks)

Most of the diff is unrelated to persistence — it's Unicode character replacements in UI labels and comments:

  • Processing…Processing... (×4), Importing…Importing...
  • (1–20)(1-20) (en-dash → hyphen)
  • - in comments (×3)

This looks like an editor encoding corruption. It pollutes the review, contradicts the "one file changed: lighting persistence" description, and degrades the UI text (the typographic ellipsis replaced by three dots).

Please revert these to the original characters so the PR only contains the localStorage + useEffect + useState init block.

Once persistence is moved into appStore and the encoding changes are reverted, this should be good to go.

@iammojogo-sudo

Copy link
Copy Markdown
Contributor Author

Will do :)

@iammojogo-sudo iammojogo-sudo left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changes made per request "persistence is moved into appStore and the encoding changes are reverted," If there are still issues, let me know :)

@Lorchie

Lorchie commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Perfect !!! :)

@lightningpixel lightningpixel merged commit 3b1b137 into lightningpixel:dev Jun 19, 2026
@iammojogo-sudo iammojogo-sudo deleted the 3d-light-settings-consistency branch June 20, 2026 16:17
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.

3 participants