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}
|
||||
onSelect={(_path, name) => {
|
||||
if (atCursorPos >= 0) {
|
||||
const newValue = `${input.slice(0, atCursorPos)}${name}${input.slice(atCursorPos)}`
|
||||
const newCursorPos = atCursorPos + name.length
|
||||
const atStart = atCursorPos - atFilter.length - 1
|
||||
const newValue = `${input.slice(0, atStart)}${name}${input.slice(atCursorPos)}`
|
||||
const newCursorPos = atStart + name.length
|
||||
setInput(newValue)
|
||||
setFileSearchOpen(false)
|
||||
setAtFilter('')
|
||||
|
||||
Reference in New Issue
Block a user