@spotpatch/runtime 1.5.0 → 1.5.1

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/dist/index.js CHANGED
@@ -1050,8 +1050,7 @@ function unionRects(rects) {
1050
1050
  height: bottom - top
1051
1051
  });
1052
1052
  }
1053
- function getElementRect(element2, view) {
1054
- const display = view.getComputedStyle(element2).display;
1053
+ function measureElementRect(element2, display) {
1055
1054
  if (display.startsWith("inline")) {
1056
1055
  const lineBoxRect = unionRects(Array.from(element2.getClientRects()));
1057
1056
  if (lineBoxRect !== void 0) {
@@ -1060,6 +1059,17 @@ function getElementRect(element2, view) {
1060
1059
  }
1061
1060
  return toElementRect(element2.getBoundingClientRect());
1062
1061
  }
1062
+ function getElementRect(element2, view) {
1063
+ return measureElementRect(element2, view.getComputedStyle(element2).display);
1064
+ }
1065
+ function getVisibleElementRect(element2, view) {
1066
+ const style = view.getComputedStyle(element2);
1067
+ if (style.display === "none" || style.visibility === "hidden") {
1068
+ return void 0;
1069
+ }
1070
+ const rect = measureElementRect(element2, style.display);
1071
+ return rect.width > 0 && rect.height > 0 ? rect : void 0;
1072
+ }
1063
1073
 
1064
1074
  // src/ui/ui-constants.ts
1065
1075
  var UI_MARKER_ATTRIBUTE = "data-spotpatch-ui";
@@ -1077,12 +1087,7 @@ function isInsideSpotPatchUI(element2) {
1077
1087
  return root instanceof ShadowRoot && root.host.hasAttribute(UI_MARKER_ATTRIBUTE);
1078
1088
  }
1079
1089
  function hasVisibleArea(element2, view) {
1080
- const style = view.getComputedStyle(element2);
1081
- if (style.display === "none" || style.visibility === "hidden") {
1082
- return false;
1083
- }
1084
- const rect = element2.getBoundingClientRect();
1085
- return rect.width > 0 && rect.height > 0;
1090
+ return getVisibleElementRect(element2, view) !== void 0;
1086
1091
  }
1087
1092
  function isDocumentRoot(element2) {
1088
1093
  return element2.tagName === "HTML" || element2.tagName === "BODY";
@@ -1695,7 +1700,7 @@ function createButton(document, label, className = "") {
1695
1700
  // src/ui/agent-panel.ts
1696
1701
  var AGENT_PANEL_STYLES = `
1697
1702
  .spotpatch-agent {
1698
- margin-top: 14px;
1703
+ margin-top: 10px;
1699
1704
  overflow: hidden;
1700
1705
  border: 1px solid var(--spotpatch-border-subtle);
1701
1706
  border-radius: var(--spotpatch-radius-card);
@@ -1705,36 +1710,36 @@ var AGENT_PANEL_STYLES = `
1705
1710
  display: flex;
1706
1711
  align-items: center;
1707
1712
  justify-content: space-between;
1708
- gap: 12px;
1709
- padding: 14px 16px;
1713
+ gap: 10px;
1714
+ padding: 10px 12px;
1710
1715
  border-bottom: 1px solid rgb(255 255 255 / 7%);
1711
1716
  }
1712
- .spotpatch-agent-title { color: #eef0f5; font-size: 16px; font-weight: 680; }
1717
+ .spotpatch-agent-title { color: #eef0f5; font-size: 13px; font-weight: 650; }
1713
1718
  .spotpatch-agent-badge {
1714
1719
  border: 1px solid rgb(129 112 247 / 24%);
1715
1720
  border-radius: 999px;
1716
1721
  padding: 3px 7px;
1717
1722
  color: #c5cafa;
1718
1723
  background: rgb(109 93 246 / 9%);
1719
- font-size: 11px;
1724
+ font-size: 10px;
1720
1725
  font-weight: 650;
1721
1726
  }
1722
- .spotpatch-agent-setup { padding: 18px; }
1723
- .spotpatch-agent-selectors { display: grid; grid-template-columns: 1fr; gap: 15px; }
1724
- .spotpatch-agent-selectors label { min-width: 0; color: var(--spotpatch-text-secondary); font-size: 14px; font-weight: 580; }
1727
+ .spotpatch-agent-setup { padding: 12px; }
1728
+ .spotpatch-agent-selectors { display: grid; grid-template-columns: 1fr; gap: 10px; }
1729
+ .spotpatch-agent-selectors label { min-width: 0; color: var(--spotpatch-text-secondary); font-size: 11.5px; font-weight: 580; }
1725
1730
  .spotpatch-agent select {
1726
1731
  box-sizing: border-box;
1727
1732
  width: 100%;
1728
1733
  min-width: 0;
1729
- min-height: 46px;
1730
- margin-top: 7px;
1734
+ min-height: 34px;
1735
+ margin-top: 4px;
1731
1736
  border: 1px solid var(--spotpatch-border);
1732
- border-radius: 12px;
1733
- padding: 10px 38px 10px 13px;
1737
+ border-radius: 8px;
1738
+ padding: 7px 32px 7px 9px;
1734
1739
  color: #e8ebf2;
1735
1740
  color-scheme: dark;
1736
1741
  background: linear-gradient(180deg, rgb(255 255 255 / 4%), rgb(255 255 255 / 2%));
1737
- font-size: 15px;
1742
+ font-size: 12px;
1738
1743
  font-weight: 560;
1739
1744
  line-height: 1.35;
1740
1745
  outline: none;
@@ -1746,7 +1751,7 @@ var AGENT_PANEL_STYLES = `
1746
1751
  @supports (appearance: base-select) {
1747
1752
  .spotpatch-agent select,
1748
1753
  ::picker(select) { appearance: base-select; }
1749
- .spotpatch-agent select { padding: 10px 13px; }
1754
+ .spotpatch-agent select { padding: 7px 9px; }
1750
1755
  .spotpatch-agent select::picker-icon {
1751
1756
  color: #9da6b5;
1752
1757
  transition: rotate 180ms cubic-bezier(.2, .8, .2, 1);
@@ -1793,24 +1798,24 @@ var AGENT_PANEL_STYLES = `
1793
1798
  .spotpatch-consent {
1794
1799
  display: flex;
1795
1800
  align-items: flex-start;
1796
- gap: 10px;
1797
- margin-top: 16px;
1801
+ gap: 8px;
1802
+ margin-top: 10px;
1798
1803
  color: var(--spotpatch-text-secondary);
1799
1804
  cursor: pointer;
1800
- font-size: 14px;
1801
- line-height: 1.6;
1805
+ font-size: 11.5px;
1806
+ line-height: 1.5;
1802
1807
  }
1803
- .spotpatch-consent input { width: 16px; height: 16px; flex: none; margin: 3px 0 0; accent-color: var(--spotpatch-accent); }
1808
+ .spotpatch-consent input { width: 14px; height: 14px; flex: none; margin: 2px 0 0; accent-color: var(--spotpatch-accent); }
1804
1809
  .spotpatch-workspace-consent {
1805
- margin-top: 12px;
1810
+ margin-top: 9px;
1806
1811
  border: 1px solid rgb(251 191 36 / 18%);
1807
1812
  border-radius: 10px;
1808
- padding: 11px 12px;
1813
+ padding: 9px 10px;
1809
1814
  background: rgb(120 53 15 / 9%);
1810
1815
  }
1811
- .spotpatch-workspace-consent strong { display: block; color: #fde68a; font-size: 13px; font-weight: 620; }
1812
- .spotpatch-workspace-consent small { display: block; margin-top: 2px; color: #aeb6c4; font-size: 12px; line-height: 1.5; }
1813
- .spotpatch-agent-health-list { display: grid; gap: 8px; margin-top: 14px; }
1816
+ .spotpatch-workspace-consent strong { display: block; color: #fde68a; font-size: 11.5px; font-weight: 620; }
1817
+ .spotpatch-workspace-consent small { display: block; margin-top: 2px; color: #aeb6c4; font-size: 10.5px; line-height: 1.45; }
1818
+ .spotpatch-agent-health-list { display: grid; gap: 6px; margin-top: 10px; }
1814
1819
  .spotpatch-agent-workspace,
1815
1820
  .spotpatch-agent-capability {
1816
1821
  display: flex;
@@ -1818,7 +1823,7 @@ var AGENT_PANEL_STYLES = `
1818
1823
  gap: 8px;
1819
1824
  margin: 0;
1820
1825
  color: #929bab;
1821
- font-size: 13px;
1826
+ font-size: 11px;
1822
1827
  }
1823
1828
  .spotpatch-agent-capability::before {
1824
1829
  width: 6px;
@@ -1848,7 +1853,7 @@ var AGENT_PANEL_STYLES = `
1848
1853
  .spotpatch-agent-workspace[data-state="consent-required"]::before { background: #fbbf24; }
1849
1854
  .spotpatch-agent-workspace[data-state="blocked"] { color: #fecaca; }
1850
1855
  .spotpatch-agent-workspace[data-state="blocked"]::before { background: var(--spotpatch-danger); }
1851
- .spotpatch-agent-job { padding: 16px; }
1856
+ .spotpatch-agent-job { padding: 12px; }
1852
1857
  .spotpatch-agent-job-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
1853
1858
  .spotpatch-agent-model { min-width: 0; overflow: hidden; color: #d6dafe; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
1854
1859
  .spotpatch-agent-status {
@@ -2394,6 +2399,25 @@ function calculateDialogPlacement({
2394
2399
  }) {
2395
2400
  const maxLeft = viewportWidth - dialogWidth - VIEWPORT_MARGIN;
2396
2401
  const maxTop = viewportHeight - dialogHeight - VIEWPORT_MARGIN;
2402
+ const viewportLeft = clamp(
2403
+ (viewportWidth - dialogWidth) / 2,
2404
+ VIEWPORT_MARGIN,
2405
+ maxLeft
2406
+ );
2407
+ const viewportTop = clamp(
2408
+ (viewportHeight - dialogHeight) / 2,
2409
+ VIEWPORT_MARGIN,
2410
+ maxTop
2411
+ );
2412
+ if (target2 === void 0) {
2413
+ return Object.freeze({
2414
+ anchorX: clamp(dialogWidth / 2, ANCHOR_INSET, dialogWidth - ANCHOR_INSET),
2415
+ anchorY: clamp(dialogHeight / 2, ANCHOR_INSET, dialogHeight - ANCHOR_INSET),
2416
+ left: viewportLeft,
2417
+ mode: "viewport",
2418
+ top: viewportTop
2419
+ });
2420
+ }
2397
2421
  const targetCenterX = target2.x + target2.width / 2;
2398
2422
  const targetCenterY = target2.y + target2.height / 2;
2399
2423
  const centeredLeft = clamp(targetCenterX - dialogWidth / 2, VIEWPORT_MARGIN, maxLeft);
@@ -2926,33 +2950,36 @@ function createUiLocalizer(document, preference = "auto") {
2926
2950
  }
2927
2951
 
2928
2952
  // src/ui/runtime-view.ts
2929
- var DIALOG_FALLBACK_WIDTH = 560;
2953
+ var DIALOG_MAX_WIDTH = 460;
2954
+ var DIALOG_MAX_HEIGHT = 620;
2930
2955
  var DIALOG_FALLBACK_HEIGHT = Object.freeze({
2931
- previewing: 640,
2932
- selected: 720
2956
+ previewing: 560,
2957
+ selected: DIALOG_MAX_HEIGHT
2933
2958
  });
2934
2959
  function createStyles(document) {
2935
2960
  const style = document.createElement("style");
2936
2961
  style.textContent = `
2937
2962
  :host {
2938
2963
  all: initial;
2939
- --spotpatch-bg: #11141a;
2940
- --spotpatch-bg-raised: #191d25;
2941
- --spotpatch-bg-input: #0c0f14;
2942
- --spotpatch-border: #303641;
2943
- --spotpatch-border-subtle: #262c35;
2944
- --spotpatch-text: #f4f6fb;
2945
- --spotpatch-text-secondary: #a4adbd;
2946
- --spotpatch-text-muted: #7f899a;
2947
- --spotpatch-accent: #7060ee;
2948
- --spotpatch-accent-strong: #604ee8;
2949
- --spotpatch-accent-cyan: #27b8cf;
2964
+ --spotpatch-bg: #0e0e12;
2965
+ --spotpatch-bg-raised: #17171c;
2966
+ --spotpatch-bg-active: #1c1c22;
2967
+ --spotpatch-bg-input: #0b0b0f;
2968
+ --spotpatch-border: #2a2a32;
2969
+ --spotpatch-border-subtle: #232329;
2970
+ --spotpatch-text: #f2f2f5;
2971
+ --spotpatch-text-secondary: #96969f;
2972
+ --spotpatch-text-muted: #686872;
2973
+ --spotpatch-accent: #8b7bff;
2974
+ --spotpatch-accent-strong: #6a5ce8;
2975
+ --spotpatch-accent-cyan: #52a8ff;
2950
2976
  --spotpatch-danger: #fb7185;
2951
2977
  --spotpatch-success: #34d399;
2952
2978
  --spotpatch-warning: #f59e0b;
2953
- --spotpatch-radius-panel: 24px;
2954
- --spotpatch-radius-card: 15px;
2955
- --spotpatch-shadow-panel: 0 28px 72px rgb(0 0 0 / 38%);
2979
+ --spotpatch-text-on-accent: #0b0b12;
2980
+ --spotpatch-radius-panel: 16px;
2981
+ --spotpatch-radius-card: 10px;
2982
+ --spotpatch-shadow-panel: 0 30px 60px -20px rgb(0 0 0 / 70%);
2956
2983
  color-scheme: dark;
2957
2984
  color: var(--spotpatch-text);
2958
2985
  font-family: Inter, "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
@@ -3072,7 +3099,7 @@ function createStyles(document) {
3072
3099
  left: 16px;
3073
3100
  z-index: ${String(UI_Z_INDEX.controls)};
3074
3101
  box-sizing: border-box;
3075
- width: min(560px, calc(100vw - 32px));
3102
+ width: min(${String(DIALOG_MAX_WIDTH)}px, calc(100vw - 32px));
3076
3103
  color: #edf0f7;
3077
3104
  outline: none;
3078
3105
  filter: drop-shadow(var(--spotpatch-shadow-panel));
@@ -3116,78 +3143,92 @@ function createStyles(document) {
3116
3143
  position: relative;
3117
3144
  z-index: 1;
3118
3145
  display: flex;
3119
- max-height: min(720px, calc(100vh - 32px));
3146
+ box-sizing: border-box;
3147
+ max-height: min(${String(DIALOG_MAX_HEIGHT)}px, calc(100vh - 32px));
3120
3148
  overflow: hidden;
3121
3149
  flex-direction: column;
3122
3150
  border: 1px solid var(--spotpatch-border);
3123
3151
  border-radius: var(--spotpatch-radius-panel);
3124
3152
  background: var(--spotpatch-bg);
3125
- box-shadow: inset 0 1px rgb(255 255 255 / 7%), inset 0 0 0 1px rgb(2 6 23 / 40%);
3153
+ box-shadow: inset 0 1px rgb(255 255 255 / 5%), 0 0 60px -32px rgb(139 123 255 / 20%);
3154
+ }
3155
+ .spotpatch-shell::before {
3156
+ position: absolute;
3157
+ z-index: 2;
3158
+ top: 0;
3159
+ right: 20%;
3160
+ left: 20%;
3161
+ height: 1px;
3162
+ background: linear-gradient(90deg, transparent, var(--spotpatch-accent), var(--spotpatch-accent-cyan), transparent);
3163
+ content: "";
3164
+ opacity: .65;
3165
+ pointer-events: none;
3126
3166
  }
3127
3167
  .spotpatch-header {
3128
3168
  position: relative;
3129
- padding: 20px 22px 18px;
3130
- border-bottom: 1px solid rgb(255 255 255 / 8%);
3169
+ padding: 0 18px 14px;
3131
3170
  }
3132
3171
  .spotpatch-brand-row {
3133
3172
  display: flex;
3134
3173
  align-items: center;
3135
3174
  justify-content: space-between;
3136
- gap: 16px;
3137
- margin-bottom: 18px;
3175
+ gap: 12px;
3176
+ margin: 0 -18px 18px;
3177
+ padding: 14px 18px 13px;
3178
+ border-bottom: 1px solid var(--spotpatch-border-subtle);
3138
3179
  }
3139
3180
  .spotpatch-brand {
3140
3181
  display: inline-flex;
3141
3182
  align-items: center;
3142
- gap: 11px;
3183
+ gap: 10px;
3143
3184
  min-width: 0;
3144
3185
  color: #f8fafc;
3145
3186
  }
3146
3187
  .spotpatch-brand-mark {
3147
- width: 34px;
3148
- height: 34px;
3188
+ width: 30px;
3189
+ height: 30px;
3149
3190
  flex: none;
3150
3191
  filter: drop-shadow(0 6px 12px rgb(76 29 149 / 22%));
3151
3192
  }
3152
3193
  .spotpatch-brand-copy { display: grid; min-width: 0; gap: 1px; }
3153
3194
  .spotpatch-brand-name {
3154
3195
  color: #fff;
3155
- font-size: 15px;
3156
- font-weight: 720;
3196
+ font-size: 13.5px;
3197
+ font-weight: 680;
3157
3198
  letter-spacing: -.01em;
3158
3199
  }
3159
3200
  .spotpatch-brand-context {
3160
3201
  color: #8e98aa;
3161
- font-size: 11px;
3202
+ font-size: 10.5px;
3162
3203
  font-weight: 560;
3163
3204
  letter-spacing: .02em;
3164
3205
  }
3165
3206
  .spotpatch-header-controls {
3166
3207
  display: inline-flex;
3167
3208
  align-items: center;
3168
- gap: 8px;
3209
+ gap: 6px;
3169
3210
  flex: none;
3170
3211
  }
3171
3212
  .spotpatch-repository,
3172
3213
  .spotpatch-locale,
3173
3214
  .spotpatch-close {
3174
- height: 30px;
3215
+ height: 27px;
3175
3216
  border: 1px solid rgb(255 255 255 / 11%);
3176
- border-radius: 9px;
3177
- background: rgb(255 255 255 / 4%);
3217
+ border-radius: 7px;
3218
+ background: transparent;
3178
3219
  }
3179
3220
  .spotpatch-repository {
3180
3221
  display: inline-flex;
3181
3222
  align-items: center;
3182
- padding: 0 10px;
3183
- color: #bcecf2;
3223
+ padding: 0 9px;
3224
+ color: var(--spotpatch-text-secondary);
3184
3225
  font-size: 11px;
3185
3226
  font-weight: 680;
3186
3227
  text-decoration: none;
3187
3228
  }
3188
3229
  .spotpatch-locale {
3189
- min-width: 38px;
3190
- padding: 0 9px;
3230
+ min-width: 34px;
3231
+ padding: 0 8px;
3191
3232
  color: #c5cad5;
3192
3233
  cursor: pointer;
3193
3234
  font-size: 12px;
@@ -3195,12 +3236,12 @@ function createStyles(document) {
3195
3236
  }
3196
3237
  .spotpatch-close {
3197
3238
  display: inline-grid;
3198
- width: 30px;
3239
+ width: 27px;
3199
3240
  padding: 0;
3200
3241
  place-items: center;
3201
3242
  color: #9da5b4;
3202
3243
  cursor: pointer;
3203
- font-size: 17px;
3244
+ font-size: 15px;
3204
3245
  line-height: 1;
3205
3246
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
3206
3247
  }
@@ -3210,30 +3251,30 @@ function createStyles(document) {
3210
3251
  .spotpatch-title {
3211
3252
  margin: 0;
3212
3253
  color: #fff;
3213
- font-size: 24px;
3214
- font-weight: 730;
3215
- letter-spacing: -.025em;
3254
+ font-size: 18px;
3255
+ font-weight: 680;
3256
+ letter-spacing: -.015em;
3216
3257
  }
3217
3258
  .spotpatch-subtitle {
3218
- max-width: 470px;
3219
- margin: 6px 0 0;
3220
- color: #9ca5b5;
3221
- font-size: 15px;
3222
- line-height: 1.55;
3259
+ max-width: 390px;
3260
+ margin: 4px 0 0;
3261
+ color: var(--spotpatch-text-secondary);
3262
+ font-size: 12.5px;
3263
+ line-height: 1.5;
3223
3264
  }
3224
3265
  .spotpatch-target-row {
3225
3266
  display: flex;
3226
3267
  align-items: center;
3227
3268
  gap: 8px;
3228
3269
  min-width: 0;
3229
- margin-top: 16px;
3270
+ margin-top: 14px;
3230
3271
  }
3231
3272
  .spotpatch-target-label {
3232
3273
  min-width: 0;
3233
3274
  overflow: hidden;
3234
3275
  border: 1px solid rgb(129 112 247 / 24%);
3235
3276
  border-radius: 999px;
3236
- padding: 6px 10px;
3277
+ padding: 4px 10px;
3237
3278
  color: #cdd2ff;
3238
3279
  background: rgb(109 93 246 / 10%);
3239
3280
  font: 600 11px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
@@ -3246,7 +3287,7 @@ function createStyles(document) {
3246
3287
  gap: 6px;
3247
3288
  flex: none;
3248
3289
  color: #a5adba;
3249
- font-size: 12px;
3290
+ font-size: 11px;
3250
3291
  white-space: nowrap;
3251
3292
  }
3252
3293
  .spotpatch-context-state::before {
@@ -3267,7 +3308,7 @@ function createStyles(document) {
3267
3308
  .spotpatch-body {
3268
3309
  min-height: 0;
3269
3310
  overflow: auto;
3270
- padding: 20px 22px 22px;
3311
+ padding: 0 18px 14px;
3271
3312
  scrollbar-color: rgb(100 116 139 / 50%) transparent;
3272
3313
  scrollbar-width: thin;
3273
3314
  }
@@ -3278,36 +3319,54 @@ function createStyles(document) {
3278
3319
  display: flex;
3279
3320
  align-items: center;
3280
3321
  justify-content: space-between;
3281
- gap: 12px;
3282
- margin-bottom: 7px;
3283
- color: #eef0f5;
3284
- font-size: 14px;
3285
- font-weight: 680;
3322
+ gap: 10px;
3323
+ margin-bottom: 8px;
3324
+ color: var(--spotpatch-text-secondary);
3325
+ font-size: 11px;
3326
+ font-weight: 650;
3327
+ letter-spacing: .04em;
3328
+ text-transform: uppercase;
3286
3329
  }
3287
3330
  .spotpatch-targets-meta {
3288
3331
  display: flex;
3289
3332
  align-items: center;
3290
- justify-content: space-between;
3291
- gap: 12px;
3292
- margin-bottom: 12px;
3333
+ gap: 8px;
3334
+ min-width: 0;
3335
+ letter-spacing: 0;
3336
+ text-transform: none;
3293
3337
  }
3294
- .spotpatch-target-complete { color: var(--spotpatch-text-secondary); font-size: 12px; font-weight: 560; }
3338
+ .spotpatch-target-complete { color: var(--spotpatch-text-muted); font-size: 11px; font-weight: 560; }
3295
3339
  .spotpatch-target-budget {
3296
3340
  color: var(--spotpatch-text-muted);
3297
- font: 550 11px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
3341
+ font: 550 10.5px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
3298
3342
  }
3343
+ .spotpatch-target-budget[data-state="ready"] { display: none; }
3299
3344
  .spotpatch-target-budget[data-state="over"] { color: #fda4af; }
3300
3345
  .spotpatch-target-count {
3346
+ margin-left: auto;
3301
3347
  border-radius: 999px;
3302
3348
  padding: 3px 8px;
3303
- color: #b8bffd;
3304
- background: rgb(109 93 246 / 11%);
3305
- font: 650 11px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
3349
+ color: var(--spotpatch-text-muted);
3350
+ font: 600 10.5px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
3351
+ }
3352
+ .spotpatch-target-progress {
3353
+ height: 3px;
3354
+ margin-bottom: 13px;
3355
+ overflow: hidden;
3356
+ border-radius: 999px;
3357
+ background: var(--spotpatch-border-subtle);
3358
+ }
3359
+ .spotpatch-target-progress-fill {
3360
+ width: 0;
3361
+ height: 100%;
3362
+ border-radius: inherit;
3363
+ background: linear-gradient(90deg, var(--spotpatch-accent), var(--spotpatch-accent-cyan));
3364
+ transition: width 180ms ease;
3306
3365
  }
3307
3366
  .spotpatch-target-list {
3308
3367
  display: grid;
3309
- gap: 12px;
3310
- max-height: min(390px, 48vh);
3368
+ gap: 8px;
3369
+ max-height: min(340px, 48vh);
3311
3370
  overflow: auto;
3312
3371
  padding-right: 2px;
3313
3372
  }
@@ -3315,30 +3374,30 @@ function createStyles(document) {
3315
3374
  overflow: hidden;
3316
3375
  border: 1px solid var(--spotpatch-border-subtle);
3317
3376
  border-radius: var(--spotpatch-radius-card);
3318
- background: rgb(255 255 255 / 2.7%);
3377
+ background: var(--spotpatch-bg-raised);
3319
3378
  transition: border-color 150ms ease, background 150ms ease;
3320
3379
  }
3321
3380
  .spotpatch-target-item[data-active="true"] {
3322
- border-color: rgb(125 106 248 / 42%);
3323
- background: rgb(109 93 246 / 6%);
3324
- box-shadow: inset 3px 0 var(--spotpatch-accent-strong);
3381
+ border-color: rgb(139 123 255 / 34%);
3382
+ background: var(--spotpatch-bg-active);
3383
+ box-shadow: 0 0 0 3px rgb(139 123 255 / 10%);
3325
3384
  }
3326
3385
  .spotpatch-target-summary {
3327
3386
  display: grid;
3328
- grid-template-columns: minmax(0, 1fr) 34px 34px;
3387
+ grid-template-columns: minmax(0, 1fr) 28px 28px;
3329
3388
  align-items: stretch;
3330
- gap: 4px;
3331
- padding: 5px;
3389
+ gap: 2px;
3390
+ padding: 4px;
3332
3391
  }
3333
3392
  .spotpatch-target-select {
3334
3393
  display: grid;
3335
- grid-template-columns: 34px minmax(0, 1fr) auto;
3394
+ grid-template-columns: 24px minmax(0, 1fr) auto;
3336
3395
  align-items: center;
3337
- gap: 11px;
3396
+ gap: 9px;
3338
3397
  min-width: 0;
3339
3398
  border: 0;
3340
- border-radius: 11px;
3341
- padding: 10px 11px;
3399
+ border-radius: 8px;
3400
+ padding: 8px;
3342
3401
  color: inherit;
3343
3402
  background: transparent;
3344
3403
  cursor: pointer;
@@ -3347,14 +3406,14 @@ function createStyles(document) {
3347
3406
  .spotpatch-target-select:hover { background: rgb(255 255 255 / 3.5%); }
3348
3407
  .spotpatch-target-index {
3349
3408
  display: inline-grid;
3350
- width: 30px;
3351
- height: 30px;
3409
+ width: 22px;
3410
+ height: 22px;
3352
3411
  place-items: center;
3353
3412
  border: 1px solid rgb(68 202 224 / 25%);
3354
- border-radius: 9px;
3355
- color: #9ce7f0;
3356
- background: rgb(8 145 178 / 10%);
3357
- font: 700 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
3413
+ border-radius: 6px;
3414
+ color: var(--spotpatch-text-secondary);
3415
+ background: var(--spotpatch-bg);
3416
+ font: 650 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
3358
3417
  }
3359
3418
  .spotpatch-target-copy { min-width: 0; }
3360
3419
  .spotpatch-target-name,
@@ -3364,14 +3423,14 @@ function createStyles(document) {
3364
3423
  text-overflow: ellipsis;
3365
3424
  white-space: nowrap;
3366
3425
  }
3367
- .spotpatch-target-name { color: #f2f4f8; font-size: 16px; font-weight: 680; }
3368
- .spotpatch-target-source { margin-top: 5px; color: var(--spotpatch-text-muted); font: 500 13px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
3426
+ .spotpatch-target-name { color: #f2f2f5; font-size: 13px; font-weight: 650; }
3427
+ .spotpatch-target-source { margin-top: 1px; color: var(--spotpatch-text-muted); font: 500 10.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
3369
3428
  .spotpatch-target-state {
3370
3429
  border-radius: 999px;
3371
- padding: 4px 8px;
3430
+ padding: 3px 8px;
3372
3431
  color: #a7f3d0;
3373
3432
  background: rgb(16 185 129 / 9%);
3374
- font-size: 11px;
3433
+ font-size: 10.5px;
3375
3434
  font-weight: 650;
3376
3435
  white-space: nowrap;
3377
3436
  }
@@ -3379,13 +3438,13 @@ function createStyles(document) {
3379
3438
  .spotpatch-target-open,
3380
3439
  .spotpatch-target-remove {
3381
3440
  display: inline-grid;
3382
- width: 34px;
3441
+ width: 28px;
3383
3442
  height: 100%;
3384
- min-height: 40px;
3443
+ min-height: 34px;
3385
3444
  padding: 0;
3386
3445
  place-items: center;
3387
3446
  border: 1px solid transparent;
3388
- border-radius: 10px;
3447
+ border-radius: 7px;
3389
3448
  color: #7f899a;
3390
3449
  background: transparent;
3391
3450
  cursor: pointer;
@@ -3394,31 +3453,30 @@ function createStyles(document) {
3394
3453
  .spotpatch-target-open:hover:not(:disabled) { border-color: rgb(68 202 224 / 30%); color: #c8f7ff; background: rgb(8 145 178 / 11%); }
3395
3454
  .spotpatch-target-remove:hover:not(:disabled) { border-color: rgb(251 113 133 / 24%); color: #fda4af; background: rgb(127 29 29 / 12%); }
3396
3455
  .spotpatch-target-editor {
3397
- border-top: 1px solid rgb(255 255 255 / 7%);
3398
- padding: 18px;
3456
+ padding: 0 12px 12px;
3399
3457
  }
3400
3458
  .spotpatch-target-editor-head {
3401
3459
  display: flex;
3402
3460
  align-items: baseline;
3403
3461
  justify-content: space-between;
3404
3462
  gap: 12px;
3405
- margin-bottom: 9px;
3463
+ margin-bottom: 6px;
3406
3464
  }
3407
- .spotpatch-target-editor-label { color: #dfe3ea; font-size: 15px; font-weight: 650; }
3408
- .spotpatch-target-editor-count { color: var(--spotpatch-text-muted); font: 500 11px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; }
3465
+ .spotpatch-target-editor-label { color: var(--spotpatch-text-secondary); font-size: 11px; font-weight: 650; }
3466
+ .spotpatch-target-editor-count { color: var(--spotpatch-text-muted); font: 500 10.5px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; }
3409
3467
  .spotpatch-target-editor textarea {
3410
3468
  box-sizing: border-box;
3411
3469
  width: 100%;
3412
- min-height: 126px;
3470
+ min-height: 74px;
3413
3471
  resize: vertical;
3414
3472
  border: 1px solid var(--spotpatch-border);
3415
- border-radius: 12px;
3416
- padding: 14px 15px;
3473
+ border-radius: 7px;
3474
+ padding: 9px 10px;
3417
3475
  color: #f8fafc;
3418
3476
  caret-color: #8b7cf7;
3419
3477
  background: var(--spotpatch-bg-input);
3420
- font-size: 15px;
3421
- line-height: 1.65;
3478
+ font-size: 12.5px;
3479
+ line-height: 1.55;
3422
3480
  outline: none;
3423
3481
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
3424
3482
  }
@@ -3427,23 +3485,23 @@ function createStyles(document) {
3427
3485
  .spotpatch-target-editor textarea:focus {
3428
3486
  border-color: rgb(139 124 247 / 68%);
3429
3487
  background: rgb(3 7 18 / 65%);
3430
- box-shadow: 0 0 0 3px rgb(109 93 246 / 10%);
3488
+ box-shadow: 0 0 0 2px rgb(109 93 246 / 10%);
3431
3489
  }
3432
3490
  .spotpatch-diagnostics {
3433
- margin-top: 14px;
3491
+ margin-top: 10px;
3434
3492
  overflow: hidden;
3435
3493
  border: 1px solid rgb(255 255 255 / 8%);
3436
- border-radius: 13px;
3494
+ border-radius: 9px;
3437
3495
  background: rgb(255 255 255 / 2.5%);
3438
3496
  }
3439
3497
  .spotpatch-diagnostics > summary {
3440
3498
  display: flex;
3441
3499
  align-items: center;
3442
3500
  gap: 8px;
3443
- padding: 11px 13px;
3501
+ padding: 9px 11px;
3444
3502
  color: #bfc5d0;
3445
3503
  cursor: pointer;
3446
- font-size: 12px;
3504
+ font-size: 11px;
3447
3505
  font-weight: 650;
3448
3506
  list-style: none;
3449
3507
  user-select: none;
@@ -3472,9 +3530,9 @@ function createStyles(document) {
3472
3530
  margin: 0;
3473
3531
  overflow: auto;
3474
3532
  border-top: 1px solid rgb(255 255 255 / 7%);
3475
- padding: 12px 13px 13px;
3533
+ padding: 10px 11px 11px;
3476
3534
  color: #9ca5b5;
3477
- font: 11.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
3535
+ font: 10.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
3478
3536
  overflow-wrap: anywhere;
3479
3537
  white-space: pre-wrap;
3480
3538
  user-select: text;
@@ -3484,39 +3542,44 @@ function createStyles(document) {
3484
3542
  margin: 0;
3485
3543
  overflow: auto;
3486
3544
  border: 1px solid rgb(255 255 255 / 9%);
3487
- border-radius: 14px;
3488
- padding: 13px;
3545
+ border-radius: 9px;
3546
+ padding: 11px;
3489
3547
  color: #d8ddeb;
3490
3548
  background: rgb(3 7 18 / 55%);
3491
- font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace;
3549
+ font: 11px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
3492
3550
  overflow-wrap: anywhere;
3493
3551
  white-space: pre-wrap;
3494
3552
  user-select: text;
3495
3553
  }
3496
3554
  .spotpatch-actions {
3497
- display: flex;
3498
- flex-wrap: wrap;
3499
- gap: 9px;
3500
- padding: 14px 22px 18px;
3555
+ display: grid;
3556
+ gap: 8px;
3557
+ padding: 10px 18px 14px;
3501
3558
  border-top: 1px solid rgb(255 255 255 / 8%);
3502
- background: rgb(8 12 22 / 82%);
3559
+ background: rgb(8 8 12 / 86%);
3503
3560
  }
3504
3561
  .spotpatch-editor-feedback {
3505
- flex-basis: 100%;
3506
3562
  white-space: normal;
3507
3563
  }
3564
+ .spotpatch-secondary-actions,
3565
+ .spotpatch-primary-actions {
3566
+ display: flex;
3567
+ align-items: center;
3568
+ gap: 7px;
3569
+ }
3570
+ .spotpatch-secondary-actions { min-height: 30px; }
3508
3571
  .spotpatch-actions button {
3509
3572
  display: inline-flex;
3510
- min-height: 40px;
3573
+ min-height: 34px;
3511
3574
  align-items: center;
3512
3575
  justify-content: center;
3513
3576
  border: 1px solid rgb(255 255 255 / 10%);
3514
- border-radius: 11px;
3515
- padding: 9px 13px;
3516
- color: #d8ddeb;
3577
+ border-radius: 9px;
3578
+ padding: 7px 11px;
3579
+ color: var(--spotpatch-text-secondary);
3517
3580
  background: rgb(255 255 255 / 4%);
3518
3581
  cursor: pointer;
3519
- font-size: 13px;
3582
+ font-size: 12px;
3520
3583
  font-weight: 650;
3521
3584
  transition: border-color 150ms ease, box-shadow 150ms ease, color 150ms ease, transform 150ms ease;
3522
3585
  }
@@ -3526,14 +3589,36 @@ function createStyles(document) {
3526
3589
  transform: translateY(-1px);
3527
3590
  }
3528
3591
  .spotpatch-actions .spotpatch-primary {
3529
- min-width: 154px;
3592
+ min-width: 138px;
3530
3593
  flex: 1;
3531
- border-color: rgb(139 124 247 / 58%);
3532
- color: #fff;
3533
- background: var(--spotpatch-accent-strong);
3534
- box-shadow: 0 9px 24px rgb(55 48 163 / 20%), inset 0 1px rgb(255 255 255 / 14%);
3594
+ border-color: transparent;
3595
+ color: var(--spotpatch-text-on-accent);
3596
+ background: linear-gradient(135deg, var(--spotpatch-accent), var(--spotpatch-accent-strong));
3597
+ box-shadow: 0 8px 20px -8px rgb(139 123 255 / 55%);
3535
3598
  }
3599
+ .spotpatch-actions .spotpatch-primary:hover:not(:disabled) { color: var(--spotpatch-text-on-accent); filter: brightness(1.08); }
3536
3600
  .spotpatch-actions .spotpatch-primary::after { margin-left: 8px; content: "\u2197"; font-size: 12px; }
3601
+ .spotpatch-actions .spotpatch-secondary-action {
3602
+ min-height: 30px;
3603
+ border-style: dashed;
3604
+ padding: 5px 10px;
3605
+ color: var(--spotpatch-text-muted);
3606
+ background: transparent;
3607
+ font-size: 11px;
3608
+ }
3609
+ .spotpatch-actions .spotpatch-icon-action {
3610
+ width: 34px;
3611
+ min-width: 34px;
3612
+ padding: 0;
3613
+ font-size: 0;
3614
+ }
3615
+ .spotpatch-actions .spotpatch-icon-action::before {
3616
+ color: var(--spotpatch-text-secondary);
3617
+ content: attr(data-compact-icon);
3618
+ font-size: 18px;
3619
+ font-weight: 400;
3620
+ line-height: 1;
3621
+ }
3537
3622
  .spotpatch-actions button:disabled { cursor: not-allowed; opacity: .4; transform: none; }
3538
3623
  .spotpatch-actions button:focus-visible,
3539
3624
  .spotpatch-repository:focus-visible,
@@ -3565,11 +3650,13 @@ function createStyles(document) {
3565
3650
  }
3566
3651
  @media (max-width: 520px) {
3567
3652
  .spotpatch-dialog { top: 8px; left: 8px; width: calc(100vw - 16px); }
3568
- .spotpatch-shell { max-height: calc(100vh - 16px); border-radius: 18px; }
3569
- .spotpatch-header, .spotpatch-body { padding-left: 16px; padding-right: 16px; }
3570
- .spotpatch-actions { padding-left: 16px; padding-right: 16px; }
3571
- .spotpatch-target-select { grid-template-columns: 32px minmax(0, 1fr); }
3653
+ .spotpatch-shell { max-height: calc(100vh - 16px); border-radius: 14px; }
3654
+ .spotpatch-header, .spotpatch-body { padding-left: 14px; padding-right: 14px; }
3655
+ .spotpatch-brand-row { margin-right: -14px; margin-left: -14px; padding-right: 14px; padding-left: 14px; }
3656
+ .spotpatch-actions { padding-right: 14px; padding-left: 14px; }
3657
+ .spotpatch-target-select { grid-template-columns: 24px minmax(0, 1fr); }
3572
3658
  .spotpatch-target-state { display: none; }
3659
+ .spotpatch-repository { display: none; }
3573
3660
  }
3574
3661
  ${AGENT_PANEL_STYLES}
3575
3662
  `;
@@ -3672,10 +3759,17 @@ function createRuntimeView(document, shortcut, ai = Object.freeze({ enabled: fal
3672
3759
  const targetCount = createMarkedElement(document, "span");
3673
3760
  targetCount.className = "spotpatch-target-count";
3674
3761
  targetsMeta.append(targetComplete, targetBudget);
3675
- targetsHeading.append(targetsTitle, targetCount);
3762
+ targetRow.append(targetCount);
3763
+ targetsHeading.append(targetsTitle, targetsMeta);
3764
+ const targetProgress = createMarkedElement(document, "div");
3765
+ targetProgress.className = "spotpatch-target-progress";
3766
+ targetProgress.setAttribute("aria-hidden", "true");
3767
+ const targetProgressFill = createMarkedElement(document, "div");
3768
+ targetProgressFill.className = "spotpatch-target-progress-fill";
3769
+ targetProgress.append(targetProgressFill);
3676
3770
  const targetList = createMarkedElement(document, "div");
3677
3771
  targetList.className = "spotpatch-target-list";
3678
- targetsPanel.append(targetsHeading, targetsMeta, targetList);
3772
+ targetsPanel.append(targetsHeading, targetProgress, targetList);
3679
3773
  const diagnostics = createMarkedElement(document, "details");
3680
3774
  diagnostics.className = "spotpatch-diagnostics";
3681
3775
  const diagnosticsLabel = createMarkedElement(document, "summary");
@@ -3716,21 +3810,30 @@ function createRuntimeView(document, shortcut, ai = Object.freeze({ enabled: fal
3716
3810
  );
3717
3811
  const copyButton = createButton(document, messages.actions.copy, "spotpatch-primary");
3718
3812
  const backButton = createButton(document, messages.actions.back);
3719
- actions.append(
3720
- editorFeedback,
3813
+ const secondaryActions = createMarkedElement(document, "div");
3814
+ secondaryActions.className = "spotpatch-secondary-actions";
3815
+ const primaryActions = createMarkedElement(document, "div");
3816
+ primaryActions.className = "spotpatch-primary-actions";
3817
+ addTargetButton.classList.add("spotpatch-icon-action");
3818
+ addTargetButton.dataset.compactIcon = "+";
3819
+ agentPanel.testButton.classList.add("spotpatch-icon-action");
3820
+ agentPanel.testButton.dataset.compactIcon = "\u2713";
3821
+ openEditorButton.classList.add("spotpatch-secondary-action");
3822
+ reselectButton.classList.add("spotpatch-secondary-action");
3823
+ secondaryActions.append(openEditorButton, reselectButton);
3824
+ primaryActions.append(
3825
+ agentPanel.testButton,
3826
+ addTargetButton,
3721
3827
  agentPanel.runButton,
3722
3828
  previewButton,
3723
- agentPanel.testButton,
3724
3829
  agentPanel.cancelButton,
3725
3830
  agentPanel.applyButton,
3726
3831
  agentPanel.revertButton,
3727
3832
  agentPanel.resetButton,
3728
- addTargetButton,
3729
- openEditorButton,
3730
- reselectButton,
3731
3833
  copyButton,
3732
3834
  backButton
3733
3835
  );
3836
+ actions.append(editorFeedback, secondaryActions, primaryActions);
3734
3837
  shell.append(header, body, actions);
3735
3838
  dialog.append(anchor, shell);
3736
3839
  const liveRegion = createMarkedElement(document, "div");
@@ -3769,6 +3872,10 @@ function createRuntimeView(document, shortcut, ai = Object.freeze({ enabled: fal
3769
3872
  }
3770
3873
  return target2.status === "warning" ? messages.targets.statusPartial : messages.targets.statusCollecting;
3771
3874
  }
3875
+ function renderTargetProgress(complete, total) {
3876
+ const ratio = total === 0 ? 0 : complete / total;
3877
+ targetProgressFill.style.width = `${String(ratio * 100)}%`;
3878
+ }
3772
3879
  function instructionInput(targetId) {
3773
3880
  const inputs = targetList.querySelectorAll(
3774
3881
  "textarea[data-target-instruction-id]"
@@ -3794,6 +3901,7 @@ function createRuntimeView(document, shortcut, ai = Object.freeze({ enabled: fal
3794
3901
  (total, target2) => total + target2.instruction.trim().length,
3795
3902
  0
3796
3903
  );
3904
+ renderTargetProgress(completeCount, targets.length);
3797
3905
  targetCount.textContent = messages.targets.count(targets.length, maximum);
3798
3906
  targetComplete.textContent = messages.targets.complete(
3799
3907
  completeCount,
@@ -3915,10 +4023,14 @@ function createRuntimeView(document, shortcut, ai = Object.freeze({ enabled: fal
3915
4023
  MAX_TARGET_INSTRUCTION_CHARACTERS2
3916
4024
  );
3917
4025
  }
4026
+ const completeCount = currentTargets.filter(
4027
+ (target2) => target2.instruction.trim().length > 0
4028
+ ).length;
3918
4029
  targetComplete.textContent = messages.targets.complete(
3919
- currentTargets.filter((target2) => target2.instruction.trim().length > 0).length,
4030
+ completeCount,
3920
4031
  currentTargets.length
3921
4032
  );
4033
+ renderTargetProgress(completeCount, currentTargets.length);
3922
4034
  const instructionCharacters = currentTargets.reduce(
3923
4035
  (total, target2) => total + target2.instruction.trim().length,
3924
4036
  0
@@ -3953,7 +4065,7 @@ function createRuntimeView(document, shortcut, ai = Object.freeze({ enabled: fal
3953
4065
  placeDialog();
3954
4066
  }
3955
4067
  function placeDialog() {
3956
- if (dialog.hidden || currentRect === void 0) {
4068
+ if (dialog.hidden) {
3957
4069
  return;
3958
4070
  }
3959
4071
  const view = document.defaultView;
@@ -3961,14 +4073,14 @@ function createRuntimeView(document, shortcut, ai = Object.freeze({ enabled: fal
3961
4073
  const viewportHeight = view?.innerHeight ?? document.documentElement.clientHeight;
3962
4074
  const measured = dialog.getBoundingClientRect();
3963
4075
  const status = currentStatus === "previewing" ? "previewing" : "selected";
3964
- const dialogWidth = measured.width > 0 ? measured.width : Math.min(DIALOG_FALLBACK_WIDTH, viewportWidth - 32);
4076
+ const dialogWidth = measured.width > 0 ? measured.width : Math.min(DIALOG_MAX_WIDTH, viewportWidth - 32);
3965
4077
  const dialogHeight = measured.height > 0 ? measured.height : Math.min(DIALOG_FALLBACK_HEIGHT[status], viewportHeight - 32);
3966
4078
  const placement = calculateDialogPlacement({
3967
- target: currentRect,
3968
4079
  dialogWidth,
3969
4080
  dialogHeight,
3970
4081
  viewportWidth,
3971
- viewportHeight
4082
+ viewportHeight,
4083
+ ...currentRect === void 0 ? {} : { target: currentRect }
3972
4084
  });
3973
4085
  dialog.style.left = `${String(placement.left)}px`;
3974
4086
  dialog.style.top = `${String(placement.top)}px`;
@@ -4018,6 +4130,7 @@ function createRuntimeView(document, shortcut, ai = Object.freeze({ enabled: fal
4018
4130
  addTargetButton.hidden = !selected;
4019
4131
  openEditorButton.hidden = !selected;
4020
4132
  previewButton.hidden = !selected;
4133
+ secondaryActions.hidden = !selected;
4021
4134
  agentPanel.setSelectionVisible(selected);
4022
4135
  copyButton.hidden = !previewing;
4023
4136
  backButton.hidden = !previewing;
@@ -4056,6 +4169,7 @@ function createRuntimeView(document, shortcut, ai = Object.freeze({ enabled: fal
4056
4169
  } else {
4057
4170
  targetCount.textContent = messages.targets.count(0, currentMaximum);
4058
4171
  targetComplete.textContent = messages.targets.complete(0, 0);
4172
+ renderTargetProgress(0, 0);
4059
4173
  targetBudget.dataset.state = "ready";
4060
4174
  targetBudget.textContent = messages.targets.instructionBudget(
4061
4175
  0,
@@ -4124,6 +4238,7 @@ function createRuntimeView(document, shortcut, ai = Object.freeze({ enabled: fal
4124
4238
  selectionHighlights.replaceChildren();
4125
4239
  activeSelectionRect = void 0;
4126
4240
  currentRect = void 0;
4241
+ placeDialog();
4127
4242
  },
4128
4243
  showSelection(summaryText, canOpenEditor, canPreview) {
4129
4244
  updateSelection(summaryText, canOpenEditor, canPreview);
@@ -4149,6 +4264,7 @@ function createRuntimeView(document, shortcut, ai = Object.freeze({ enabled: fal
4149
4264
  renderEditorStatus("idle");
4150
4265
  targetCount.textContent = messages.targets.count(0, 0);
4151
4266
  targetComplete.textContent = messages.targets.complete(0, 0);
4267
+ renderTargetProgress(0, 0);
4152
4268
  targetLabel.textContent = messages.context.selectedElement;
4153
4269
  summary.textContent = "";
4154
4270
  promptOutput.textContent = "";
@@ -4859,11 +4975,15 @@ ${summary}`;
4859
4975
  if (!target2.element?.isConnected) {
4860
4976
  return [];
4861
4977
  }
4978
+ const rect = getVisibleElementRect(target2.element, browser.window);
4979
+ if (rect === void 0) {
4980
+ return [];
4981
+ }
4862
4982
  return [
4863
4983
  {
4864
4984
  id: target2.id,
4865
4985
  label: elementLabel(target2.element),
4866
- rect: getElementRect(target2.element, browser.window),
4986
+ rect,
4867
4987
  active: target2.id === activeTargetId
4868
4988
  }
4869
4989
  ];