feat(chat): add quick-open file icon in tool card header

Add a small external-link icon next to the tool display name in the
collapsed tool card header (Write/Edit/MultiEdit/ApplyPatch), so the
target file can be opened in the side panel (web/desktop) or editor
(VS Code) without expanding the card.

On web/desktop (no runtime.editor), the icon falls back to
useUIStore.openContextFile{AtLine} + mobileActions.openFiles(), matching
the existing openEntryFile pattern. The existing handleMainClick only
opens the file when runtime.editor is available, so this icon is the
first way to open a file from the tool header in the browser.

Path resolution reuses getPrimaryToolPath + toAbsoluteFilePath; the diff
tools also resolve the first changed line and primary diff via the
existing getFirstChangedLineFromMetadata / getPrimaryDiffFromMetadata
helpers. The icon stops click propagation so the card-toggle-on-click
behavior is preserved.

Adds the chat.toolPart.openFile i18n key across all 11 locales.
This commit is contained in:
Roberto Berto
2026-08-25 14:32:33 +00:00
parent fe80d246ea
commit 14c40c9615
12 changed files with 84 additions and 1 deletions
+1
View File
@@ -2157,6 +2157,7 @@ export const dict = {
'chat.toolPart.showRawJson': 'Rohe JSON anzeigen',
'chat.toolPart.showFormattedJson': 'Formatierte JSON anzeigen',
'chat.toolPart.showNavigableJson': 'Navigierbare JSON anzeigen',
'chat.toolPart.openFile': 'Datei öffnen',
'chat.toolPart.openFileAtFirstChange': 'Datei bei erster Änderung öffnen',
'chat.toolPart.openFileDiff': 'Datei-Unterschied öffnen',
'chat.toolPart.copyOutput': 'Ausgabe kopieren',
+1
View File
@@ -2334,6 +2334,7 @@ export const dict = {
'chat.toolPart.showRawJson': 'Show raw JSON',
'chat.toolPart.showFormattedJson': 'Show formatted JSON',
'chat.toolPart.showNavigableJson': 'Show navigable JSON',
'chat.toolPart.openFile': 'Open file',
'chat.toolPart.openFileAtFirstChange': 'Open file at first change',
'chat.toolPart.openFileDiff': 'Open file diff',
'chat.toolPart.copyOutput': 'Copy output',
+1
View File
@@ -2300,6 +2300,7 @@ export const dict: Record<I18nKey, string> = {
"chat.toolPart.showRawJson": "Mostrar JSON sin formato",
"chat.toolPart.showFormattedJson": "Mostrar JSON formateado",
"chat.toolPart.showNavigableJson": "Mostrar JSON navegable",
"chat.toolPart.openFile": "Abrir archivo",
"chat.toolPart.openFileAtFirstChange": "Abrir archivo en el primer cambio",
"chat.toolPart.openFileDiff": "Abrir diferencias del archivo",
"chat.toolPart.copyOutput": "Copiar salida",
+1
View File
@@ -3063,6 +3063,7 @@ export const dict = {
'chat.toolPart.showRawJson': 'Afficher le JSON brut',
'chat.toolPart.showFormattedJson': 'Afficher le JSON formaté',
'chat.toolPart.showNavigableJson': 'Afficher le JSON navigable',
'chat.toolPart.openFile': 'Ouvrir le fichier',
'chat.toolPart.openFileAtFirstChange': 'Ouvrir le fichier à la première modification',
'chat.toolPart.openFileDiff': 'Ouvrir les différences du fichier',
'chat.toolPart.copyOutput': 'Copier la sortie',
+1
View File
@@ -2333,6 +2333,7 @@ export const dict: Record<I18nKey, string> = {
'chat.toolPart.showRawJson': '生JSONを表示',
'chat.toolPart.showFormattedJson': '整形JSONを表示',
'chat.toolPart.showNavigableJson': 'ナビゲーション可能なJSONを表示',
'chat.toolPart.openFile': 'ファイルを開く',
'chat.toolPart.openFileAtFirstChange': '最初の変更箇所でファイルを開く',
'chat.toolPart.openFileDiff': 'ファイル差分を開く',
'chat.toolPart.copyOutput': '出力をコピー',
+1
View File
@@ -2334,6 +2334,7 @@ export const dict: Record<I18nKey, string> = {
'chat.toolPart.showRawJson': '원시 JSON 표시',
'chat.toolPart.showFormattedJson': '형식화된 JSON 표시',
'chat.toolPart.showNavigableJson': '탐색 가능한 JSON 표시',
'chat.toolPart.openFile': '파일 열기',
'chat.toolPart.openFileAtFirstChange': '첫 번째 변경 위치에서 파일 열기',
'chat.toolPart.openFileDiff': '파일 diff 열기',
'chat.toolPart.copyOutput': '출력 복사',
+1
View File
@@ -1416,6 +1416,7 @@ export const dict: Record<I18nKey, string> = {
'chat.toolPart.showRawJson': 'Pokaż surowy JSON',
'chat.toolPart.showFormattedJson': 'Pokaż sformatowany JSON',
'chat.toolPart.showNavigableJson': 'Pokaż nawigowalny JSON',
'chat.toolPart.openFile': 'Otwórz plik',
'chat.toolPart.openFileAtFirstChange': 'Otwórz plik przy pierwszej zmianie',
'chat.toolPart.openFileDiff': 'Otwórz różnice pliku',
'chat.toolPart.copyOutput': 'Kopiuj wyjście',
@@ -2300,6 +2300,7 @@ export const dict: Record<I18nKey, string> = {
"chat.toolPart.showRawJson": "Mostrar JSON bruto",
"chat.toolPart.showFormattedJson": "Mostrar JSON formatado",
"chat.toolPart.showNavigableJson": "Mostrar JSON navegável",
"chat.toolPart.openFile": "Abrir arquivo",
"chat.toolPart.openFileAtFirstChange": "Abrir arquivo na primeira alteração",
"chat.toolPart.openFileDiff": "Abrir diferenças do arquivo",
"chat.toolPart.copyOutput": "Copiar saída",
+1
View File
@@ -2300,6 +2300,7 @@ export const dict: Record<I18nKey, string> = {
"chat.toolPart.showRawJson": "Показати сирий JSON",
"chat.toolPart.showFormattedJson": "Показати форматований JSON",
"chat.toolPart.showNavigableJson": "Показати навігаційний JSON",
"chat.toolPart.openFile": "Відкрити файл",
"chat.toolPart.openFileAtFirstChange": "Відкрити файл на першій зміні",
"chat.toolPart.openFileDiff": "Відкрити diff файлу",
"chat.toolPart.copyOutput": "Скопіювати вивід",
@@ -2300,6 +2300,7 @@ export const dict: Record<I18nKey, string> = {
'chat.toolPart.showRawJson': '显示原始 JSON',
'chat.toolPart.showFormattedJson': '显示格式化 JSON',
'chat.toolPart.showNavigableJson': '显示可导航 JSON',
'chat.toolPart.openFile': '打开文件',
'chat.toolPart.openFileAtFirstChange': '在首次更改处打开文件',
'chat.toolPart.openFileDiff': '打开文件差异',
'chat.toolPart.copyOutput': '复制输出',
@@ -2304,6 +2304,7 @@ export const dict: Record<I18nKey, string> = {
'chat.toolPart.showRawJson': '顯示原始 JSON',
'chat.toolPart.showFormattedJson': '顯示格式化 JSON',
'chat.toolPart.showNavigableJson': '顯示可導覽 JSON',
'chat.toolPart.openFile': '開啟檔案',
'chat.toolPart.openFileAtFirstChange': '在首次變更處開啟檔案',
'chat.toolPart.openFileDiff': '開啟檔案差異',
'chat.toolPart.copyOutput': '複製輸出',