From 3e386a9127c667c6eca453e77942d1da4edae8ea Mon Sep 17 00:00:00 2001 From: Tanish Manku Date: Tue, 5 May 2026 14:03:21 -0700 Subject: [PATCH] artcraft: land on previous batch's last image when arrow-key paging left PageDraw lightbox left-arrow at a batch boundary called openBatchInLightbox without a startIndex, defaulting to 0, so leftward traversal skipped every non-first image in each prior batch. --- .../apps/artcraft/app/src/pages/PageImage/TextToImage.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/apps/artcraft/app/src/pages/PageImage/TextToImage.tsx b/frontend/apps/artcraft/app/src/pages/PageImage/TextToImage.tsx index ae005db46b..05ce4eaf0c 100644 --- a/frontend/apps/artcraft/app/src/pages/PageImage/TextToImage.tsx +++ b/frontend/apps/artcraft/app/src/pages/PageImage/TextToImage.tsx @@ -159,7 +159,13 @@ const TextToImage = ({ imageMediaId, imageUrl }: TextToImageProps) => { galleryModalLightboxNavPrev.value = batchIndex > 0 - ? () => openBatchInLightbox(inverseBatchRef.current[batchIndex - 1]) + ? () => { + const prevBatch = inverseBatchRef.current[batchIndex - 1]; + openBatchInLightbox( + prevBatch, + Math.max(0, prevBatch.images.length - 1), + ); + } : null; galleryModalLightboxNavNext.value = batchIndex < inverseBatchRef.current.length - 1