Skip to content

refactor(vscode): share dropped mention text insertion - #13656

Merged
marius-kilocode merged 1 commit into
mainfrom
dedupe-b-ui-fourth
Sep 1, 2026
Merged

refactor(vscode): share dropped mention text insertion#13656
marius-kilocode merged 1 commit into
mainfrom
dedupe-b-ui-fourth

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

What Problem This Solves

The chat prompt and New Worktree dialog duplicate the text and caret calculation for dropped file mentions.

Why This Change Was Made

Share only the pure insertion calculation in the existing path-mentions utility. Keep path conversion, mention registration, prompt cancellation/persistence, focus, and textarea sizing local and in the same order. Preserve insertion at selectionStart without replacing selected text, the unconditional trailing space, and paths containing spaces.

User Impact

No intended behavior change. No new files, dependencies, or test harness. Add one small regression test to the existing path-mentions suite.

Evidence

  • Fresh branch from origin/main after PR refactor(vscode): share local activity indicator #13651 merged. Three production files, existing test file, and one allowlist removal: 23 additions, 36 deletions. Net 13 fewer total lines and 7 fewer production lines.
  • Duplication report: 27 to 26 pairs, 521 to 509 duplicated lines, 3,646 to 3,524 duplicated tokens. Remove only fingerprint 0772e382c935aa93.
  • 123 focused mention/terminal tests passed, 179 assertions. Compile/build:check, host/webview typecheck, lint, knip, formatting, and duplication/annotation guards passed.
  • Visible isolated VS Code, disposable fixture and fresh HOME: dispatched an internal file-drop event for two paths into the real sidebar handler, with following text selected. Both mentions rendered, selected following text remained, caret collapsed to position 29, and focus stayed on the textarea. No prompt or model call was sent. The New Worktree dialog and an OS-originated drag were not manually exercised. Screenshot inspected; stop-vscode --cleanup true and stop completed.

Two dropped file mentions inserted before preserved following text in an unsent prompt

@kilo-code-bot

kilo-code-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (5 files)
  • packages/kilo-vscode/webview-ui/src/utils/path-mentions.ts
  • packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/NewWorktreeDialog.tsx
  • packages/kilo-vscode/tests/unit/path-mentions.test.ts
  • script/kilocode-duplication-allowlist.json

Reviewed by grok-4.6 · Input: 176.9K · Output: 7K · Cached: 186K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit b6a2979 into main Sep 1, 2026
33 checks passed
@marius-kilocode
marius-kilocode deleted the dedupe-b-ui-fourth branch September 1, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants