Skip to content

[bug][alpha] FileExplorer: sort-menu state and outside-click handler are dead code (showSortMenu never opens; sortMenuRef never attached) #38227

@BugH-00

Description

@BugH-00

Project

ide

Description

FileExplorer (src/components/FileExplorer.tsx) declares showSortMenu, setShowSortMenu, sortMenuRef, and a createEffect that registers document mousedown to close the menu when clicking outside.

Nothing in the component ever calls setShowSortMenu(true), and sortMenuRef is never bound to a DOM node (ref={sortMenuRef} does not exist). The outside-click branch therefore never runs meaningfully (sortMenuRef stays undefined), and no sort dropdown is rendered.

Explorer sort order remains the real explorer.sortOrder setting (Settings UI / SettingsContext) — this block is orphaned scaffolding, not the live sort path.

Single root cause: unfinished or abandoned quick-sort UI left in the tree without a trigger or menu markup.

Error Message

Debug Logs

System Information

Cortex IDE alpha
File: src/components/FileExplorer.tsx

Screenshots

Image

Steps to Reproduce

  1. Open Files sidebar with a folder loaded.
  2. Search the component (or UI) for any control that sets showSortMenu to true — none exists.
  3. Confirm no element assigns sortMenuRef.

Expected Behavior

Either remove the unused signals/effect or implement a visible sort control wired to the same model as Settings (explorer.sortOrder), with sortMenuRef on the menu root.

Actual Behavior

Dead code path; no user-facing sort menu from this state.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingideIssues related to IDEinvalidThis doesn't seem right

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions