Skip to content

[Bug]: Mobile / skill search does not rank, so exact name matches drop below description matches #42865

Done

Description

@electro56435

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/mobile

Steps to reproduce

  1. Have several skills enabled, where some skills mention a word in their description that is also the exact name of another skill.
  2. In the mobile composer, type / followed by the exact name of a skill.

Expected behavior

The skill whose name matches the query exactly is first, then prefix and word-boundary name matches, then description matches. This is how the $ skill menu already ranks.

Actual behavior

The exact name match can appear below skills that only match in their description. Slash commands always come before skills. The list keeps its original order.

Cause

In apps/mobile/src/features/threads/use-composer-command-menu.ts (slash trigger, near line 424), skill items are only filtered with matchesSlashSkillQuery from composerSlashSkillSearch.ts. That function returns a boolean (substring match on name, displayName, shortDescription or description), and the result keeps the source order and is appended after commandItems.

The trigger.kind === "skill" branch in the same file already ranks with scoreQueryMatch and insertRankedSearchResult (exact name 0, prefix 2, boundary 4, ..., description 20+).

Suggested fix

Score the slash-menu skills with the same scoreQueryMatch weights as the $ branch (after stripping the skill: prefix), and merge commands and skills by score, so an exact name match comes first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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