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