Add recipe debugging

This commit is contained in:
Sam Becker 2025-02-24 08:44:35 -06:00
parent 6554bd49c4
commit 6676fb3cc8
4 changed files with 17 additions and 1 deletions

View File

@ -112,6 +112,7 @@ export default function CommandKClient({
shouldShowBaselineGrid, shouldShowBaselineGrid,
shouldDebugImageFallbacks, shouldDebugImageFallbacks,
shouldDebugInsights, shouldDebugInsights,
shouldDebugRecipeOverlays,
setIsCommandKOpen: setIsOpen, setIsCommandKOpen: setIsOpen,
setShouldRespondToKeyboardCommands, setShouldRespondToKeyboardCommands,
setShouldShowBaselineGrid, setShouldShowBaselineGrid,
@ -120,6 +121,7 @@ export default function CommandKClient({
setArePhotosMatted, setArePhotosMatted,
setShouldDebugImageFallbacks, setShouldDebugImageFallbacks,
setShouldDebugInsights, setShouldDebugInsights,
setShouldDebugRecipeOverlays,
} = useAppState(); } = useAppState();
const isOpenRef = useRef(isOpen); const isOpenRef = useRef(isOpen);
@ -299,6 +301,11 @@ export default function CommandKClient({
setShouldDebugInsights, setShouldDebugInsights,
shouldDebugInsights, shouldDebugInsights,
), ),
renderToggle(
'Recipe Overlays',
setShouldDebugRecipeOverlays,
shouldDebugRecipeOverlays,
),
], ],
}); });
} }

View File

@ -93,6 +93,7 @@ export default function PhotoLarge({
const { const {
areZoomControlsShown, areZoomControlsShown,
arePhotosMatted, arePhotosMatted,
shouldDebugRecipeOverlays,
isUserSignedIn, isUserSignedIn,
} = useAppState(); } = useAppState();
@ -182,7 +183,9 @@ export default function PhotoLarge({
'flex items-center justify-center', 'flex items-center justify-center',
)}> )}>
<AnimatePresence> <AnimatePresence>
{shouldShowRecipe && photo.fujifilmRecipe && photo.filmSimulation && {(shouldShowRecipe || shouldDebugRecipeOverlays) &&
photo.fujifilmRecipe &&
photo.filmSimulation &&
<PhotoRecipe <PhotoRecipe
ref={refRecipe} ref={refRecipe}
recipe={photo.fujifilmRecipe} recipe={photo.fujifilmRecipe}

View File

@ -46,6 +46,8 @@ export interface AppStateContext {
setShouldShowBaselineGrid?: Dispatch<SetStateAction<boolean>> setShouldShowBaselineGrid?: Dispatch<SetStateAction<boolean>>
shouldDebugInsights?: boolean shouldDebugInsights?: boolean
setShouldDebugInsights?: Dispatch<SetStateAction<boolean>> setShouldDebugInsights?: Dispatch<SetStateAction<boolean>>
shouldDebugRecipeOverlays?: boolean
setShouldDebugRecipeOverlays?: Dispatch<SetStateAction<boolean>>
} }
export const AppStateContext = createContext<AppStateContext>({}); export const AppStateContext = createContext<AppStateContext>({});

View File

@ -65,6 +65,8 @@ export default function AppStateProvider({
useState(false); useState(false);
const [shouldDebugInsights, setShouldDebugInsights] = const [shouldDebugInsights, setShouldDebugInsights] =
useState(IS_DEVELOPMENT); useState(IS_DEVELOPMENT);
const [shouldDebugRecipeOverlays, setShouldDebugRecipeOverlays] =
useState(false);
const invalidateSwr = useCallback(() => setSwrTimestamp(Date.now()), []); const invalidateSwr = useCallback(() => setSwrTimestamp(Date.now()), []);
@ -143,6 +145,8 @@ export default function AppStateProvider({
setShouldShowBaselineGrid, setShouldShowBaselineGrid,
shouldDebugInsights, shouldDebugInsights,
setShouldDebugInsights, setShouldDebugInsights,
shouldDebugRecipeOverlays,
setShouldDebugRecipeOverlays,
}} }}
> >
{children} {children}