feat(tui-go): @ file-reference picker
Typing `@` at a word boundary in the chat input (mid-word `@` stays literal, e.g. emails) opens a workspace file picker: it requests file.list for the session (cached per session), filters as you type, and enter inserts `@path ` at the cursor — back to typing. Renders as a transparent overlay, windowed around the selection. file.list is classified non-rendering in the render-matrix guard. Tests cover token-boundary detection, ref insertion, and filtering. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -326,6 +326,13 @@ func (m *Model) applyServer(msg protocol.ServerMessage) {
|
||||
if m.ideasIndex >= len(m.ideas) {
|
||||
m.ideasIndex = 0
|
||||
}
|
||||
case protocol.TypeFileList:
|
||||
m.files = msg.Paths
|
||||
m.filesFor = msg.SessionID
|
||||
m.filesLoading = false
|
||||
if m.fileIndex >= len(m.filteredFiles()) {
|
||||
m.fileIndex = 0
|
||||
}
|
||||
case protocol.TypeConfigSnapshot:
|
||||
m.configFields = msg.ConfigFields
|
||||
m.configRestart = msg.ConfigRestartRequired
|
||||
@@ -371,7 +378,7 @@ func sessionIDOf(msg protocol.ServerMessage) string {
|
||||
protocol.TypeWorkflowList, protocol.TypeRouterResponse,
|
||||
protocol.TypeModelChanged, protocol.TypeModelList, protocol.TypeResourceStatus,
|
||||
protocol.TypeArtifactList, protocol.TypeConfigSnapshot, protocol.TypeSessionStats,
|
||||
protocol.TypeIdeaList:
|
||||
protocol.TypeIdeaList, protocol.TypeFileList:
|
||||
return ""
|
||||
default:
|
||||
return msg.SessionID
|
||||
|
||||
Reference in New Issue
Block a user