Summary
Prevent AdminImageSelectorSwitcher from replacing a user's in-progress manualUrl when selectedImageUrl changes.
Rationale
The synchronization effect in src/components/ui/image-selectors/AdminImageSelectorSwitcher.tsx currently resets manualUrl whenever selectedImageUrl changes. An asynchronous form update or re-sync can therefore discard a manual URL that the user is still entering.
Affected area
src/components/ui/image-selectors/AdminImageSelectorSwitcher.tsx
AdminImageSelectorSwitcher
- The
useEffect that synchronizes props.selectedImageUrl into manualUrl and isValidUrl
Required changes
Guard synchronization so it does not overwrite in-progress manual input. Use a value comparison or explicit dirty-state tracking. Preserve validation behavior for externally applied image URLs.
Acceptance criteria
- A user can type a new manual URL without an unrelated
selectedImageUrl update replacing the typed value.
- An intentional external image URL update still updates the selector state when appropriate.
isValidUrl remains consistent with the displayed manual URL.
Backlinks
Summary
Prevent
AdminImageSelectorSwitcherfrom replacing a user's in-progressmanualUrlwhenselectedImageUrlchanges.Rationale
The synchronization effect in
src/components/ui/image-selectors/AdminImageSelectorSwitcher.tsxcurrently resetsmanualUrlwheneverselectedImageUrlchanges. An asynchronous form update or re-sync can therefore discard a manual URL that the user is still entering.Affected area
src/components/ui/image-selectors/AdminImageSelectorSwitcher.tsxAdminImageSelectorSwitcheruseEffectthat synchronizesprops.selectedImageUrlintomanualUrlandisValidUrlRequired changes
Guard synchronization so it does not overwrite in-progress manual input. Use a value comparison or explicit dirty-state tracking. Preserve validation behavior for externally applied image URLs.
Acceptance criteria
selectedImageUrlupdate replacing the typed value.isValidUrlremains consistent with the displayed manual URL.Backlinks