Skip to content

fix(cosh): remove 24-item limit on @ file completion menu#92

Open
kongche-jbw wants to merge 1 commit intoalibaba:mainfrom
kongche-jbw:fix/cosh/at-menu-limit
Open

fix(cosh): remove 24-item limit on @ file completion menu#92
kongche-jbw wants to merge 1 commit intoalibaba:mainfrom
kongche-jbw:fix/cosh/at-menu-limit

Conversation

@kongche-jbw
Copy link
Copy Markdown
Collaborator

@kongche-jbw kongche-jbw commented Apr 4, 2026

Description

Remove the hardcoded maxResults cap (MAX_SUGGESTIONS_TO_SHOW * 3 = 24) in useAtCompletion.ts that limited the @ file selection menu to only 24 results. The UI layer already supports scrolling through unlimited results with 8-per-page pagination (▲/▼ indicators, (current/total) counter, wrap-around navigation).

Related Issue

  • Related issue linked (recommended for new features and non-trivial changes)

fixes #89

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional change)
  • Performance improvement
  • CI/CD or build changes

Scope

  • cosh (copilot-shell)
  • agent-sec-core
  • os-skills
  • agentsight
  • Multiple / Project-wide

Checklist

  • I have read the Contributing Guide
  • My code follows the project's code style
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the documentation accordingly
  • For cosh: Lint passes, type check passes, and tests pass
  • For agent-sec-core (Rust): cargo clippy -- -D warnings and cargo fmt --check pass
  • For agent-sec-core (Python): Ruff format and pytest pass
  • For os-skills: Skill directory structure is valid and shell scripts pass syntax check
  • Lock files are up to date (package-lock.json / Cargo.lock)

Testing

  • Existing useAtCompletion test suite (13 tests) all pass
  • npm run build succeeds with no errors
  • Verified that removing maxResults lets the backend (fileSearch.ts) return all matching results via its default Infinity behavior

Additional Notes

The root cause was in useAtCompletion.ts:202 where maxResults: MAX_SUGGESTIONS_TO_SHOW * 3 capped search results at 24. Since the UI (useCompletion.ts + SuggestionsDisplay.tsx) already had full scroll/pagination support, simply removing this cap resolves the issue without any display-layer changes.

- remove hardcoded maxResults cap in useAtCompletion that limited search results to 24 items
@kongche-jbw
Copy link
Copy Markdown
Collaborator Author

截屏2026-04-04 09 20 34

@casparant casparant added the component:cosh Copilot Shell label Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:cosh Copilot Shell

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(cosh): @ 指令选择文件菜单中,只能显示 24 个,超过部分菜单无法列举

2 participants