Alternatives
Design alternatives considered and rejected during implementation (beyond those documented in the architectural exploration).
Upload callback injection (4.x approach vs 5.0.0 context)
Section titled “Upload callback injection (4.x approach vs 5.0.0 context)”- Option A (4.x): Three callback props per consumer (
onUpload,onUploadFromUrl,onCheckReachability). Each consumer threads them through<ItemCardEditor>and<ImageUploadDialog>. - Option B (bridge hook):
useItemImageUploadDialogreturns three handlers composed from TanStack mutations. Consumers destructure and pass as props. Implemented in 4.11.x. - Option C (5.0.0, chosen): Single
ImageUploaderinterface via<ImageUploadProvider>context. Components consume viauseImageUploader()hook. Eliminates prop drilling and parallel-implementation drift.
Option A was the initial approach; Option B was a stepping stone. Option C was chosen for 5.0.0 because the three-callback pattern was a leaky abstraction creating coupling between consumer and provider.
CDN auth modes
Section titled “CDN auth modes”- Cookies only: Simplest but doesn’t work on Amplify preview / localhost (domain mismatch).
- Signed URLs only: Works everywhere but adds latency (server round-trip per image) and doesn’t cache as effectively.
- Dual mode (chosen):
CdnAuthProviderdetects origin and selects the appropriate mode. Zero overhead in production (cookie pass-through), signed URLs only in non-production.
Image column in AG Grid
Section titled “Image column in AG Grid”- AG Grid
editable: true+cellEditor: Standard AG Grid approach. Rejected because the Radix-portalled dialog is incompatible with AG Grid’s focus-scope lifecycle (FD-20). - Wrapper-scoped dialog (chosen): Grid triggers (double-click / Enter),
ItemTableAGGridowns the dialog lifecycle, commit viaapplyTransaction. Works reliably with any portalled modal.
getCroppedImage zoom handling
Section titled “getCroppedImage zoom handling”- Always scale by zoom (PR #99 original): Created coordinate-space
mismatch with
croppedAreaPixelsfrom react-easy-crop. - Never scale by zoom (PR #102 first attempt): Lost zoom-only edits (zero pixelCrop path).
- Two-path: scale only for zero pixelCrop (PR #102 second attempt):
Non-zero path still produced unchanged output because
croppedAreaPixelsat zoom < 1 is the full image rect. - Correct approach (tracked in #755): Needs investigation of react-easy-crop’s actual coordinate model at zoom < 1 with realistic image dimensions, not 1x1 mocks.
Copyright: (c) Arda Systems 2025-2026, All rights reserved
Copyright: © Arda Systems 2025-2026, All rights reserved