querysub 0.597.0 → 0.598.0
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
|
@@ -8,7 +8,8 @@ import { InputLabel } from "../../library-components/InputLabel";
|
|
|
8
8
|
import { DropdownSelector } from "../../library-components/DropdownSelector";
|
|
9
9
|
import { closeAllModals } from "../../5-diagnostics/Modal";
|
|
10
10
|
import { callOpenRouterModel, OpenRouterEffort } from "../../diagnostics/logs/errorNotifications2/openRouterHelper";
|
|
11
|
-
import { formatNumber } from "socket-function/src/formatting/format";
|
|
11
|
+
import { formatNumber, formatTime } from "socket-function/src/formatting/format";
|
|
12
|
+
import { timeInSecond } from "socket-function/src/misc";
|
|
12
13
|
import { t } from "../../2-proxy/schema2";
|
|
13
14
|
|
|
14
15
|
module.hotreload = true;
|
|
@@ -96,6 +97,7 @@ export class CommitModal extends qreact.Component<{
|
|
|
96
97
|
diffLoading: t.boolean(true),
|
|
97
98
|
summarizing: t.boolean(false),
|
|
98
99
|
committing: t.boolean(false),
|
|
100
|
+
committingStartTime: t.number,
|
|
99
101
|
error: t.string,
|
|
100
102
|
lastCost: t.number,
|
|
101
103
|
});
|
|
@@ -172,6 +174,7 @@ export class CommitModal extends qreact.Component<{
|
|
|
172
174
|
}
|
|
173
175
|
Querysub.localCommit(() => {
|
|
174
176
|
this.state.committing = true;
|
|
177
|
+
this.state.committingStartTime = Date.now();
|
|
175
178
|
this.state.error = "";
|
|
176
179
|
});
|
|
177
180
|
try {
|
|
@@ -187,6 +190,7 @@ export class CommitModal extends qreact.Component<{
|
|
|
187
190
|
|
|
188
191
|
render() {
|
|
189
192
|
let { diff, diffLoading, summarizing, committing } = this.state;
|
|
193
|
+
let commitLabel = this.props.isQuerysub ? "Publish & Commit & Push" : "Commit & Push";
|
|
190
194
|
|
|
191
195
|
let summarizeLabel: string;
|
|
192
196
|
if (diffLoading) {
|
|
@@ -220,7 +224,7 @@ export class CommitModal extends qreact.Component<{
|
|
|
220
224
|
<div className={css.hbox(10).flexWrap("wrap").alignItems("flex-end")}>
|
|
221
225
|
<button
|
|
222
226
|
className={rowButtonStyle.hsl(45, 80, 85)}
|
|
223
|
-
disabled={diffLoading || summarizing}
|
|
227
|
+
disabled={diffLoading || summarizing || committing}
|
|
224
228
|
title={diff ? extractChangedLines(diff) : ""}
|
|
225
229
|
onClick={() => void this.doSummarize()}
|
|
226
230
|
>
|
|
@@ -267,13 +271,17 @@ export class CommitModal extends qreact.Component<{
|
|
|
267
271
|
⚠️ {this.state.error}
|
|
268
272
|
</div>}
|
|
269
273
|
|
|
274
|
+
{committing && <div className={css.pad2(10).bord2(0, 0, 20).hsl(120, 50, 92).boldStyle}>
|
|
275
|
+
⏳ Running {commitLabel} for {formatTime(Math.max(0, Querysub.nowDelayed(timeInSecond) - this.state.committingStartTime))}…
|
|
276
|
+
</div>}
|
|
277
|
+
|
|
270
278
|
<div className={css.hbox(10)}>
|
|
271
279
|
<button
|
|
272
280
|
className={rowButtonStyle.hsl(120, 70, 85)}
|
|
273
281
|
disabled={committing}
|
|
274
282
|
onClick={() => void this.doCommit()}
|
|
275
283
|
>
|
|
276
|
-
{committing ?
|
|
284
|
+
{committing ? `⏳ Running ${commitLabel}…` : `⬆️ ${commitLabel}`}
|
|
277
285
|
</button>
|
|
278
286
|
</div>
|
|
279
287
|
|