kiro-mobile-bridge 1.0.6 → 1.0.7

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": "kiro-mobile-bridge",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "A simple mobile web interface for monitoring Kiro IDE agent sessions from your phone over LAN",
5
5
  "type": "module",
6
6
  "main": "src/server.js",
@@ -59,10 +59,10 @@
59
59
  .editor-search-close { color: #888; font-size: 16px; cursor: pointer; padding: 4px; border-radius: 4px; }
60
60
  .editor-search-close:hover { color: #fff; background: rgba(255,255,255,0.1); }
61
61
  .editor-content { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; background: #1e1e1e; }
62
- .editor-code { margin: 0; padding: 8px 0; font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'SF Mono', Consolas, 'Liberation Mono', Menlo, Monaco, 'Courier New', monospace; font-size: 14px; line-height: 1.6; color: #d4d4d4; background: #1e1e1e; }
63
- .editor-line { display: flex; min-height: 1.6em; }
62
+ .editor-code { margin: 0; padding: 8px 0; font-family: Consolas, 'Courier New', monospace; font-size: 12px; line-height: 1.5; color: #d4d4d4; background: #1e1e1e; }
63
+ .editor-line { display: flex; min-height: 18px; }
64
64
  .editor-line:hover { background: rgba(255,255,255,0.04); }
65
- .editor-line-num { width: 50px; min-width: 50px; text-align: right; padding-right: 16px; color: #858585; user-select: none; flex-shrink: 0; font-size: 14px; font-family: inherit; }
65
+ .editor-line-num { width: 50px; min-width: 50px; text-align: right; padding-right: 16px; color: #858585; user-select: none; flex-shrink: 0; font-size: 12px; font-family: inherit; }
66
66
  .editor-line-code { flex: 1; padding-right: 12px; white-space: pre; overflow-x: auto; tab-size: 2; font-family: inherit; }
67
67
  .search-highlight { background: #ffd500; color: #000; border-radius: 2px; padding: 0 1px; }
68
68
  .search-highlight.current { background: #ff6b00; color: #fff; outline: 2px solid #ff6b00; }
@@ -1056,6 +1056,22 @@
1056
1056
  background: rgba(255, 255, 255, 0.1) !important;
1057
1057
  }
1058
1058
 
1059
+ /* Hide notification bars and change acceptance UI */
1060
+ [class*="notification"], [class*="Notification"],
1061
+ [class*="toast"], [class*="Toast"],
1062
+ [class*="banner"], [class*="Banner"],
1063
+ [class*="change-accepted"], [class*="changeAccepted"],
1064
+ [class*="revert"], [class*="Revert"],
1065
+ [class*="view-all"], [class*="viewAll"],
1066
+ [class*="status-bar-notification"],
1067
+ div[role="status"], div[role="alert"] {
1068
+ display: none !important;
1069
+ visibility: hidden !important;
1070
+ opacity: 0 !important;
1071
+ height: 0 !important;
1072
+ overflow: hidden !important;
1073
+ }
1074
+
1059
1075
  /* Model selector chevron/arrow icon */
1060
1076
  [class*="model-selector"] svg, [class*="modelSelector"] svg,
1061
1077
  [class*="model-dropdown"] svg, button[class*="dropdown"] svg {
@@ -1617,7 +1633,21 @@
1617
1633
  closeBtn.onclick = async (e) => {
1618
1634
  e.preventDefault();
1619
1635
  e.stopPropagation();
1620
- await sendClickToKiro({ tag: 'button', text: 'close', ariaLabel: 'close', role: 'button', isCloseButton: true });
1636
+
1637
+ // FIXED: Include tab label to identify which tab's close button to click
1638
+ const labelEl = tab.querySelector('.kiro-tabs-item-label, [class*="label"]');
1639
+ const tabLabel = labelEl ? labelEl.textContent.trim() : tab.textContent.trim();
1640
+
1641
+ console.log('[Tab Close] Closing tab:', tabLabel);
1642
+
1643
+ await sendClickToKiro({
1644
+ tag: 'button',
1645
+ text: 'close',
1646
+ ariaLabel: 'close',
1647
+ role: 'button',
1648
+ isCloseButton: true,
1649
+ parentTabLabel: tabLabel // NEW: Identify which tab this close button belongs to
1650
+ });
1621
1651
  return false;
1622
1652
  };
1623
1653
  }
package/src/server.js CHANGED
@@ -2230,6 +2230,11 @@ app.post('/click/:id', async (req, res) => {
2230
2230
  const clickInfo = req.body;
2231
2231
  console.log(`[Click] Attempting click:`, clickInfo.text?.substring(0, 30) || clickInfo.ariaLabel || clickInfo.tag);
2232
2232
 
2233
+ // Log tab close operations for debugging
2234
+ if (clickInfo.isCloseButton && clickInfo.parentTabLabel) {
2235
+ console.log(`[Click] Closing tab: "${clickInfo.parentTabLabel}"`);
2236
+ }
2237
+
2233
2238
  try {
2234
2239
  const result = await clickElement(cascade.cdp, clickInfo);
2235
2240
  res.json(result);
@@ -2340,16 +2345,38 @@ async function clickElement(cdp, clickInfo) {
2340
2345
  // Handle close button clicks explicitly
2341
2346
  if (isCloseButton) {
2342
2347
  const closeButtons = targetDoc.querySelectorAll('[aria-label="close"], .kiro-tabs-item-close, [class*="close"]');
2343
- for (const btn of closeButtons) {
2344
- // Find the close button in the currently selected tab or matching context
2345
- const parentTab = btn.closest('[role="tab"]');
2346
- if (parentTab && parentTab.getAttribute('aria-selected') === 'true') {
2347
- element = btn;
2348
- matchMethod = 'close-button-selected-tab';
2349
- break;
2348
+
2349
+ // FIXED: If parentTabLabel is provided, find the close button in that specific tab
2350
+ if (info.parentTabLabel) {
2351
+ const searchLabel = info.parentTabLabel.trim().toLowerCase();
2352
+
2353
+ for (const btn of closeButtons) {
2354
+ const parentTab = btn.closest('[role="tab"]');
2355
+ if (parentTab) {
2356
+ const labelEl = parentTab.querySelector('.kiro-tabs-item-label, [class*="label"]');
2357
+ const tabLabel = labelEl ? labelEl.textContent.trim().toLowerCase() : parentTab.textContent.trim().toLowerCase();
2358
+
2359
+ // Match the tab by its label
2360
+ if (tabLabel.includes(searchLabel) || searchLabel.includes(tabLabel)) {
2361
+ element = btn;
2362
+ matchMethod = 'close-button-by-tab-label';
2363
+ break;
2364
+ }
2365
+ }
2366
+ }
2367
+ } else {
2368
+ // Fallback: Original logic - find close button in selected tab
2369
+ for (const btn of closeButtons) {
2370
+ const parentTab = btn.closest('[role="tab"]');
2371
+ if (parentTab && parentTab.getAttribute('aria-selected') === 'true') {
2372
+ element = btn;
2373
+ matchMethod = 'close-button-selected-tab';
2374
+ break;
2375
+ }
2350
2376
  }
2351
2377
  }
2352
- // If no selected tab close button, find any close button
2378
+
2379
+ // If still not found, use first close button as last resort
2353
2380
  if (!element && closeButtons.length > 0) {
2354
2381
  element = closeButtons[0];
2355
2382
  matchMethod = 'close-button-first';