diff --git a/apps/app/src/develop/Panels.tsx b/apps/app/src/develop/Panels.tsx index 1a14a3b..8c7a835 100644 --- a/apps/app/src/develop/Panels.tsx +++ b/apps/app/src/develop/Panels.tsx @@ -73,17 +73,18 @@ export function Slider(props: { ); } -function Section({ title, children, open: initial = true, onReset }: { title: string; children: React.ReactNode; open?: boolean; onReset?: () => void }) { +function Section({ title, children, open: initial = true, onReset, extra }: { title: string; children: React.ReactNode; open?: boolean; onReset?: () => void; extra?: React.ReactNode }) { const [open, setOpen] = useState(initial); return (
- + {extra} {onReset && ( - )} - {props.onAuto && (g.key === "wb" || g.key === "tone") && ( + {props.modules.includes("basic") && + BASIC_GROUPS.map((g) => ( +
resetIds(g.ids)} + extra={ + props.onAuto && (g.key === "wb" || g.key === "tone") ? ( + + {g.key === "wb" && ( + + )} - )} -
- {g.ids.map(slider)} - - ))} -
- )} + + ) : undefined + } + > + {g.ids.map(slider)} + + ))} {extra.map((m) => { const ids = CONTROLS.filter((c) => c.module === m).map((c) => c.id); if (!ids.length) return null; diff --git a/apps/app/src/library/FilterBar.tsx b/apps/app/src/library/FilterBar.tsx index 355aebf..aab8246 100644 --- a/apps/app/src/library/FilterBar.tsx +++ b/apps/app/src/library/FilterBar.tsx @@ -69,7 +69,7 @@ export function FilterBar(props: { filter: LibraryFilter; onChange: (f: LibraryF {t.colorNone} {f.uncolored && {t.colorUncolored}} - {f.color && !f.uncolored && ( + {f.color && f.color !== "NONE" && !f.uncolored && ( {f.withoutColor ? t.colorWithout(t.colors[f.color]) : t.colorOnly(t.colors[f.color])} )} diff --git a/apps/app/src/library/LibraryMenus.tsx b/apps/app/src/library/LibraryMenus.tsx index ad58d97..68d079a 100644 --- a/apps/app/src/library/LibraryMenus.tsx +++ b/apps/app/src/library/LibraryMenus.tsx @@ -57,7 +57,7 @@ export function LibraryMenus(props: { run(props.onSelectNone)} /> run(props.onSelectUncolored)} /> {COLORS.filter((c) => c !== "NONE").map((c) => ( - run(() => props.onSelectColor(c))} /> + run(() => props.onSelectColor(c))} /> ))} )} @@ -71,7 +71,7 @@ export function LibraryMenus(props: { key={c} label={c === "NONE" ? t.colorNone : t.colors[c]} disabled={!props.canEdit || !props.hasSelection} - swatch={c === "NONE" ? "none" : (LABEL_COLOR[c] ?? undefined)} + swatch={c === "NONE" ? "none" : (LABEL_COLOR[c] ?? "")} onSelect={() => run(() => props.onColor(c))} /> ))} diff --git a/apps/app/src/library/Squads.tsx b/apps/app/src/library/Squads.tsx index c2e1791..44b965d 100644 --- a/apps/app/src/library/Squads.tsx +++ b/apps/app/src/library/Squads.tsx @@ -161,7 +161,7 @@ export function SquadsButton({ api, event, canEdit, onSaved, facesTick = 0, sele } /** The enrolled face, the squad photo, or an empty slot when this athlete has neither. */ -function FaceThumb(props: { name: string; url?: string | null; hasFace: boolean; absolute: (path: string) => string }) { +function FaceThumb(props: { name: string; url?: string | null | undefined; hasFace: boolean; absolute: (path: string) => string }) { const [failed, setFailed] = useState(false); if (!props.url || failed) { return ; diff --git a/apps/app/src/library/store.test.ts b/apps/app/src/library/store.test.ts index 28b1958..ebf05f5 100644 --- a/apps/app/src/library/store.test.ts +++ b/apps/app/src/library/store.test.ts @@ -75,7 +75,8 @@ describe("library store", () => { expect(matchesFilter(photo("a", "", { flag: "PICK", rating: 1 }), toSend)).toBe(false); expect(matchesFilter(photo("a", "", { flag: "NONE", rating: 5 }), toSend)).toBe(false); expect(matchesFilter(photo("a", "", { colorLabel: "RED" }), { ...ALL_PHOTOS, color: "GREEN" })).toBe(false); - const hideRed = { ...ALL_PHOTOS, ...cycleColor(cycleColor(ALL_PHOTOS, "RED"), "RED") }; + const once = { ...ALL_PHOTOS, ...cycleColor(ALL_PHOTOS, "RED") }; + const hideRed = { ...ALL_PHOTOS, ...cycleColor(once, "RED") }; expect(hideRed).toEqual({ ...ALL_PHOTOS, color: "RED", withoutColor: true }); expect(matchesFilter(photo("a", "", { colorLabel: "RED" }), hideRed)).toBe(false); expect(matchesFilter(photo("a", "", { colorLabel: "NONE" }), hideRed)).toBe(true); diff --git a/apps/app/src/pages/DevelopPage.tsx b/apps/app/src/pages/DevelopPage.tsx index f782337..ab7c07e 100644 --- a/apps/app/src/pages/DevelopPage.tsx +++ b/apps/app/src/pages/DevelopPage.tsx @@ -798,22 +798,52 @@ export function DevelopPage() { {picking &&

{t.dev.pickWbNow}

} {spotting &&

{t.dev.spotNow}

} {!canEdit && current &&

{t.dev.noAccess}

} -
-
+
+ + {modules.includes("crop") && ( - {t.dev.spotHelp} -
+ )} + +
+ {spotting && ( +
{SPOT_MODES.map((m) => (
-
- {modules.includes("crop") && ( + )} + {modules.includes("crop") && cropping && (
-