mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7828] [MERGED] fix(image): new style profiles no longer overwrite existing ones #7953
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#7953
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7828
Author: @SpicyMarinara
Created: 10/19/2026
Status: ✅ Merged
Merged: 10/19/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/style-profile-overwrite📝 Commits (2)
84b0cbdfix(image): new style profiles no longer overwrite existing ones8419129fix(settings): keep syncing when browser storage is full; plainer size message📊 Changes
6 files changed (+225 additions, -18 deletions)
View changed files
📝
packages/client/src/components/panels/SettingsPanel.tsx(+2 -6)📝
packages/client/src/hooks/use-settings-sync.ts(+26 -9)📝
packages/client/src/localization/locales/en.json(+1 -0)📝
packages/shared/src/constants/image-style-profiles.ts(+16 -2)📝
packages/shared/src/schemas/app-settings.schema.ts(+8 -1)➕
scripts/regressions/image-style-profile-ids.regression.ts(+172 -0)📄 Description
Linked issue
No GitHub issue yet. A user reported this to the maintainer: "Instead of creating a new Style preset, when creating anything past 21, it'll rename the last known preset and append 'Custom' to the end." An issue can be opened to track it if wanted.
@SpicyMarinara
Why this change
In Settings → Image Generation → Style Profiles, Clone stops adding profiles after 21. From then on, every click replaces the newest profile with a copy of itself and adds " Custom" to its name. The replaced profile's text and tags are lost.
Cause: Clone made the new id by adding
-customto the selected profile's id (auto-custom,auto-custom-custom, …). Clone keeps the new copy selected, so copying the newest profile grows the id by 7 characters each time. Ids are cut to 80 characters when settings are normalized. The editor checked for duplicates against the uncut id, so it never noticed that the cut id already existed. The merge by id then replaced the older profile. Starting from Auto, the 11th copy is 81 characters long. That makes 21 profiles (10 built-in + 11), and every copy after that replaces the last one.Two more limits also dropped or failed to save profiles without telling anyone:
Profiles that were already overwritten cannot be recovered. The old copy was replaced in the saved settings, and no history of it is kept.
What changed
createImageStyleProfileIdnumbers copies from the original id (anime-custom,anime-custom-2, …), so ids stay short. It checks for duplicates against the stored form of the id, so a copy always gets a new id and never replaces a profile. Profiles from older builds whose ids were already cut to 80 characters can be copied too. The Clone button uses this helper.normalizeImageStyleProfileSettings, as the maintainer decided. Users can have any number of style profiles.MAX_APP_SETTINGS_VALUE_LENGTH). That fits 300 heavily edited profiles with room to spare. A typical profile is about 1,000 characters. The new limit stays under the ~5 MB of browser storage that also holds these settings. If the settings ever pass it, the app shows "Settings are too big to save, so delete some image style profiles to make room." It no longer fails silently, and no profile is dropped from the editor. If the browser cannot cache the settings locally, the push to the server still happens, and the server copy is restored on the next load.settings.sync.tooLarge.scripts/regressions/image-style-profile-ids.regression.ts. It uses the real id helper, normalizer, settings route (fullbuildApp, real body limit), file storage and server image settings loader.Validation
pnpm checkpasses locallyCONTRIBUTING.mdWhat the agent ran (not a substitute for the boxes above):
stagingby running the editor's old Clone logic through the real normalizer. Copying the newest profile from Auto went 10 → 21 profiles, then clicks 12, 13 and 14 each stayed at 21 and replaced the last profile.node ./scripts/run-regressions.mjs --filter scripts/regressions/image-style-profile-ids.regression.tspasses. It covers:PUT /api/app-settings/ui, loading after an app restart, and being read by the server's image settingsomnibar-settings-sync,assigned-issue-sweep,sprite-background,image-prompt-guidance,feature-settings,prompt,open-issues.Manual verification notes
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)No docs mention the old limits.
UI evidence (if applicable)
The size-limit message (shown from the Playwright run when the settings are pushed past the limit): "Settings are too big to save, so delete some image style profiles to make room."
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.