clideck 1.22.4 → 1.22.6

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clideck",
3
- "version": "1.22.4",
3
+ "version": "1.22.6",
4
4
  "description": "One screen for all your AI coding agents — run, monitor, and manage multiple CLI agents from a single browser tab",
5
5
  "main": "server.js",
6
6
  "bin": {
package/public/js/app.js CHANGED
@@ -296,7 +296,10 @@ function showModeToast() {
296
296
  });
297
297
  }
298
298
 
299
- document.getElementById('btn-new').addEventListener('click', openCreator);
299
+ document.getElementById('btn-new').addEventListener('click', () => {
300
+ send({ type: 'checkAvailability' });
301
+ openCreator();
302
+ });
300
303
  document.getElementById('btn-new-project').addEventListener('click', () => {
301
304
  closeCreator();
302
305
  openProjectCreator();
@@ -21,6 +21,21 @@ function randomName() {
21
21
  return `${a} ${b}`;
22
22
  }
23
23
 
24
+ function renderPresetButtons() {
25
+ return sortedPresets().map(p => {
26
+ const hasConfigured = state.cfg.commands.some(c => binName(c.command) === binName(p.command) && c.enabled !== false);
27
+ const missing = p.available === false && !hasConfigured;
28
+ return `
29
+ <button class="preset-btn w-full flex items-center gap-2.5 px-3 py-2 rounded-md hover:bg-slate-700/70 text-sm transition-colors text-left ${missing ? 'text-slate-500' : 'text-slate-300'}" data-preset="${p.presetId}">
30
+ <span class="${missing ? 'opacity-40' : ''}">${agentIcon(p.icon, 24)}</span>
31
+ <span class="flex-1 min-w-0">
32
+ <span>${esc(p.name)}</span>
33
+ ${missing ? `<span class="block text-[10px] text-slate-600 truncate">${esc(p.installCmd || 'Not installed')}</span>` : ''}
34
+ </span>
35
+ </button>`;
36
+ }).join('');
37
+ }
38
+
24
39
  function sortedPresets() {
25
40
  const all = [...state.presets].filter(p => {
26
41
  const cmd = state.cfg.commands.find(c =>
@@ -77,8 +92,6 @@ export function openCreator() {
77
92
  // Close project creator if open
78
93
  document.getElementById('project-creator')?.remove();
79
94
  if (!state.presets.length) return;
80
- // Recheck binary availability on the server
81
- send({ type: 'checkAvailability' });
82
95
 
83
96
  const fallbackName = randomName();
84
97
  const presets = sortedPresets();
@@ -103,19 +116,8 @@ export function openCreator() {
103
116
  ${FOLDER_SVG}
104
117
  </button>
105
118
  </div>
106
- <div class="space-y-0.5">
107
- ${presets.map(p => {
108
- const hasConfigured = state.cfg.commands.some(c => binName(c.command) === binName(p.command) && c.enabled !== false);
109
- const missing = p.available === false && !hasConfigured;
110
- return `
111
- <button class="preset-btn w-full flex items-center gap-2.5 px-3 py-2 rounded-md hover:bg-slate-700/70 text-sm transition-colors text-left ${missing ? 'text-slate-500' : 'text-slate-300'}" data-preset="${p.presetId}">
112
- <span class="${missing ? 'opacity-40' : ''}">${agentIcon(p.icon, 24)}</span>
113
- <span class="flex-1 min-w-0">
114
- <span>${esc(p.name)}</span>
115
- ${missing ? `<span class="block text-[10px] text-slate-600 truncate">${esc(p.installCmd || 'Not installed')}</span>` : ''}
116
- </span>
117
- </button>`;
118
- }).join('')}
119
+ <div id="creator-presets" class="space-y-0.5">
120
+ ${renderPresetButtons()}
119
121
  </div>`;
120
122
 
121
123
  const list = document.getElementById('session-list');
@@ -215,10 +217,8 @@ export function openCreator() {
215
217
  }
216
218
 
217
219
  export function refreshCreator() {
218
- if (document.getElementById('session-creator')) {
219
- closeCreator();
220
- openCreator();
221
- }
220
+ const container = document.getElementById('creator-presets');
221
+ if (container) container.innerHTML = renderPresetButtons();
222
222
  }
223
223
 
224
224
  export function closeCreator() {