Skip to content

[UI] "Search files and folders" input still visible when viewing a file #1256

@sunlight7777777

Description

@sunlight7777777

Description

The "Search files and folders" input remains visible in the top-right of the repository view even after a file has been opened. The search bar is only relevant to the directory/tree view and should not appear when a single file's contents are being displayed.

Steps to Reproduce

  1. Go to a public repository (e.g., entrius/gittensor)
  2. Open the Code tab — the file/folder list and the "Search files and folders" input are shown (expected)
  3. Click any file (e.g., .env.example)
  4. Observe the file contents view

Expected Behavior

When a file is opened, the "Search files and folders" input should be hidden (or replaced with an in-file search), since there is no file/folder list visible to filter.

Actual Behavior

The "Search files and folders" input is still rendered in the top-right of the file view, even though no list is shown for it to filter. Typing into it has no visible effect in this context, which is confusing.

Screenshots

  • Directory view — search input is appropriate here:
    (attach Image 1: repo root showing folders/files)
Image
  • File view (.env.example) — search input should not be shown here:
    (attach Image 2: opened file contents)
Image

Environment

  • Page: entrius/gittensor → Code tab → .env.example

Suggested Fix

Conditionally render the "Search files and folders" input only when the file tree / directory listing is the active view. When a single file is opened, either hide the input or swap it for an in-file content search.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions