refactor: optimize core engine and retrieval logic for v2.80.43
This commit is contained in:
+19
-4
@@ -119,11 +119,13 @@ export async function activate(context: vscode.ExtensionContext) {
|
||||
);
|
||||
|
||||
// 3. Initialize Approval subsystem (queue + panel webview + status bar badge)
|
||||
// Astra 2.81: sidebar view container is gone; all webviews open in editor
|
||||
// column 3 instead. We don't register a WebviewViewProvider — panels are
|
||||
// created on-demand via openAsPanel().
|
||||
const approvalQueue = new ApprovalQueue();
|
||||
const approvalPanel = new ApprovalPanelProvider(context.extensionUri, approvalQueue);
|
||||
const approvalStatusBar = new ApprovalStatusBar(approvalQueue);
|
||||
context.subscriptions.push(
|
||||
vscode.window.registerWebviewViewProvider(ApprovalPanelProvider.viewType, approvalPanel),
|
||||
approvalStatusBar,
|
||||
{ dispose: () => approvalQueue.dispose() },
|
||||
vscode.commands.registerCommand(ApprovalStatusBar.focusCommand, () => approvalPanel.focus()),
|
||||
@@ -140,14 +142,16 @@ export async function activate(context: vscode.ExtensionContext) {
|
||||
approvalQueue,
|
||||
});
|
||||
|
||||
// 4. Initialize Sidebar Provider
|
||||
// 4. Initialize Chat Provider (renders into an editor column, not a sidebar view)
|
||||
provider = new SidebarChatProvider(context.extensionUri, context, agent, {
|
||||
lifecycle,
|
||||
activity: activityTracker,
|
||||
loadedModels: () => lmStudioClient.listLoadedCached(),
|
||||
});
|
||||
context.subscriptions.push(
|
||||
vscode.window.registerWebviewViewProvider(SidebarChatProvider.viewType, provider)
|
||||
vscode.commands.registerCommand('g1nation.openChat', () => {
|
||||
provider!.openAsPanel(vscode.ViewColumn.Three);
|
||||
})
|
||||
);
|
||||
|
||||
// 4. Initialize Bridge Server (Port 4825)
|
||||
@@ -559,7 +563,6 @@ export async function activate(context: vscode.ExtensionContext) {
|
||||
telegramBot,
|
||||
});
|
||||
context.subscriptions.push(
|
||||
vscode.window.registerWebviewViewProvider(SettingsPanelProvider.viewType, settingsPanel),
|
||||
// Refresh the settings UI whenever any g1nation.* config changes (toggle, allowedChatIds, …).
|
||||
vscode.workspace.onDidChangeConfiguration((e) => {
|
||||
if (e.affectsConfiguration('g1nation')) void settingsPanel.refresh();
|
||||
@@ -628,6 +631,18 @@ export async function activate(context: vscode.ExtensionContext) {
|
||||
if (!setupComplete) {
|
||||
await runInitialSetup(context);
|
||||
}
|
||||
|
||||
// 7. Auto-open all three Astra webviews as tabs in editor column 3.
|
||||
// The sidebar/activity-bar entry point was removed in 2.81 — all three views
|
||||
// (Chat, Approvals, Settings) now stack as tabs in the third editor column.
|
||||
// Order matters: Chat opens last so it ends up as the active tab.
|
||||
try {
|
||||
approvalPanel.openAsPanel(vscode.ViewColumn.Three);
|
||||
await settingsPanel.openAsPanel(vscode.ViewColumn.Three);
|
||||
provider!.openAsPanel(vscode.ViewColumn.Three);
|
||||
} catch (e) {
|
||||
logError('Failed to auto-open Astra panels.', e);
|
||||
}
|
||||
}
|
||||
|
||||
export async function deactivate() {
|
||||
|
||||
Reference in New Issue
Block a user