[PR #950] [MERGED] Fix focused Settings number edits not persisting #4853

Closed
opened 2026-10-22 04:11:11 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/950
Author: @cha1latte
Created: 5/17/2026
Status: ✅ Merged
Merged: 5/17/2026
Merged by: @cha1latte

Base: staging ← Head: fix/settings-image-size-persistence


📝 Commits (2)

  • d0bc137 Fix focused settings number persistence
  • 1a64819 Tighten settings number parsing

📊 Changes

5 files changed (+26 additions, -5 deletions)

View changed files

➕ docs/pr-evidence/settings-persistence/after-reload-fixed.png (+0 -0)
➕ docs/pr-evidence/settings-persistence/before-focused-draft.png (+0 -0)
➕ docs/pr-evidence/settings-persistence/before-reload-broken.png (+0 -0)
📝 packages/client/src/components/panels/SettingsPanel.tsx (+3 -0)
📝 packages/client/src/components/ui/DraftNumberInput.tsx (+23 -5)

📄 Description

Linked issue

No linked issue. Reported directly in Codex; a GitHub issue should be opened before submission if maintainers require one.

Why this change

  • Settings number fields could look changed while still focused, but the value was only local draft input state. Reloading before blur/Enter dropped the edit, which made Image Generation canvas sizes look like they did not persist and left users wondering whether there was a hidden save button.

What changed

  • Added an opt-in commitOnValidChange mode to DraftNumberInput so settings fields can persist valid values while the field remains focused.
  • Enabled focused valid commits for General Settings number inputs, including Image Generation canvas dimensions and Messages per page.
  • Kept invalid draft values as drafts until blur/reload, so out-of-range image sizes still do not persist.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Codex Playwright repro before the fix: opened Settings > General > Image Generation, typed 1152 into the focused Selfies height field, confirmed localStorage and /api/app-settings/ui did not contain 1152, then reloaded and saw the field revert to 768.
  • Codex Playwright verification after the fix: repeated the same focused edit, confirmed localStorage and /api/app-settings/ui contained 1152 after debounce, then reloaded and saw Selfies height remain 1152.
  • Codex Playwright edge case: changed Messages per page to 37 while focused, waited for sync, reloaded, and saw 37 persist.
  • Codex Playwright edge case: typed invalid Selfies height 8192, waited, reloaded, and confirmed it did not persist; the field returned to the prior valid 1152.
  • pnpm check passed locally.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Before: focused draft shows 1152, but it is not persisted yet.

Focused draft before fix

Before: reload drops the focused draft back to 768.

Reloaded before fix

After: reload keeps the focused edit at 1152.

Reloaded after fix

Summary by CodeRabbit

  • Bug Fixes
    • Numeric input fields for image dimensions and messages per page now validate entries before committing, preventing invalid values from being saved.

Review Change Stack


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/950 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/17/2026 **Status:** ✅ Merged **Merged:** 5/17/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `staging` ← **Head:** `fix/settings-image-size-persistence` --- ### 📝 Commits (2) - [`d0bc137`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d0bc137a655cf7c846af0c3ee6d3ce41b7e66430) Fix focused settings number persistence - [`1a64819`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1a64819ab66caa8f3ff6f216dd01407ac311b545) Tighten settings number parsing ### 📊 Changes **5 files changed** (+26 additions, -5 deletions) <details> <summary>View changed files</summary> ➕ `docs/pr-evidence/settings-persistence/after-reload-fixed.png` (+0 -0) ➕ `docs/pr-evidence/settings-persistence/before-focused-draft.png` (+0 -0) ➕ `docs/pr-evidence/settings-persistence/before-reload-broken.png` (+0 -0) 📝 `packages/client/src/components/panels/SettingsPanel.tsx` (+3 -0) 📝 `packages/client/src/components/ui/DraftNumberInput.tsx` (+23 -5) </details> ### 📄 Description <!-- Target branch: `staging`. The default base in this UI is `main` (release branch). --> <!-- Change the base to `staging` before submitting unless this is a maintainer-approved mainline change. --> <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue <!-- Every PR should reference a feature request or issue report. If there isn't one yet, open one first to gather opinions: --> <!-- https://github.com/Pasta-Devs/Marinara-Engine/issues/new/choose --> No linked issue. Reported directly in Codex; a GitHub issue should be opened before submission if maintainers require one. ## Why this change <!-- What user problem, bug, or goal does this solve? --> - Settings number fields could look changed while still focused, but the value was only local draft input state. Reloading before blur/Enter dropped the edit, which made Image Generation canvas sizes look like they did not persist and left users wondering whether there was a hidden save button. ## What changed <!-- List the key changes in this PR --> - Added an opt-in `commitOnValidChange` mode to `DraftNumberInput` so settings fields can persist valid values while the field remains focused. - Enabled focused valid commits for General Settings number inputs, including Image Generation canvas dimensions and Messages per page. - Kept invalid draft values as drafts until blur/reload, so out-of-range image sizes still do not persist. ## Validation <!-- Required: include commands run and/or manual checks performed --> - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes <!-- Describe exactly what you tested in a real browser/app, step by step. --> <!-- ⚠️ If an AI agent filled out or ticked these boxes for you, treat them --> <!-- as a TO-DO LIST, not as proof the work is done. Verify each item yourself --> <!-- before submitting. If you haven't verified it, untick the box. --> - Codex Playwright repro before the fix: opened Settings > General > Image Generation, typed `1152` into the focused Selfies height field, confirmed localStorage and `/api/app-settings/ui` did not contain `1152`, then reloaded and saw the field revert to `768`. - Codex Playwright verification after the fix: repeated the same focused edit, confirmed localStorage and `/api/app-settings/ui` contained `1152` after debounce, then reloaded and saw Selfies height remain `1152`. - Codex Playwright edge case: changed Messages per page to `37` while focused, waited for sync, reloaded, and saw `37` persist. - Codex Playwright edge case: typed invalid Selfies height `8192`, waited, reloaded, and confirmed it did not persist; the field returned to the prior valid `1152`. - `pnpm check` passed locally. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) <!-- Add before/after screenshots or recordings for UI changes --> Before: focused draft shows `1152`, but it is not persisted yet. ![Focused draft before fix](https://raw.githubusercontent.com/cha1latte/Marinara-Engine/d0bc137a655cf7c846af0c3ee6d3ce41b7e66430/docs/pr-evidence/settings-persistence/before-focused-draft.png) Before: reload drops the focused draft back to `768`. ![Reloaded before fix](https://raw.githubusercontent.com/cha1latte/Marinara-Engine/d0bc137a655cf7c846af0c3ee6d3ce41b7e66430/docs/pr-evidence/settings-persistence/before-reload-broken.png) After: reload keeps the focused edit at `1152`. ![Reloaded after fix](https://raw.githubusercontent.com/cha1latte/Marinara-Engine/d0bc137a655cf7c846af0c3ee6d3ce41b7e66430/docs/pr-evidence/settings-persistence/after-reload-fixed.png) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Numeric input fields for image dimensions and messages per page now validate entries before committing, preventing invalid values from being saved. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/950?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:11:11 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4853
No description provided.