What happens
When a face cluster avatar is clicked in the Navbar search panel, the app navigates to /person/:clusterId. Before PersonImages fully renders, there is a brief visible flash of the /ai-tagging page.
This does not happen when navigating to a person from within the AI Tagging page itself.
Steps to reproduce
- Open the app on any page other than
/ai-tagging (e.g. Home)
- Click the search bar to expand the search panel
- Click any face cluster avatar chip (this requires one or more folders with images with AI Tagging toggled ON in settings.)
- Observe a brief flash of the AI Tagging page before the person's images load
Expected behaviour
Navigating to /person/:clusterId renders PersonImages directly with no intermediate page flash.
Root cause (hypothesis)
PersonImages likely checks whether the target cluster exists in state.faceClusters.clusters. If the slice is still empty when the component mounts (i.e. clusters haven't been fetched yet on this session), it redirects to /ai-tagging, causing the flash.
The fix should be scoped to PersonImages.tsx: the redirect to /ai-tagging should only fire if the clusters array is non-empty and the cluster ID is genuinely absent. If the array is still empty (data not yet loaded), the component should wait rather than redirect.
// Before
if (!currentCluster) navigate('/ai-tagging');
// After
if (clusters.length > 0 && !currentCluster) navigate('/ai-tagging');
What happens
When a face cluster avatar is clicked in the Navbar search panel, the app navigates to
/person/:clusterId. BeforePersonImagesfully renders, there is a brief visible flash of the/ai-taggingpage.This does not happen when navigating to a person from within the AI Tagging page itself.
Steps to reproduce
/ai-tagging(e.g. Home)Expected behaviour
Navigating to
/person/:clusterIdrendersPersonImagesdirectly with no intermediate page flash.Root cause (hypothesis)
PersonImageslikely checks whether the target cluster exists instate.faceClusters.clusters. If the slice is still empty when the component mounts (i.e. clusters haven't been fetched yet on this session), it redirects to/ai-tagging, causing the flash.The fix should be scoped to
PersonImages.tsx: the redirect to/ai-taggingshould only fire if the clusters array is non-empty and the cluster ID is genuinely absent. If the array is still empty (data not yet loaded), the component should wait rather than redirect.