feat(chat): structured context attachments with metadata round-trip

Every user-attached context item (diff/file/plan comments, terminal
selections, browser annotations, PR comments and failed checks, linked
issues/PRs, and new chat-quote comments from the selection menu) is now
sent as its own synthetic text part carrying an openchamberContext
metadata payload. The model-facing text keeps the previous wording; the
timeline reads the metadata back and renders each item as a context card
instead of raw prompt text. Legacy messages still render via the old
text sniffing.

The selection menu gains a Comment option with an inline multiline
input, the quoted fragment stays highlighted while commenting, and on
mobile the input overlays the composer pill by rendering inside the
composer form. Add to chat is renamed Add to input; the menu is
restyled and the mobile Copy tile removed. Terminal drafts move their
terminal id out of the language field (persisted-draft migration v3),
and the dead preview-console source is deleted.
This commit is contained in:
Bohdan Triapitsyn
2026-08-23 23:40:32 +03:00
parent 1af8b14bbb
commit 1ae3aeff5f
37 changed files with 1440 additions and 318 deletions
+13 -4
View File
@@ -6,6 +6,14 @@ export const dict: Record<I18nKey, string> = {
'terminalView.actions.attachSelection': 'Anexar saída selecionada',
'terminalView.actions.restart': 'Reiniciar terminal',
'chat.message.terminalContext': '{terminal}, linhas {start}-{end}',
'chat.message.context.codeComment': 'Comentário em {file}, linhas {start}-{end}',
'chat.message.context.codeCommentLine': 'Comentário em {file}, linha {line}',
'chat.message.context.chatQuote': 'Citação de uma mensagem anterior',
'chat.chatInput.chatQuoteContext': 'Citações do chat',
'chat.chatInput.chatQuoteContextRemove': 'Remover citações do chat',
'chat.message.context.browserAnnotation': 'Anotação do navegador ({page})',
'chat.message.context.prComment': 'Comentário de PR do GitHub ({label})',
'chat.message.context.prCheck': 'Verificação de PR do GitHub com falha ({label})',
'chat.chatInput.terminalContext': '{terminal}, linhas {start}-{end}',
'chat.chatInput.terminalContextRemove': 'Remover contexto do terminal',
'chat.chatInput.prCommentContext': 'Comentários do PR',
@@ -2160,9 +2168,12 @@ export const dict: Record<I18nKey, string> = {
"chat.textSelection.toast.addToNotesFailed": "Não foi possível adicionar às notas",
"chat.textSelection.toast.addToNotesSuccess": "Texto selecionado adicionado às notas",
"chat.textSelection.toast.addToNotesSummaryFailed": "Não foi possível resumir a seleção; o texto selecionado foi adicionado às notas",
"chat.textSelection.actions.addToChat": "Adicionar ao chat",
"chat.textSelection.actions.addToInput": "Adicionar à entrada",
"chat.textSelection.actions.comment": "Comentar",
"chat.textSelection.title.commentOnSelection": "Comentar a seleção",
"chat.textSelection.comment.placeholder": "Adicione um comentário opcional...",
"chat.textSelection.comment.attach": "Anexar",
"chat.textSelection.actions.newSession": "Nova sessão",
"chat.textSelection.actions.copy": "Copiar",
"chat.textSelection.actions.addToNotes": "Adicionar às notas",
"chat.textSelection.title.addToCurrentChat": "Adicionar ao chat atual",
"chat.textSelection.title.newSessionWithSelection": "Criar nova sessão com seleção",
@@ -2260,8 +2271,6 @@ export const dict: Record<I18nKey, string> = {
"chat.chatInput.toast.togglePermissionAutoAcceptFailed": "Não foi possível alterar a aceitação automática de permissões",
"chat.chatInput.reviewComments": "Comentários de revisão:",
"chat.chatInput.reviewCommentsRemove": "Remover comentários de revisão",
"chat.chatInput.devServerLogs": "Logs do Dev Server:",
"chat.chatInput.devServerLogsRemove": "Remover logs do Dev Server",
"chat.chatInput.previewAnnotations": "Anotações da visualização:",
"chat.chatInput.previewContext": "Contexto da visualização:",
"chat.chatInput.previewContextRemove": "Remover contexto da visualização",