fix(desktop): correct @ file search replacement in EmptySession
Same bug as ChatInput — inserting filename at cursor without removing the @filter trigger text, producing @foofile.ts instead of file.ts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -484,8 +484,9 @@ export function EmptySession() {
|
|||||||
filter={atFilter}
|
filter={atFilter}
|
||||||
onSelect={(_path, name) => {
|
onSelect={(_path, name) => {
|
||||||
if (atCursorPos >= 0) {
|
if (atCursorPos >= 0) {
|
||||||
const newValue = `${input.slice(0, atCursorPos)}${name}${input.slice(atCursorPos)}`
|
const atStart = atCursorPos - atFilter.length - 1
|
||||||
const newCursorPos = atCursorPos + name.length
|
const newValue = `${input.slice(0, atStart)}${name}${input.slice(atCursorPos)}`
|
||||||
|
const newCursorPos = atStart + name.length
|
||||||
setInput(newValue)
|
setInput(newValue)
|
||||||
setFileSearchOpen(false)
|
setFileSearchOpen(false)
|
||||||
setAtFilter('')
|
setAtFilter('')
|
||||||
|
|||||||
Reference in New Issue
Block a user