UX patch covering two data-loss-prone code paths and a couple of quality-of-life fixes around custom format handling.
Fixes
- Custom format filenames preserve
!prefix.sanitizeFilenamepreviously stripped!from CF names, so!FLUXandFLUXcollided to the same target file (flux-radarr.json) and one silently overwrote the other.!is safe on every filesystem we support and is a very common convention for user-authored CFs (TRaSH-style sort-to-top). After this release!FLUXlives at!flux-radarr.jsonandFLUXatflux-radarr.json— no collision. Existing files migrate on next startup. Regression test:TestFileStore_PreservesBangPrefix. - Auto-sync toggle no longer rewrites the rule. When the Auto-sync this profile checkbox in the sync modal was toggled,
toggleAutoSyncForProfilePUT the entire rule with whatever the current sync form had. If the user reached the modal via Save & Sync on a TRaSH profile (fresh defaults — no extra CFs, no overrides loaded), a single toggle click silently replaced the rule's saved customizations with empty state. The handler now only modifies theenabledflag; customizations are edited only through the Apply path or the Edit-pencil in the Sync Rules list. - "Showing X Custom Formats" counter on the Custom Formats tab read the wrong field on the category objects (
c.cfs?.lengthinstead ofc.totalCFs) and so always rendered 0. Now reflects the real total across TRaSH categories + your own custom CFs.
UX
- Sync modal defaults to "Create new profile" when opened from the profile list. Previously it auto-flipped to "Update existing profile" if any sync history matched the TRaSH profile, which silently put the user in overwrite mode. The Edit-pencil flow on a sync rule still flips to update automatically (that's its purpose).
- Confirmation dialog before overwriting an existing sync rule. When the user explicitly picks "Update existing profile" and clicks Apply, a modal now describes what will be overwritten ("the saved rule with N CFs and M score overrides will be replaced") and offers to cancel and use the Edit pencil instead. The Edit-pencil flow itself doesn't show this dialog — overwriting is the explicit intent there.