From df741d82680645d95051665cbed3d3f82a854065 Mon Sep 17 00:00:00 2001 From: spark Date: Tue, 3 Nov 2026 16:22:00 +0000 Subject: [PATCH] feat(app): local-first ingest previews and Remove/Heal in Develop (BIT-161) Show USB/drop JPEGs in the library from a local blob before upload finishes, and expose LightCraft spot remove/heal/clone/fill in Revelar without waiting on generative AI or a WASM rebuild. --- apps/app/src/develop/Viewer.tsx | 33 ++++- apps/app/src/develop/spots.test.ts | 21 +++ apps/app/src/develop/spots.ts | 78 ++++++++++ apps/app/src/i18n.ts | 14 +- apps/app/src/library/localIngest.test.ts | 33 +++++ apps/app/src/library/localIngest.ts | 98 +++++++++++++ apps/app/src/library/uploads.ts | 56 ++++++-- apps/app/src/pages/DevelopPage.tsx | 176 ++++++++++++++++++++++- 8 files changed, 482 insertions(+), 27 deletions(-) create mode 100644 apps/app/src/develop/spots.test.ts create mode 100644 apps/app/src/develop/spots.ts create mode 100644 apps/app/src/library/localIngest.test.ts create mode 100644 apps/app/src/library/localIngest.ts diff --git a/apps/app/src/develop/Viewer.tsx b/apps/app/src/develop/Viewer.tsx index 2cf8fa6..e7856aa 100644 --- a/apps/app/src/develop/Viewer.tsx +++ b/apps/app/src/develop/Viewer.tsx @@ -108,6 +108,11 @@ interface ViewerProps { /** Eyedropper on: a click reports where (0..1 in the shown frame). */ picking?: boolean; onPick?: (u: number, v: number) => void; + /** Remove / heal tool: a click reports where (0..1 in the shown frame). */ + spotting?: boolean; + onSpot?: (u: number, v: number) => void; + /** Spot pins to draw over the loupe (normalized in the shown / cropped frame). */ + spotMarks?: { u: number; v: number; size: number }[]; } /** @@ -224,7 +229,7 @@ export function Viewer(props: ViewerProps) { // 1:1: click and drag moves the photo (the hand tool), like Lightroom. const pan = useRef<{ x: number; y: number; left: number; top: number; id: number } | null>(null); - const panning = !!props.actualPixels && !props.picking && !cropping; + const panning = !!props.actualPixels && !props.picking && !props.spotting && !cropping; const panHandlers = panning ? { onPointerDown: (e: React.PointerEvent) => { @@ -265,14 +270,34 @@ export function Viewer(props: ViewerProps) { // While cropping the photo turns under an upright crop, as in Lightroom: the engine renders it unturned // (the whole frame), and the straighten angle is shown here so a drag follows the pointer at once. style={cropping && props.crop.angle ? { transform: `rotate(${props.crop.angle}deg)` } : undefined} - className={`block h-full w-full shadow-[0_2px_12px_rgba(0,0,0,0.7)] ${props.picking ? "cursor-crosshair" : ""}`} + className={`block h-full w-full shadow-[0_2px_12px_rgba(0,0,0,0.7)] ${props.picking || props.spotting ? "cursor-crosshair" : ""}`} aria-label="Foto em revelação" onClick={(e) => { - if (!props.picking) return; + if (!props.picking && !props.spotting) return; const r = e.currentTarget.getBoundingClientRect(); - callbacks.current.onPick?.((e.clientX - r.left) / r.width, (e.clientY - r.top) / r.height); + const u = (e.clientX - r.left) / r.width; + const v = (e.clientY - r.top) / r.height; + if (props.picking) callbacks.current.onPick?.(u, v); + else callbacks.current.onSpot?.(u, v); }} /> + {props.spotMarks && props.spotMarks.length > 0 && ( + + )} {cropping && frame && ( { + it("adds a fill spot and round-trips through merge partial", () => { + const settings = "{}"; + const next = addSpot(settings, { mode: "fill", x: 0.4, y: 0.6, size: 0.03, feather: 40, opacity: 100 }); + expect(next).toHaveLength(1); + expect(next[0]?.mode).toBe("fill"); + expect(next[0]?.points[0]).toEqual({ x: 0.4, y: 0.6 }); + const merged = JSON.stringify({ ...JSON.parse(settings), ...spotsPartial(next) }); + expect(spotsOf(merged)).toEqual(next); + }); + + it("removes by index", () => { + let spots = addSpot("{}", { mode: "remove", x: 0.1, y: 0.1, size: 0.02, feather: 50, opacity: 100 }); + spots = addSpot(JSON.stringify({ spots }), { mode: "heal", x: 0.2, y: 0.2, size: 0.02, feather: 50, opacity: 100 }); + expect(removeSpotAt(JSON.stringify({ spots }), 0)).toHaveLength(1); + expect(removeSpotAt(JSON.stringify({ spots }), 0)[0]?.mode).toBe("heal"); + }); +}); diff --git a/apps/app/src/develop/spots.ts b/apps/app/src/develop/spots.ts new file mode 100644 index 0000000..2819ee1 --- /dev/null +++ b/apps/app/src/develop/spots.ts @@ -0,0 +1,78 @@ +/** Spot / heal / clone / content-aware fill — LightCraft `DevelopSettings.spots` (snake_case JSON). */ + +export type SpotMode = "remove" | "heal" | "clone" | "fill"; + +export interface SpotPoint { + x: number; + y: number; +} + +export interface Spot { + mode: SpotMode; + points: SpotPoint[]; + /** Radius as a fraction of the long edge (LightCraft default ~0.02). */ + size: number; + feather: number; + opacity: number; + source_offset?: SpotPoint | null; +} + +export const SPOT_MODES: { id: SpotMode; labelKey: "spotRemove" | "spotHeal" | "spotClone" | "spotFill" }[] = [ + { id: "remove", labelKey: "spotRemove" }, + { id: "heal", labelKey: "spotHeal" }, + { id: "clone", labelKey: "spotClone" }, + { id: "fill", labelKey: "spotFill" }, +]; + +export const DEFAULT_SPOT_SIZE = 0.025; +export const DEFAULT_SPOT_FEATHER = 50; +export const DEFAULT_SPOT_OPACITY = 100; + +export function spotsOf(settings: string): Spot[] { + try { + const s = JSON.parse(settings) as { spots?: Spot[] }; + return Array.isArray(s.spots) ? s.spots : []; + } catch { + return []; + } +} + +/** Partial for `develop.merge`: replace the spots list. */ +export function spotsPartial(spots: Spot[]): Record { + return { spots }; +} + +export function addSpot( + settings: string, + spot: { + mode: SpotMode; + x: number; + y: number; + size: number; + feather: number; + opacity: number; + sourceOffset?: SpotPoint | null; + }, +): Spot[] { + const next: Spot = { + mode: spot.mode, + points: [{ x: clamp01(spot.x), y: clamp01(spot.y) }], + size: clamp(spot.size, 0.002, 0.25), + feather: clamp(spot.feather, 0, 100), + opacity: clamp(spot.opacity, 0, 100), + source_offset: spot.sourceOffset ?? null, + }; + return [...spotsOf(settings), next]; +} + +export function removeSpotAt(settings: string, index: number): Spot[] { + return spotsOf(settings).filter((_, i) => i !== index); +} + +function clamp01(v: number): number { + return Math.min(1, Math.max(0, v)); +} + +function clamp(v: number, lo: number, hi: number): number { + return Math.min(hi, Math.max(lo, v)); +} diff --git a/apps/app/src/i18n.ts b/apps/app/src/i18n.ts index 8a95c64..6daf8ef 100644 --- a/apps/app/src/i18n.ts +++ b/apps/app/src/i18n.ts @@ -1243,6 +1243,18 @@ export const t = { saved: "Guardado", crop: "Recortar", cropDone: "Concluir", + spot: "Apagar", + spotDone: "Concluir", + spotHelp: "Clica na zona a limpar (softbox, cabo, pó). Q liga a ferramenta.", + spotNow: "Clica na foto onde queres apagar. Esc cancela.", + spotRemove: "Remover", + spotHeal: "Corrigir", + spotClone: "Clonar", + spotFill: "Preencher", + spotSize: "Tamanho", + spotFeather: "Suavizar", + spotOpacity: "Opacidade", + spotDelete: "Tirar", aspect: "Proporção", aspectFree: "Livre", aspectOriginal: "Original", @@ -1276,7 +1288,7 @@ export const t = { syncApply: "Aplicar", synced: (n: number) => `Ajustes sincronizados em ${n} ${n === 1 ? "foto" : "fotos"}`, noAccess: "Só podes revelar fotos que enviaste.", - shortcuts: "← → foto · Ctrl/Cmd+A todas · P escolher · X rejeitar · U limpar · 0–5 estrelas · 6–9 cor · G grelha · I informação · Shift+A automático · \\ antes/depois · R recortar · W conta-gotas · Z 1:1 (arrastar move) · E lupa · Ctrl+Alt+1 biblioteca · Ctrl+Z anular", + shortcuts: "← → foto · Ctrl/Cmd+A todas · P escolher · X rejeitar · U limpar · 0–5 estrelas · 6–9 cor · G grelha · I informação · Shift+A automático · \\ antes/depois · R recortar · Q apagar · W conta-gotas · Z 1:1 (arrastar move) · E lupa · Ctrl+Alt+1 biblioteca · Ctrl+Z anular", groups: { wb: "Equilíbrio de brancos", tone: "Tom", presence: "Presença", profile: "Perfil" }, labels: { "profile.amount": "Intensidade", diff --git a/apps/app/src/library/localIngest.test.ts b/apps/app/src/library/localIngest.test.ts new file mode 100644 index 0000000..bbd5e16 --- /dev/null +++ b/apps/app/src/library/localIngest.test.ts @@ -0,0 +1,33 @@ +import { describe, expect, it, vi } from "vitest"; +import { localPhotos } from "../offline/local.js"; +import { showLocalJpeg } from "./localIngest.js"; + +describe("showLocalJpeg", () => { + it("puts a desktop preview into the library before upload", async () => { + for (const p of localPhotos.list()) localPhotos.remove(p.id); + const bytes = new Uint8Array([0xff, 0xd8, 0xff, 0xd9]); + const file = new File([bytes], "IMG_1.JPG", { type: "image/jpeg" }); + // createImageBitmap may be missing in jsdom — stub size via origin. + const sha = await showLocalJpeg({ + file, + eventId: "ev1", + origin: { sha256: "abc123", size: 4, width: 100, height: 80 }, + }); + expect(sha).toBe("abc123"); + expect(localPhotos.bySha("abc123")?.eventId).toBe("ev1"); + expect(localPhotos.bySha("abc123")?.originalName).toBe("IMG_1.JPG"); + for (const p of localPhotos.list()) localPhotos.remove(p.id); + }); + + it("skips a second put for the same sha", async () => { + for (const p of localPhotos.list()) localPhotos.remove(p.id); + const file = new File([new Uint8Array([1, 2, 3])], "A.JPG", { type: "image/jpeg" }); + const origin = { sha256: "same", size: 3, width: 10, height: 10 }; + await showLocalJpeg({ file, origin }); + const spy = vi.spyOn(localPhotos, "put"); + await showLocalJpeg({ file, origin }); + expect(spy).not.toHaveBeenCalled(); + spy.mockRestore(); + for (const p of localPhotos.list()) localPhotos.remove(p.id); + }); +}); diff --git a/apps/app/src/library/localIngest.ts b/apps/app/src/library/localIngest.ts new file mode 100644 index 0000000..e8879f4 --- /dev/null +++ b/apps/app/src/library/localIngest.ts @@ -0,0 +1,98 @@ +import type { PhotoSummary } from "@photoreport/contracts"; +import { exifDateTime, lisbonInstant, localPhoto, localPhotos } from "../offline/local.js"; +import { localId, offlineQueue } from "../offline/queue.js"; +import type { DesktopOrigin } from "./uploads.js"; + +/** SHA-256 hex of the bytes (same fingerprint the desktop shell uses for the original). */ +export async function sha256Hex(bytes: ArrayBuffer): Promise { + const hash = await crypto.subtle.digest("SHA-256", bytes); + return [...new Uint8Array(hash)].map((b) => b.toString(16).padStart(2, "0")).join(""); +} + +async function imageSize(blob: Blob): Promise<{ width: number; height: number }> { + if (typeof createImageBitmap === "function") { + const bmp = await createImageBitmap(blob); + const size = { width: bmp.width, height: bmp.height }; + bmp.close(); + return size; + } + return await new Promise((resolve, reject) => { + const img = new Image(); + const url = URL.createObjectURL(blob); + img.onload = () => { + resolve({ width: img.naturalWidth, height: img.naturalHeight }); + URL.revokeObjectURL(url); + }; + img.onerror = () => { + URL.revokeObjectURL(url); + reject(new Error("decode")); + }; + img.src = url; + }); +} + +/** + * Puts a JPEG into the library at once from bytes already on this computer. Upload can finish later; + * `photo.added` (same sha) replaces this row. Returns the sha when the preview is on screen. + */ +export async function showLocalJpeg(args: { + file: File; + eventId?: string | undefined; + origin?: DesktopOrigin | undefined; + orgId?: string | undefined; +}): Promise { + const { file, eventId, origin, orgId } = args; + try { + let sha256: string; + let width: number; + let height: number; + let previewBytes: ArrayBuffer | null = null; + if (origin && origin !== "original") { + sha256 = origin.sha256; + width = origin.width; + height = origin.height; + } else { + previewBytes = await file.arrayBuffer(); + sha256 = await sha256Hex(previewBytes); + const size = await imageSize(new Blob([previewBytes], { type: "image/jpeg" })); + width = size.width; + height = size.height; + } + if (localPhotos.bySha(sha256)) return sha256; + let url = ""; + try { + url = URL.createObjectURL(file); + } catch { + /* tests / no blob URLs */ + } + const capturedAt = previewBytes ? lisbonInstant(exifDateTime(previewBytes)) : null; + localPhotos.put( + localPhoto({ + sha256, + name: file.name, + width, + height, + capturedAt, + eventId: eventId ?? null, + url, + }), + ); + if (orgId) { + for (const op of offlineQueue(orgId).pending) { + if (op.kind === "patch" && op.ids.includes(localId(sha256))) { + localPhotos.patch(localId(sha256), op.patch as Partial); + } + } + } + return sha256; + } catch { + return null; + } +} + +/** After the server has the photo: map offline edits and drop the local stand-in. */ +export function settleLocalUpload(orgId: string, sha256: string | null | undefined, photo: PhotoSummary | undefined): void { + if (!sha256) return; + if (photo) offlineQueue(orgId).uploaded(sha256, photo.id); + localPhotos.remove(localId(sha256)); +} \ No newline at end of file diff --git a/apps/app/src/library/uploads.ts b/apps/app/src/library/uploads.ts index 2df6b31..095b81a 100644 --- a/apps/app/src/library/uploads.ts +++ b/apps/app/src/library/uploads.ts @@ -1,7 +1,8 @@ import type { PhotoSummary } from "@photoreport/contracts"; import { ApiError, type ApiClient } from "@photoreport/sdk"; -import { isNetworkError } from "../offline/queue.js"; +import { isNetworkError, offlineQueue } from "../offline/queue.js"; import { useCallback, useRef, useState } from "react"; +import { settleLocalUpload, showLocalJpeg } from "./localIngest.js"; export type UploadStatus = "queued" | "uploading" | "done" | "duplicate" | "failed"; @@ -146,12 +147,21 @@ export async function sendResumable( } /** - * Parallel upload queue (4 at a time). New photos show up in the grid through the live channel, so the queue - * only tracks progress. Non-JPEG files are refused before sending. + * Parallel upload queue (4 at a time). Each JPEG is shown in the library from a local preview at once; + * the live channel replaces it when the server has the photo. Non-JPEG files are refused before sending. */ export function useUploadQueue(api: ApiClient, orgId: string) { const [items, setItems] = useState([]); - const queue = useRef<{ item: UploadItem; file: File; eventId: string | undefined; original?: DesktopOrigin; onSettled?: (status: UploadStatus, photo?: PhotoSummary) => void }[]>([]); + const queue = useRef< + { + item: UploadItem; + file: File; + eventId: string | undefined; + original?: DesktopOrigin; + sha256?: string | null; + onSettled?: (status: UploadStatus, photo?: PhotoSummary) => void; + }[] + >([]); const running = useRef(0); /** No network: the queue waits (nothing fails) and carries on when the connection is back. */ const paused = useRef(false); @@ -166,7 +176,7 @@ export function useUploadQueue(api: ApiClient, orgId: string) { const next = queue.current.shift()!; running.current++; void (async () => { - const { item, file, eventId, original, onSettled } = next; + const { item, file, eventId, original, sha256, onSettled } = next; let final: UploadStatus = "failed"; let filed: PhotoSummary | undefined; let waiting = false; @@ -179,11 +189,11 @@ export function useUploadQueue(api: ApiClient, orgId: string) { file, eventId, (p) => { - const now = Date.now(); - if (now - lastTick > 150 || p === 1) { - lastTick = now; - update(item.id, { progress: p }); - } + const now = Date.now(); + if (now - lastTick > 150 || p === 1) { + lastTick = now; + update(item.id, { progress: p }); + } }, original, ); @@ -215,7 +225,13 @@ export function useUploadQueue(api: ApiClient, orgId: string) { } } else update(item.id, { status: "failed", error: (err as Error).message }); } finally { - if (!waiting) onSettled?.(final, filed); + if (!waiting) { + if (final === "done" || final === "duplicate") { + settleLocalUpload(orgId, sha256, filed); + void offlineQueue(orgId).flush(api); + } + onSettled?.(final, filed); + } running.current--; pump(); } @@ -236,14 +252,24 @@ export function useUploadQueue(api: ApiClient, orgId: string) { continue; } added.push(item); - queue.current.push({ item, file, eventId, ...(original && { original }), ...(onSettled && { onSettled: (status: UploadStatus, photo?: PhotoSummary) => onSettled(file, status, photo) }) }); + // Preview in the grid before the bytes leave this computer (USB, drop, FTP share this path). + void (async () => { + const sha256 = await showLocalJpeg({ file, eventId, origin: original, orgId }); + queue.current.push({ + item, + file, + eventId, + ...(original && { original }), + sha256, + ...(onSettled && { onSettled: (status: UploadStatus, photo?: PhotoSummary) => onSettled(file, status, photo) }), + }); + pump(); + })(); } setItems((list) => [...list.filter((i) => i.status !== "done" && i.status !== "duplicate"), ...added]); - pump(); }, - [pump], + [orgId, pump], ); - const clear = useCallback(() => setItems((list) => list.filter((i) => i.status === "queued" || i.status === "uploading")), []); return { items, add, clear }; diff --git a/apps/app/src/pages/DevelopPage.tsx b/apps/app/src/pages/DevelopPage.tsx index 513b21d..2f083dd 100644 --- a/apps/app/src/pages/DevelopPage.tsx +++ b/apps/app/src/pages/DevelopPage.tsx @@ -12,6 +12,17 @@ import { type Crop, cropOf, DevelopSession, localOutbox } from "../develop/sessi import { SyncSettingsButton } from "../develop/SyncSettings.js"; import { commandsFrom, queueSync } from "../develop/copySettings.js"; import { clampUnit, constrainRotated, fitAspect, GUIDES, type Guide, rotateAspect } from "../develop/crop.js"; +import { + addSpot, + DEFAULT_SPOT_FEATHER, + DEFAULT_SPOT_OPACITY, + DEFAULT_SPOT_SIZE, + removeSpotAt, + SPOT_MODES, + spotsOf, + spotsPartial, + type SpotMode, +} from "../develop/spots.js"; import { engineAuto, Viewer } from "../develop/Viewer.js"; import { IptcInfo } from "../library/IptcInfo.js"; import { activePhoto, savedFilter, saveFilter, setActivePhoto } from "../library/active.js"; @@ -342,12 +353,21 @@ export function DevelopPage() { e.preventDefault(); flagCurrent(patchForKey(e.key)!); } - else if (e.key.toLowerCase() === "r" && canEdit) setCropping((c) => !c); - else if (e.key.toLowerCase() === "w" && canEdit) setPicking((p) => !p); - else if (e.key.toLowerCase() === "z") setOneToOne((z) => !z); + else if (e.key.toLowerCase() === "r" && canEdit) { + setSpotting(false); + setCropping((c) => !c); + } else if (e.key.toLowerCase() === "q" && canEdit) { + setCropping(false); + setPicking(false); + setSpotting((s) => !s); + } else if (e.key.toLowerCase() === "w" && canEdit) { + setSpotting(false); + setPicking((p) => !p); + } else if (e.key.toLowerCase() === "z") setOneToOne((z) => !z); else if (e.key === "Escape") { setCropping(false); setPicking(false); + setSpotting(false); } }; window.addEventListener("keydown", onKey); @@ -356,6 +376,7 @@ export function DevelopPage() { const settings = session?.loaded ? session.settings : null; const crop = useMemo(() => (settings ? cropOf(settings) : { rect: { x0: 0, y0: 0, x1: 1, y1: 1 }, angle: 0, aspect: null }), [settings]); + const spots = useMemo(() => (settings ? spotsOf(settings) : []), [settings]); const shown = settings && before && typeof engine === "object" ? engine.defaultSettings() : settings; const setValue = useCallback( @@ -366,9 +387,57 @@ export function DevelopPage() { [session], ); const [picking, setPicking] = useState(false); + const [spotting, setSpotting] = useState(false); + const [spotMode, setSpotMode] = useState("remove"); + const [spotSize, setSpotSize] = useState(DEFAULT_SPOT_SIZE); + const [spotFeather, setSpotFeather] = useState(DEFAULT_SPOT_FEATHER); + const [spotOpacity, setSpotOpacity] = useState(DEFAULT_SPOT_OPACITY); + + const placeSpot = useCallback( + (u: number, v: number) => { + if (!session?.loaded || !canEdit) return; + const r = crop.rect; + const x = r.x0 + u * (r.x1 - r.x0); + const y = r.y0 + v * (r.y1 - r.y0); + const next = addSpot(session.settings, { + mode: spotMode, + x, + y, + size: spotSize, + feather: spotFeather, + opacity: spotOpacity, + }); + session.edit({ command: "develop.merge", params: { partial: spotsPartial(next) } }); + session.endGesture(); + }, + [session, canEdit, crop.rect, spotMode, spotSize, spotFeather, spotOpacity], + ); + + const deleteSpot = useCallback( + (index: number) => { + if (!session?.loaded || !canEdit) return; + session.edit({ command: "develop.merge", params: { partial: spotsPartial(removeSpotAt(session.settings, index)) } }); + session.endGesture(); + }, + [session, canEdit], + ); + + const spotMarks = useMemo(() => { + if (!spotting || !spots.length) return []; + const r = crop.rect; + const rw = r.x1 - r.x0 || 1; + const rh = r.y1 - r.y0 || 1; + return spots + .map((s) => { + const p = s.points[0]; + if (!p) return null; + return { u: (p.x - r.x0) / rw, v: (p.y - r.y0) / rh, size: s.size / Math.max(rw, rh) }; + }) + .filter((m): m is { u: number; v: number; size: number } => !!m && m.u >= -0.05 && m.u <= 1.05 && m.v >= -0.05 && m.v <= 1.05); + }, [spotting, spots, crop.rect]); + /** 1:1 view, and where its full-resolution original stands. */ - const [oneToOne, setOneToOne] = useState(false); - const [fullState, setFullState] = useState<"idle" | "waiting" | "ready" | "missing">("idle"); + const [oneToOne, setOneToOne] = useState(false); const [fullState, setFullState] = useState<"idle" | "waiting" | "ready" | "missing">("idle"); useEffect(() => { setOneToOne(false); setFullState("idle"); @@ -625,13 +694,16 @@ export function DevelopPage() { {...(oneToOne || current.originalName.toLowerCase().endsWith(".dng") || current.name.toLowerCase().endsWith(".dng") ? { localSource: fullSource } : isDesktop() && { localSource: () => localOriginalToView(current.sha256) })} - picking={picking && !cropping && !before} + picking={picking && !cropping && !spotting && !before} onPick={(u, v) => { setPicking(false); // The view shows the cropped frame: map back to the whole frame (straighten angle ignored). const r = crop.rect; void autoValues("pick", { x: r.x0 + u * (r.x1 - r.x0), y: r.y0 + v * (r.y1 - r.y0) }); }} + spotting={spotting && !cropping && !before} + onSpot={placeSpot} + spotMarks={spotMarks} onCrop={(rect, final) => { setDragging(!final); session?.edit({ command: "crop.set", params: { rect: clampUnit(rect), angle: crop.angle, aspect: crop.aspect } }, "crop"); @@ -651,13 +723,103 @@ export function DevelopPage() { {oneToOne && fullState === "waiting" &&

{t.dev.fullWaiting}

} {oneToOne && fullState === "missing" &&

{t.dev.fullMissing}

} {picking &&

{t.dev.pickWbNow}

} + {spotting &&

{t.dev.spotNow}

} {!canEdit && current &&

{t.dev.noAccess}

} +
+
+ + {t.dev.spotHelp} +
+
+ {SPOT_MODES.map((m) => ( + + ))} +
+ + + + {spots.length > 0 && ( +
    + {spots.map((s, i) => { + const label = SPOT_MODES.find((m) => m.id === s.mode); + return ( +
  • + + {label ? t.dev[label.labelKey] : s.mode} · {i + 1} + + +
  • + ); + })} +
+ )} +
{modules.includes("crop") && (