vg-coder-cli 2.0.35 → 2.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,7 +23,13 @@ export function initToolWindow() {
23
23
  });
24
24
  });
25
25
 
26
- console.log('[ToolWindow] Initialized');
26
+ // Open Project panel by default after a short delay
27
+ // This ensures all panel listeners are registered first
28
+ setTimeout(() => {
29
+ togglePanel('project');
30
+ }, 100);
31
+
32
+ console.log('[ToolWindow] Initialized with Project panel active');
27
33
  }
28
34
 
29
35
  /**
@@ -170,7 +170,8 @@ export async function testExecute(event) {
170
170
  export async function executeFromClipboard(event) {
171
171
  const btn = event?.target?.closest('.btn');
172
172
  const bashInput = getById('execute-bash');
173
- if (!bashInput) return;
173
+
174
+ // Don't return early if bashInput is missing - it's optional when called from bubble menu
174
175
 
175
176
  if (btn) showLoading(btn, btn.innerHTML);
176
177
  try {
@@ -180,13 +181,25 @@ export async function executeFromClipboard(event) {
180
181
  if (btn) resetButton(btn);
181
182
  return;
182
183
  }
183
- bashInput.value = clipboardText;
184
+
185
+ // Only populate bashInput if it exists (when called from dashboard)
186
+ if (bashInput) {
187
+ bashInput.value = clipboardText;
188
+ }
189
+
184
190
  const data = await executeScript(clipboardText);
185
- showResponse('execute-response', data, !data.success);
191
+
192
+ // Only show response in execute-response container if it exists
193
+ const responseContainer = getById('execute-response');
194
+ if (responseContainer) {
195
+ showResponse('execute-response', data, !data.success);
196
+ }
186
197
 
187
198
  if (data.success) {
188
199
  showToast('Thực thi OK', 'success');
189
- bashInput.value = '';
200
+ if (bashInput) {
201
+ bashInput.value = '';
202
+ }
190
203
  } else {
191
204
  data.syntaxError ? showToast('Lỗi syntax script', 'error') : showToast('Thực thi thất bại', 'error');
192
205
  }
@@ -194,7 +207,10 @@ export async function executeFromClipboard(event) {
194
207
  if (err.name === 'NotAllowedError') {
195
208
  showToast('Không có quyền clipboard', 'error');
196
209
  } else {
197
- showResponse('execute-response', { error: err.message }, true);
210
+ const responseContainer = getById('execute-response');
211
+ if (responseContainer) {
212
+ showResponse('execute-response', { error: err.message }, true);
213
+ }
198
214
  showToast('Lỗi: ' + err.message, 'error');
199
215
  }
200
216
  }
@@ -10,6 +10,7 @@ import { initResizeHandler } from './features/resize.js';
10
10
  import { initSavedCommands } from './features/commands.js';
11
11
  import './features/structure.js';
12
12
  import { initBubble } from './features/bubble.js';
13
+ import { initKeyboardShortcuts } from './features/keyboard-shortcuts.js';
13
14
 
14
15
  // NEW: Import Tool Window modules
15
16
  import { initToolWindow } from './features/tool-window.js';
@@ -46,6 +47,9 @@ export async function initMain() {
46
47
 
47
48
  // Init Bubble (will use event protocol)
48
49
  initBubble();
50
+
51
+ // Initialize keyboard shortcuts (global hotkeys for Shadow DOM)
52
+ initKeyboardShortcuts();
49
53
 
50
54
  console.log('✅ VG Coder: Initialization Complete');
51
55
  } catch (e) {