Feat/add ide opened file to chat context (#1106)

* feat(chat): add active editor file context and related functionality

* feat(chat): improve active editor file context handling and update translations

* feat(i18n): standardize quotation marks in file attachment messages

* update Korean translation for image removal action in file attachment

* feat(chat): refine active editor file handling and optimize broadcast logic

* fix(chat): stabilize VS Code editor context chips

---------

Signed-off-by: David Saz <david.saz.g@gmail.com>
Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
This commit is contained in:
David Saz
2026-05-05 01:24:03 +03:00
committed by GitHub
co-authored by Bohdan Triapitsyn
parent 7fc22bc69b
commit 5475ef2db3
12 changed files with 528 additions and 97 deletions
+8
View File
@@ -8,6 +8,7 @@ import {
type VSCodeThemeKind,
type VSCodeThemePayload,
} from '@openchamber/ui/lib/theme/vscode/adapter';
import type { VSCodeActiveEditorFile } from '@/sync/input-store';
type ConnectionStatus = 'connecting' | 'connected' | 'error' | 'disconnected';
type PanelType = 'chat' | 'agentManager';
@@ -1234,6 +1235,13 @@ onCommand('settingsSynced', () => {
});
});
// Listen for active editor file changes from the extension
onCommand('activeEditorFile', (payload) => {
import('@/sync/input-store').then(({ useInputStore }) => {
useInputStore.getState().setActiveEditorFile((payload as VSCodeActiveEditorFile | null) ?? null);
});
});
import('@/main')
.then(async () => {
await waitForUiMount();