agentdev-webui 1.1.2 → 1.1.4

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": "agentdev-webui",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Multi-agent workflow dashboard for auto-ticket processing",
5
5
  "main": "server.js",
6
6
  "bin": {
package/public/js/app.js CHANGED
@@ -32,6 +32,8 @@ let projectsList = [];
32
32
  let lastAgentsList = [];
33
33
  let lastHistoryList = [];
34
34
  let lastTodosList = [];
35
+ // Track optimistic tickets that were just created but may not be in SSE data yet
36
+ const pendingOptimisticTickets = new Map(); // "repo:number" → { ticket, created }
35
37
 
36
38
  let firstProjectMode = false;
37
39
 
@@ -1018,6 +1020,26 @@ async function createTicket() {
1018
1020
  formStatus.innerHTML = 'Ticket <a href="' + data.url + '" target="_blank">#' + data.number + '</a> created and added to project!';
1019
1021
  formStatus.className = 'form-status visible success';
1020
1022
 
1023
+ // Optimistic injection: add ticket to board immediately so it doesn't
1024
+ // disappear when an SSE broadcast arrives before GitHub indexes it
1025
+ const optimisticTicket = {
1026
+ number: data.number,
1027
+ repo: data.repo || repo,
1028
+ title: title,
1029
+ body: body,
1030
+ state: 'OPEN',
1031
+ status: 'Todo',
1032
+ hasClaude: body.toLowerCase().includes('@claude'),
1033
+ project_id: currentProjectId || null,
1034
+ author: '',
1035
+ createdAt: new Date().toISOString(),
1036
+ comments: []
1037
+ };
1038
+ const optKey = (data.repo || repo) + ':' + data.number;
1039
+ pendingOptimisticTickets.set(optKey, { ticket: optimisticTicket, created: Date.now() });
1040
+ lastTodosList.push(optimisticTicket);
1041
+ updateTodoTickets(lastTodosList);
1042
+
1021
1043
  ticketDescription.value = '';
1022
1044
  setTimeout(closeCreateTicketModal, 2000);
1023
1045
  } else {
@@ -1488,6 +1510,19 @@ const STATUS_COLORS = { 'Todo': '#4ade80', 'In Progress': '#fbbf24', 'test': '#6
1488
1510
  const STATUS_ORDER = ['Todo', 'In Progress', 'test', 'Done'];
1489
1511
 
1490
1512
  function updateTodoTickets(list) {
1513
+ // Merge pending optimistic tickets into SSE data
1514
+ for (const [key, entry] of pendingOptimisticTickets) {
1515
+ const [repo, num] = key.split(':');
1516
+ const numInt = parseInt(num);
1517
+ if (list.some(t => t.repo === repo && t.number === numInt)) {
1518
+ pendingOptimisticTickets.delete(key); // Confirmed by server
1519
+ } else if (Date.now() - entry.created > 60000) {
1520
+ pendingOptimisticTickets.delete(key); // Expired after 60s
1521
+ } else {
1522
+ list.push(entry.ticket); // Keep optimistic ticket visible
1523
+ }
1524
+ }
1525
+
1491
1526
  // Store raw data for re-filtering
1492
1527
  lastTodosList = list;
1493
1528
 
@@ -30,6 +30,8 @@
30
30
  height: auto !important;
31
31
  flex-direction: initial !important;
32
32
  flex: initial !important;
33
+ color: #333 !important;
34
+ background: #f5f5f5 !important;
33
35
  }
34
36
 
35
37
  html {
@@ -108,7 +110,7 @@
108
110
 
109
111
  .help-text {
110
112
  font-size: 0.875rem;
111
- color: #666;
113
+ color: #555;
112
114
  margin-top: 0.25rem;
113
115
  }
114
116
 
@@ -255,7 +257,7 @@
255
257
  <div class="profile-section">
256
258
  <h2>Registered Agents</h2>
257
259
  <ul id="agents-list" class="agents-list">
258
- <li style="text-align: center; color: #999;">Loading agents...</li>
260
+ <li style="text-align: center; color: #666;">Loading agents...</li>
259
261
  </ul>
260
262
  </div>
261
263
  </div>
@@ -288,7 +290,7 @@
288
290
  const list = document.getElementById('agents-list');
289
291
 
290
292
  if (agents.length === 0) {
291
- list.innerHTML = '<li style="text-align: center; color: #999;">No agents registered yet</li>';
293
+ list.innerHTML = '<li style="text-align: center; color: #666;">No agents registered yet</li>';
292
294
  return;
293
295
  }
294
296
 
@@ -296,8 +298,8 @@
296
298
  <li class="agent-item">
297
299
  <div>
298
300
  <strong>${agent.name}</strong>
299
- ${agent.hostname ? `<div style="font-size: 0.875rem; color: #666;">${agent.hostname}</div>` : ''}
300
- ${agent.last_heartbeat ? `<div style="font-size: 0.75rem; color: #999;">Last seen: ${new Date(agent.last_heartbeat).toLocaleString()}</div>` : ''}
301
+ ${agent.hostname ? `<div style="font-size: 0.875rem; color: #444;">${agent.hostname}</div>` : ''}
302
+ ${agent.last_heartbeat ? `<div style="font-size: 0.75rem; color: #666;">Last seen: ${new Date(agent.last_heartbeat).toLocaleString()}</div>` : ''}
301
303
  </div>
302
304
  <span class="agent-status ${agent.status}">${agent.status}</span>
303
305
  </li>