Skip to content

BUG:Text Search Bar is Non-Functional #1048

@ProthamD

Description

@ProthamD

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Bug: Text Search Bar is Non-Functional

Image

Description

The search bar in the Navbar allows users to type text but clicking the search button or pressing Enter does nothing. The search input field appears functional but has no actual search implementation.

Current Behavior

  • The search input field in the Navbar accepts text input visually
  • Clicking the Search button (magnifying glass icon) does nothing
  • Pressing Enter in the search field does nothing
  • No search results are displayed when trying to search for AI-detected tags (e.g., "dog", "beach", "person")

Expected Behavior

Users should be able to:

  1. Type tag names (like "dog", "beach", "sunset") in the search bar
  2. Press Enter or click the Search button to filter images
  3. See images that have matching AI-detected tags

Technical Details

Frontend Issue - frontend/src/components/Navigation/Navbar/Navbar.tsx

The search Input component (lines 58-62) has no functionality:

<Input
    type="search"
    placeholder="Add to your search"
    className="mr-2 flex-1 border-0 bg-neutral-200"
/>

Missing:

  • No value prop (uncontrolled input)
  • No onChange handler to capture user input
  • No onKeyDown handler to detect Enter key press

The Search button (lines 68-74) has no click handler:

<button
    className="text-muted-foreground hover:bg-accent..."
    title="Search"
    aria-label="Search"
>
    <Search className="h-4 w-4" />
</button>

Missing: No onClick handler

Backend Issue - No search by tags endpoint

The backend /images/ endpoint only supports filtering by tagged (boolean) but not by specific tag names.

Proposed Solution

  1. Frontend:

    • Add state management for search query
    • Add onChange and onKeyDown handlers to the Input
    • Add onClick handler to the Search button
    • Connect to backend API and update Redux state with filtered results
  2. Backend:

    • Create new endpoint: GET /images/search?tags=dog,beach
    • Query database for images containing any of the specified tags
    • Return filtered image list

Environment

  • OS: Windows
  • PictoPy Version: Current development version

Additional Context

The Face Search feature (searching by uploading a photo) works correctly. This issue is specifically about the text-based search by AI tags feature.

Record

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions