Skip to content

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

Merged
kongche-jbw merged 1 commit intoalibaba:mainfrom
kongche-jbw:fix/cosh/at-menu-limit
Apr 7, 2026
Merged

fix(cosh): remove 24-item limit on @ file completion menu#92
kongche-jbw merged 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 src/copilot-shell/ label Apr 4, 2026
@kongche-jbw kongche-jbw self-assigned this Apr 7, 2026
Copy link
Copy Markdown
Collaborator

@samchu-zsl samchu-zsl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kongche-jbw kongche-jbw merged commit 703e735 into alibaba:main Apr 7, 2026
11 of 13 checks passed
@kongche-jbw kongche-jbw deleted the fix/cosh/at-menu-limit branch April 7, 2026 08:03
@kongche-jbw kongche-jbw mentioned this pull request Apr 8, 2026
22 tasks
@casparant casparant added this to the cosh/v2.0.3 milestone Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:cosh src/copilot-shell/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants