Skip to content

Bug: Brief Flash of AI Tagging Page When Navigating to a Person's Images from the Search Bar #1315

@rohan-pandeyy

Description

@rohan-pandeyy

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

  1. Open the app on any page other than /ai-tagging (e.g. Home)
  2. Click the search bar to expand the search panel
  3. Click any face cluster avatar chip (this requires one or more folders with images with AI Tagging toggled ON in settings.)
  4. 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');

Metadata

Metadata

Assignees

Labels

Type

No fields configured for Bug.

Projects

Status
In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions