Skip to content

fix(opencode): handle CJK prefixes in TUI @ autocomplete#27651

Closed
yaohwu wants to merge 1 commit into
anomalyco:devfrom
yaohwu:dev-fix-issue-26808
Closed

fix(opencode): handle CJK prefixes in TUI @ autocomplete#27651
yaohwu wants to merge 1 commit into
anomalyco:devfrom
yaohwu:dev-fix-issue-26808

Conversation

@yaohwu
Copy link
Copy Markdown

@yaohwu yaohwu commented May 15, 2026

Issue for this PR

Closes #26808

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

  • fix TUI @ autocomplete when the prompt contains CJK text before the trigger
  • use display-width-safe slicing in the autocomplete query and guard checks
  • add a regression test covering CJK-prefixed mention and slash parsing

How did you verify your code works?

  • Reproduced in the TUI before the fix with input like 你好 @rea, which showed No matching items
  • Confirmed the same flows now work with:
    • abc @rea
    • 你好 @rea
    • 你好@rea
    • 你好 abc @pack
  • Ran:
    • bun test test/cli/run/prompt.shared.test.ts
    • bun test test/cli/run test/cli/cmd/tui/prompt-traits.test.ts test/cli/cmd/tui/prompt-part.test.ts test/cli/tui/prompt-submit-race.test.ts
    • bun typecheck

Screenshots / recordings

before:
image

after fixed:

Checklist

  • [ x] I have tested my changes locally
  • [ x] I have not included unrelated changes in this PR

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • No issue referenced. Please add Closes #<number> linking to the relevant issue.
  • Not all checklist items are checked. Please confirm you have tested locally and have not included unrelated changes.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@yaohwu yaohwu closed this May 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found one potentially related PR worth noting:

PR #27649: Fix multiline mentions

However, PR #27649 focuses on multiline mentions while PR #27651 specifically addresses CJK prefix handling in @ autocomplete, so they appear to be addressing different aspects of the mention feature rather than being duplicates.

All other search results returned only the current PR #27651 itself, indicating no other significant duplicates exist for this specific CJK prefix autocomplete fix.

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

Labels

needs:compliance This means the issue will auto-close after 2 hours.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

After version 1.14.4*. It cannot detect my filepath.

1 participant