@bitcobblers/wod-wiki-ui 0.62.2262 → 0.62.2263
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/{chunk-SDIPYD4U.mjs → chunk-QGB3HYJU.mjs} +247 -72
- package/dist/chunk-QGB3HYJU.mjs.map +1 -0
- package/dist/extensions/index.cjs +244 -69
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.d.cts +1 -1
- package/dist/extensions/index.d.ts +1 -1
- package/dist/extensions/index.mjs +1 -1
- package/dist/{index-BL555pPw.d.cts → index-Bwtlo6Cj.d.cts} +4 -0
- package/dist/{index-BL555pPw.d.ts → index-Bwtlo6Cj.d.ts} +4 -0
- package/dist/index.cjs +250 -75
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.mjs +8 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/dist/chunk-SDIPYD4U.mjs.map +0 -1
|
@@ -8,7 +8,7 @@ import { computeWhiteboardEnterAction, whiteboardScriptLanguage, createParser, w
|
|
|
8
8
|
import { mapNoteBlockChanges, validateNoteBlocks, reconcileNoteBlocks, parseDocumentSections, actionableSectionKind, patchFrontmatterProperty, formatDurationMMSS, metricToMs, createMetricOwnershipLedger, MetricType } from '@bitcobblers/wod-wiki-core';
|
|
9
9
|
export { blockContentId } from '@bitcobblers/wod-wiki-core';
|
|
10
10
|
import { invertedEffects, history, historyKeymap, cursorPageUp, cursorPageDown, cursorDocStart, cursorDocEnd, defaultKeymap, indentWithTab } from '@codemirror/commands';
|
|
11
|
-
import { WQL_FIND_TARGETS, WQL_SOURCE_VALUES, WQL_RESULT_PLANES, WQL_AGGREGATORS, WQL_VIRTUAL_DIMS, WQL_TAG_KEYS, WQL_METRIC_AGGREGATES, WQL_METRIC_FAMILIES, WQL_CALC_TARGETS, WQL_DISPLAY_UNITS, WQL_INTENSITY_TIERS, parseQueryWidgetSuffix, resolveQueryExecutionScope, wqlLanguage, parseFrontmatterBody, isYamlQueryBlockBody, parseQueryBlock, queryBlockToDocumentText, parseDocument, queryBlockAttributes, substituteTokens, parseQuery, isDashboardWidgetType, isFindQuery, isPipelineQuery, unknownWidgetTypeMessage, unknownTokensMessage, wqlCompletionSource, SharedQueryDocumentRunner, serializeQueryBlock, resolveWidgetType, computeRowsRunSummary, serialize, DASHBOARD_WIDGET_TYPES, PLANNED_WIDGET_TYPES, resolveWqlCursorStage, CONTENT_GROUPING_DIMENSIONS, allowedFilterTypesForTarget, wqlGroupingDimensions, isAggregateQuery, wqlHighlightStyle, supportsWqlFilterKey, dimensionKeyOf, WQL_NOTE_DEFAULT_SOURCES, notebookSlugOfSourceId, wql } from '@bitcobblers/wod-wiki-wql';
|
|
11
|
+
import { WQL_FIND_TARGETS, WQL_SOURCE_VALUES, WQL_RESULT_PLANES, WQL_AGGREGATORS, WQL_VIRTUAL_DIMS, WQL_TAG_KEYS, WQL_METRIC_AGGREGATES, WQL_METRIC_FAMILIES, WQL_CALC_TARGETS, WQL_DISPLAY_UNITS, WQL_INTENSITY_TIERS, parseQueryWidgetSuffix, resolveQueryExecutionScope, wqlLanguage, parseFrontmatterBody, isYamlQueryBlockBody, parseQueryBlock, queryBlockToDocumentText, parseDocument, queryBlockAttributes, substituteTokens, parseQuery, isDashboardWidgetType, isFindQuery, isPipelineQuery, unknownWidgetTypeMessage, unknownTokensMessage, wqlCompletionSource, SharedQueryDocumentRunner, serializeQueryBlock, resolveWidgetType, computeRowsRunSummary, serialize, DASHBOARD_WIDGET_TYPES, PLANNED_WIDGET_TYPES, selectSplitSegmentEvents, resolveWqlCursorStage, CONTENT_GROUPING_DIMENSIONS, allowedFilterTypesForTarget, wqlGroupingDimensions, isAggregateQuery, wqlHighlightStyle, supportsWqlFilterKey, dimensionKeyOf, WQL_NOTE_DEFAULT_SOURCES, notebookSlugOfSourceId, wql } from '@bitcobblers/wod-wiki-wql';
|
|
12
12
|
export { CONTENT_GROUPING_DIMENSIONS } from '@bitcobblers/wod-wiki-wql';
|
|
13
13
|
import { snippet, completionStatus, selectedCompletionIndex, acceptCompletion, closeCompletion, startCompletion, autocompletion, currentCompletions, setSelectedCompletion, CompletionContext, moveCompletionSelection, closeBrackets, closeBracketsKeymap, ifNotIn, completeFromList, snippetCompletion } from '@codemirror/autocomplete';
|
|
14
14
|
import { createRoot } from 'react-dom/client';
|
|
@@ -825,6 +825,15 @@ function formatMMSS(ms) {
|
|
|
825
825
|
const s = totalSec % 60;
|
|
826
826
|
return `${String(m).padStart(2, "0")}:${String(s).padStart(2, "0")}`;
|
|
827
827
|
}
|
|
828
|
+
function formatOffsetMMSS(deltaMs) {
|
|
829
|
+
if (!Number.isFinite(deltaMs)) return "+00:00";
|
|
830
|
+
if (deltaMs < 0) {
|
|
831
|
+
const absSec = Math.floor(-deltaMs / 1e3);
|
|
832
|
+
if (absSec === 0) return "+00:00";
|
|
833
|
+
return `-${formatMMSS(-deltaMs)}`;
|
|
834
|
+
}
|
|
835
|
+
return `+${formatMMSS(deltaMs)}`;
|
|
836
|
+
}
|
|
828
837
|
function formatClockTime(d) {
|
|
829
838
|
return d.toLocaleTimeString("en-US", {
|
|
830
839
|
hour12: false,
|
|
@@ -919,10 +928,146 @@ function formatOutputTypeLabel(outputType) {
|
|
|
919
928
|
if (!raw) return "System";
|
|
920
929
|
return OUTPUT_TYPE_LABEL[raw] ?? raw.charAt(0).toUpperCase() + raw.slice(1);
|
|
921
930
|
}
|
|
922
|
-
|
|
923
|
-
|
|
931
|
+
var ACRONYMS = {
|
|
932
|
+
c2b: "C2B",
|
|
933
|
+
t2b: "T2B",
|
|
934
|
+
ghd: "GHD",
|
|
935
|
+
hspu: "HSPU",
|
|
936
|
+
amrap: "AMRAP",
|
|
937
|
+
emom: "EMOM",
|
|
938
|
+
rft: "RFT"
|
|
939
|
+
};
|
|
940
|
+
function humanizeSlug(slug) {
|
|
941
|
+
return slug.trim().split(/[-_\s]+/).filter(Boolean).map((word) => {
|
|
942
|
+
const lower = word.toLowerCase();
|
|
943
|
+
return ACRONYMS[lower] ?? word.charAt(0).toUpperCase() + word.slice(1);
|
|
944
|
+
}).join(" ");
|
|
945
|
+
}
|
|
946
|
+
var GENERIC_LABELS = /* @__PURE__ */ new Set(["segment", "statement", "completed", "system"]);
|
|
947
|
+
function resolveOutputRowLabel(out) {
|
|
948
|
+
const explicitLabel = out.label?.trim();
|
|
949
|
+
if (explicitLabel && !GENERIC_LABELS.has(explicitLabel.toLowerCase())) {
|
|
950
|
+
return explicitLabel;
|
|
951
|
+
}
|
|
952
|
+
const all = out.metrics ? Array.from(out.metrics) : [];
|
|
953
|
+
for (const m of all) {
|
|
954
|
+
const t = String(m.type ?? "").toLowerCase();
|
|
955
|
+
if (t === "effort" || t === "action" || t === "label" || t === "text") {
|
|
956
|
+
const rawText = typeof m.image === "string" && m.image.trim() || typeof m.value === "string" && m.value.trim() || "";
|
|
957
|
+
if (!rawText) continue;
|
|
958
|
+
const lower = rawText.toLowerCase();
|
|
959
|
+
if (lower === "ready to start") return "Start";
|
|
960
|
+
if (lower === "session" || lower === "session completed") return "Session";
|
|
961
|
+
if (!GENERIC_LABELS.has(lower)) return rawText;
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
if (out.effortSlug && out.effortSlug.trim()) {
|
|
965
|
+
return humanizeSlug(out.effortSlug);
|
|
966
|
+
}
|
|
967
|
+
const rawStatement = (out.statement ?? out.text ?? "").trim();
|
|
968
|
+
if (rawStatement) {
|
|
969
|
+
const firstLine = rawStatement.split("\n")[0]?.trim() ?? "";
|
|
970
|
+
if (firstLine && !GENERIC_LABELS.has(firstLine.toLowerCase())) {
|
|
971
|
+
return firstLine;
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
for (const m of all) {
|
|
975
|
+
const t = String(m.type ?? "").toLowerCase();
|
|
976
|
+
if (t === "current-round" || t === "rounds") {
|
|
977
|
+
const img = typeof m.image === "string" ? m.image.trim() : "";
|
|
978
|
+
if (/^completed\b/i.test(img)) return img;
|
|
979
|
+
const n = typeof m.value === "number" ? m.value : Number(m.value);
|
|
980
|
+
if (Number.isFinite(n) && n > 0) {
|
|
981
|
+
return t === "current-round" ? `Round ${n}` : `${n} ${n === 1 ? "Round" : "Rounds"}`;
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
const blockKey = String(out.sourceBlockKey ?? "").trim().toLowerCase();
|
|
986
|
+
if (blockKey.startsWith("waiting-to-start")) return "Start";
|
|
987
|
+
if (blockKey.startsWith("session-root") || blockKey === "root") return "Session";
|
|
988
|
+
if (blockKey.startsWith("rest")) return "Rest";
|
|
989
|
+
const roundMatch = /^round[-_:\s]*(\d+)/i.exec(blockKey);
|
|
990
|
+
if (roundMatch) return `Round ${roundMatch[1]}`;
|
|
991
|
+
if (blockKey.startsWith("rounds")) return "Rounds";
|
|
992
|
+
if (String(out.outputType ?? "").toLowerCase() === "analytics" && all.length > 0) {
|
|
993
|
+
const first = all[0];
|
|
994
|
+
const meta = first.metadata;
|
|
995
|
+
const summaryName = typeof meta?.originalKey === "string" && meta.originalKey || typeof meta?.canonicalKey === "string" && meta.canonicalKey || String(first.type ?? "");
|
|
996
|
+
if (summaryName) return summaryName;
|
|
997
|
+
}
|
|
998
|
+
return formatOutputTypeLabel(out.outputType);
|
|
999
|
+
}
|
|
1000
|
+
function resolveOutputTypeBadgeLabel(out) {
|
|
1001
|
+
const rawType = String(out.outputType ?? "system").trim().toLowerCase();
|
|
1002
|
+
if (rawType !== "segment") return formatOutputTypeLabel(out.outputType);
|
|
1003
|
+
const blockKey = String(out.sourceBlockKey ?? "").trim().toLowerCase();
|
|
1004
|
+
if (blockKey.startsWith("waiting-to-start")) return "Start";
|
|
1005
|
+
if (blockKey.startsWith("session-root") || blockKey === "root") return "Session";
|
|
1006
|
+
if (blockKey.startsWith("rest")) return "Rest";
|
|
1007
|
+
const all = out.metrics ? Array.from(out.metrics) : [];
|
|
1008
|
+
const hasEffort = Boolean(out.effortSlug) || all.some((m) => String(m.type ?? "").toLowerCase() === "effort");
|
|
1009
|
+
if (!hasEffort) {
|
|
1010
|
+
const hasRoundMetric = all.some((m) => {
|
|
1011
|
+
const t = String(m.type ?? "").toLowerCase();
|
|
1012
|
+
return t === "rounds" || t === "current-round";
|
|
1013
|
+
});
|
|
1014
|
+
if (hasRoundMetric || blockKey.startsWith("round")) return "Rounds";
|
|
1015
|
+
}
|
|
1016
|
+
return "Segment";
|
|
1017
|
+
}
|
|
1018
|
+
function formatOutputRowTitle(out, elapsedStr) {
|
|
1019
|
+
const label = resolveOutputRowLabel(out);
|
|
924
1020
|
return elapsedStr ? `${label} (${elapsedStr})` : label;
|
|
925
1021
|
}
|
|
1022
|
+
function resolveTimeOrigin(outputs, timeOrigin) {
|
|
1023
|
+
let minStarted;
|
|
1024
|
+
let maxStarted;
|
|
1025
|
+
for (const o of outputs) {
|
|
1026
|
+
const s = o.timeSpan?.started;
|
|
1027
|
+
if (typeof s !== "number" || !Number.isFinite(s)) continue;
|
|
1028
|
+
minStarted = minStarted === void 0 ? s : Math.min(minStarted, s);
|
|
1029
|
+
maxStarted = maxStarted === void 0 ? s : Math.max(maxStarted, s);
|
|
1030
|
+
}
|
|
1031
|
+
if (typeof timeOrigin === "number" && Number.isFinite(timeOrigin)) {
|
|
1032
|
+
if (minStarted !== void 0 && timeOrigin > minStarted && (maxStarted === void 0 || timeOrigin >= maxStarted)) {
|
|
1033
|
+
return minStarted;
|
|
1034
|
+
}
|
|
1035
|
+
return timeOrigin;
|
|
1036
|
+
}
|
|
1037
|
+
return minStarted;
|
|
1038
|
+
}
|
|
1039
|
+
function metricDurationToMs(m) {
|
|
1040
|
+
const rawVal = typeof m.value === "number" ? m.value : Number(m.value);
|
|
1041
|
+
if (!Number.isFinite(rawVal) || rawVal <= 0) return void 0;
|
|
1042
|
+
const unit = "unit" in m && typeof m.unit === "string" ? m.unit.trim().toLowerCase() : "";
|
|
1043
|
+
if (unit === "s" || unit === "sec" || unit === "secs" || unit === "second" || unit === "seconds") {
|
|
1044
|
+
return rawVal * 1e3;
|
|
1045
|
+
}
|
|
1046
|
+
if (unit === "min" || unit === "mins" || unit === "minute" || unit === "minutes") {
|
|
1047
|
+
return rawVal * 6e4;
|
|
1048
|
+
}
|
|
1049
|
+
return rawVal;
|
|
1050
|
+
}
|
|
1051
|
+
function resolveRowDurationMs(out) {
|
|
1052
|
+
const started = out.timeSpan?.started;
|
|
1053
|
+
const ended = out.timeSpan?.ended;
|
|
1054
|
+
if (started !== void 0 && ended !== void 0 && ended > started) {
|
|
1055
|
+
return ended - started;
|
|
1056
|
+
}
|
|
1057
|
+
if (out.metrics) {
|
|
1058
|
+
for (const m of out.metrics) {
|
|
1059
|
+
const t = String(m.type ?? "").toLowerCase();
|
|
1060
|
+
if (t === "elapsed" || t === "duration") {
|
|
1061
|
+
const ms = metricDurationToMs(m);
|
|
1062
|
+
if (ms !== void 0 && ms > 0) return ms;
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
if (started !== void 0 && ended !== void 0) {
|
|
1067
|
+
return Math.max(0, ended - started);
|
|
1068
|
+
}
|
|
1069
|
+
return void 0;
|
|
1070
|
+
}
|
|
926
1071
|
var EFFORT_TYPES = /* @__PURE__ */ new Set(["effort", "text", "action", "label"]);
|
|
927
1072
|
var LOAD_TYPES = /* @__PURE__ */ new Set([
|
|
928
1073
|
"resistance",
|
|
@@ -1128,13 +1273,11 @@ function extractMetricsForColumn(out, col, dynamicLowerTypes) {
|
|
|
1128
1273
|
case "effort": {
|
|
1129
1274
|
const explicitEfforts = all.filter((m) => EFFORT_TYPES.has(String(m.type).toLowerCase()));
|
|
1130
1275
|
if (explicitEfforts.length > 0) return explicitEfforts;
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
const
|
|
1135
|
-
|
|
1136
|
-
return [{ type: "label", value: summaryName, image: summaryName, origin: first.origin }];
|
|
1137
|
-
}
|
|
1276
|
+
const resolved = resolveOutputRowLabel(out);
|
|
1277
|
+
const genericType = formatOutputTypeLabel(out.outputType);
|
|
1278
|
+
if (resolved && resolved !== genericType) {
|
|
1279
|
+
const origin = all[0]?.origin ?? "runtime";
|
|
1280
|
+
return [{ type: "label", value: resolved, image: resolved, origin }];
|
|
1138
1281
|
}
|
|
1139
1282
|
return [];
|
|
1140
1283
|
}
|
|
@@ -1254,13 +1397,20 @@ function StatementCards({
|
|
|
1254
1397
|
}
|
|
1255
1398
|
return /* @__PURE__ */ jsx("ol", { className: "flex flex-col", "data-testid": "output-statements-cards", children: rows.map((out, idx) => {
|
|
1256
1399
|
const cats = extractMetricsByCategory(out.metrics);
|
|
1400
|
+
if (cats.efforts.length === 0) {
|
|
1401
|
+
const resolved = resolveOutputRowLabel(out);
|
|
1402
|
+
const genericType = formatOutputTypeLabel(out.outputType);
|
|
1403
|
+
if (resolved && resolved !== genericType) {
|
|
1404
|
+
cats.efforts.push({ type: "label", value: resolved, image: resolved, origin: "runtime" });
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1257
1407
|
const started = out.timeSpan?.started;
|
|
1258
|
-
const
|
|
1259
|
-
const elapsedStr =
|
|
1260
|
-
const offsetStr = started !== void 0 && t0 !== void 0 ?
|
|
1408
|
+
const durationMs = resolveRowDurationMs(out);
|
|
1409
|
+
const elapsedStr = durationMs !== void 0 ? formatMMSS(durationMs) : "running";
|
|
1410
|
+
const offsetStr = started !== void 0 && t0 !== void 0 ? formatOffsetMMSS(started - t0) : "+00:00";
|
|
1261
1411
|
const typeKey = String(out.outputType);
|
|
1262
|
-
const typeLabel =
|
|
1263
|
-
const rowTitle = formatOutputRowTitle(out
|
|
1412
|
+
const typeLabel = resolveOutputTypeBadgeLabel(out);
|
|
1413
|
+
const rowTitle = formatOutputRowTitle(out, elapsedStr);
|
|
1264
1414
|
const pr = lookupPrHighlight(out, prHighlights);
|
|
1265
1415
|
const bodyMetrics = [...cats.reps, ...cats.loads, ...cats.rounds, ...cats.durations, ...cats.distances];
|
|
1266
1416
|
const hasBody = bodyMetrics.length > 0;
|
|
@@ -1381,7 +1531,7 @@ function OutputStatementsTable({
|
|
|
1381
1531
|
onEditMetric,
|
|
1382
1532
|
prHighlights
|
|
1383
1533
|
}) {
|
|
1384
|
-
const t0 =
|
|
1534
|
+
const t0 = useMemo(() => resolveTimeOrigin(outputs, timeOrigin), [outputs, timeOrigin]);
|
|
1385
1535
|
const [internalSort, setInternalSort] = useState(
|
|
1386
1536
|
controlledSort ? [...controlledSort] : []
|
|
1387
1537
|
);
|
|
@@ -1548,11 +1698,12 @@ function OutputStatementsTable({
|
|
|
1548
1698
|
/* @__PURE__ */ jsx("tbody", { className: "divide-y divide-border/40", children: rows.length === 0 ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: activeColumns.length, className: "p-8 text-center text-muted-foreground font-sans text-xs", children: outputs.length === 0 ? "No output statements recorded for this run." : "No output statements match the current filter." }) }) : rows.map((out, idx) => {
|
|
1549
1699
|
const started = out.timeSpan?.started;
|
|
1550
1700
|
const ended = out.timeSpan?.ended;
|
|
1551
|
-
const
|
|
1552
|
-
const
|
|
1553
|
-
const
|
|
1554
|
-
const
|
|
1555
|
-
const
|
|
1701
|
+
const durationMs = resolveRowDurationMs(out);
|
|
1702
|
+
const elapsedStr = durationMs !== void 0 ? formatMMSS(durationMs) : "running";
|
|
1703
|
+
const wallTimeStr = ended !== void 0 || started !== void 0 ? formatClockTime(new Date(ended ?? started ?? 0)) : "\u2014";
|
|
1704
|
+
const offsetStr = started !== void 0 && t0 !== void 0 ? formatOffsetMMSS(started - t0) : "+00:00";
|
|
1705
|
+
const typeLabel = resolveOutputTypeBadgeLabel(out);
|
|
1706
|
+
const rowTitle = formatOutputRowTitle(out, elapsedStr);
|
|
1556
1707
|
const rowKey = String(out.id ?? `${out.sourceBlockKey ?? "row"}-${idx}`);
|
|
1557
1708
|
const pr = lookupPrHighlight(out, prHighlights);
|
|
1558
1709
|
const canInlineEditRow = Boolean(onEditMetric) && String(out.outputType ?? "").toLowerCase() === "segment" && Boolean(out.sourceBlockKey);
|
|
@@ -3591,7 +3742,7 @@ function normalizePaceToSecPerKm(value, unit) {
|
|
|
3591
3742
|
if (u === "km/h" || u === "kph") return 3600 / value;
|
|
3592
3743
|
return null;
|
|
3593
3744
|
}
|
|
3594
|
-
function
|
|
3745
|
+
function humanizeSlug2(slug) {
|
|
3595
3746
|
return slug.split(/[-_\s]+/).filter(Boolean).map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join(" ");
|
|
3596
3747
|
}
|
|
3597
3748
|
function normalizePrLookup(prHighlights) {
|
|
@@ -3643,25 +3794,7 @@ function extractVisibleMetrics(row) {
|
|
|
3643
3794
|
}
|
|
3644
3795
|
function buildSpreadsheetRows(run, prHighlights) {
|
|
3645
3796
|
const prMap = normalizePrLookup(prHighlights);
|
|
3646
|
-
const
|
|
3647
|
-
if (e.outputType !== "segment") return false;
|
|
3648
|
-
const key = String(e.sourceBlockKey ?? "").toLowerCase();
|
|
3649
|
-
return !key.startsWith("waiting-to-start") && key !== "session-root" && key !== "root";
|
|
3650
|
-
});
|
|
3651
|
-
const maxStackLevel = rawSegments.reduce((max, e) => Math.max(max, e.stackLevel ?? 0), 0);
|
|
3652
|
-
const hasEffortLeaves = rawSegments.some((e) => {
|
|
3653
|
-
const metrics = extractVisibleMetrics(e);
|
|
3654
|
-
return Boolean(e.effortSlug) || metrics.some((m) => String(m.type ?? "").toLowerCase() === "effort");
|
|
3655
|
-
});
|
|
3656
|
-
const segmentEvents = hasEffortLeaves ? rawSegments.filter((e) => {
|
|
3657
|
-
if ((e.stackLevel ?? 0) >= maxStackLevel) return true;
|
|
3658
|
-
const metrics = extractVisibleMetrics(e);
|
|
3659
|
-
const hasMovement = Boolean(e.effortSlug) || metrics.some((m) => {
|
|
3660
|
-
const t = String(m.type ?? "").toLowerCase();
|
|
3661
|
-
return t === "effort" || t === "rep" || t === "reps" || t === "distance";
|
|
3662
|
-
});
|
|
3663
|
-
return hasMovement;
|
|
3664
|
-
}) : rawSegments;
|
|
3797
|
+
const segmentEvents = selectSplitSegmentEvents(run.events ?? []);
|
|
3665
3798
|
const sessionStart = segmentEvents.reduce(
|
|
3666
3799
|
(min, e) => e.timeSpan?.started !== void 0 ? Math.min(min, e.timeSpan.started) : min,
|
|
3667
3800
|
run.timestamp
|
|
@@ -3700,7 +3833,7 @@ function buildSpreadsheetRows(run, prHighlights) {
|
|
|
3700
3833
|
if (lower === "effort" || canon === "effort") {
|
|
3701
3834
|
const slugVal = typeof m.metadata?.effortSlug === "string" ? String(m.metadata.effortSlug) : typeof m.value === "string" ? m.value : "";
|
|
3702
3835
|
if (!effortSlug && slugVal) effortSlug = slugVal;
|
|
3703
|
-
movement = String(m.image ?? (slugVal ?
|
|
3836
|
+
movement = String(m.image ?? (slugVal ? humanizeSlug2(slugVal) : m.value ?? "")).trim();
|
|
3704
3837
|
continue;
|
|
3705
3838
|
}
|
|
3706
3839
|
if (typeof m.value !== "number" || !Number.isFinite(m.value)) continue;
|
|
@@ -3763,7 +3896,7 @@ function buildSpreadsheetRows(run, prHighlights) {
|
|
|
3763
3896
|
} else if (!KNOWN_CANONICAL_KEYS.has(canon) && !KNOWN_CANONICAL_KEYS.has(lower)) {
|
|
3764
3897
|
const key = canon || lower;
|
|
3765
3898
|
custom[key] = {
|
|
3766
|
-
label:
|
|
3899
|
+
label: humanizeSlug2(mType),
|
|
3767
3900
|
value: m.value,
|
|
3768
3901
|
...m.unit ? { unit: m.unit } : {},
|
|
3769
3902
|
modified: isUser
|
|
@@ -3771,7 +3904,7 @@ function buildSpreadsheetRows(run, prHighlights) {
|
|
|
3771
3904
|
}
|
|
3772
3905
|
}
|
|
3773
3906
|
if (!movement) {
|
|
3774
|
-
movement = effortSlug ?
|
|
3907
|
+
movement = effortSlug ? humanizeSlug2(effortSlug) : `Split ${index + 1}`;
|
|
3775
3908
|
}
|
|
3776
3909
|
if (splitSec === null && ev.timeSpan?.started !== void 0 && ev.timeSpan?.ended !== void 0) {
|
|
3777
3910
|
splitSec = Math.max(0, (ev.timeSpan.ended - ev.timeSpan.started) / 1e3);
|
|
@@ -4914,27 +5047,42 @@ function ResultsSpreadsheetGrid({
|
|
|
4914
5047
|
);
|
|
4915
5048
|
}) })
|
|
4916
5049
|
] }) }),
|
|
4917
|
-
activeTab === "raw" &&
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
{
|
|
4929
|
-
outputs: run.events,
|
|
4930
|
-
filter: rawFilter,
|
|
4931
|
-
timeOrigin: run.timestamp,
|
|
4932
|
-
onClearFilter: () => setRawFilter(""),
|
|
4933
|
-
onEditMetric: onEditMetric ? (p) => onEditMetric(run.resultId, p) : void 0,
|
|
4934
|
-
prHighlights
|
|
5050
|
+
activeTab === "raw" && (() => {
|
|
5051
|
+
const events = run.events ?? [];
|
|
5052
|
+
let activeMinStart;
|
|
5053
|
+
let anyMinStart;
|
|
5054
|
+
for (const e of events) {
|
|
5055
|
+
const s = e.timeSpan?.started;
|
|
5056
|
+
if (typeof s !== "number" || !Number.isFinite(s)) continue;
|
|
5057
|
+
anyMinStart = anyMinStart === void 0 ? s : Math.min(anyMinStart, s);
|
|
5058
|
+
const key = String(e.sourceBlockKey ?? "").toLowerCase();
|
|
5059
|
+
if (e.outputType === "segment" && !key.startsWith("waiting-to-start")) {
|
|
5060
|
+
activeMinStart = activeMinStart === void 0 ? s : Math.min(activeMinStart, s);
|
|
4935
5061
|
}
|
|
4936
|
-
|
|
4937
|
-
|
|
5062
|
+
}
|
|
5063
|
+
const rawTimeOrigin = activeMinStart ?? anyMinStart ?? run.timestamp;
|
|
5064
|
+
return /* @__PURE__ */ jsxs("div", { "data-testid": "results-tab-panel-raw", className: "space-y-2.5", children: [
|
|
5065
|
+
/* @__PURE__ */ jsx(
|
|
5066
|
+
OutputFilterPills,
|
|
5067
|
+
{
|
|
5068
|
+
presets: DEFAULT_OUTPUT_FILTERS.map(normalizeOutputFilter),
|
|
5069
|
+
filter: rawFilter,
|
|
5070
|
+
onChange: setRawFilter
|
|
5071
|
+
}
|
|
5072
|
+
),
|
|
5073
|
+
/* @__PURE__ */ jsx(
|
|
5074
|
+
OutputStatementsTable,
|
|
5075
|
+
{
|
|
5076
|
+
outputs: events,
|
|
5077
|
+
filter: rawFilter,
|
|
5078
|
+
timeOrigin: rawTimeOrigin,
|
|
5079
|
+
onClearFilter: () => setRawFilter(""),
|
|
5080
|
+
onEditMetric: onEditMetric ? (p) => onEditMetric(run.resultId, p) : void 0,
|
|
5081
|
+
prHighlights
|
|
5082
|
+
}
|
|
5083
|
+
)
|
|
5084
|
+
] });
|
|
5085
|
+
})(),
|
|
4938
5086
|
/* @__PURE__ */ jsx(
|
|
4939
5087
|
EditorDialog,
|
|
4940
5088
|
{
|
|
@@ -12874,6 +13022,26 @@ function createCloseIcon(size = "md") {
|
|
|
12874
13022
|
function isAliasProperty(key) {
|
|
12875
13023
|
return ["alias", "aliases"].includes(key.trim().toLowerCase());
|
|
12876
13024
|
}
|
|
13025
|
+
function isSelfReferenceHref(docKind, meta, matchSlug, href, referenceProvider) {
|
|
13026
|
+
const normMatch = matchSlug.trim().toLowerCase();
|
|
13027
|
+
if (meta) {
|
|
13028
|
+
const metaSlug = typeof meta.slug === "string" ? meta.slug.trim().toLowerCase() : "";
|
|
13029
|
+
if (metaSlug && metaSlug === normMatch) return true;
|
|
13030
|
+
if (docKind === "effort" || docKind === "equipment") {
|
|
13031
|
+
const ownName = typeof meta.label === "string" && meta.label.trim() || typeof meta.title === "string" && meta.title.trim() || "";
|
|
13032
|
+
if (ownName) {
|
|
13033
|
+
const ownMatch = docKind === "effort" ? referenceProvider.resolveEffort(ownName) : referenceProvider.resolveEquipment(ownName);
|
|
13034
|
+
if (ownMatch && ownMatch.slug.trim().toLowerCase() === normMatch) return true;
|
|
13035
|
+
}
|
|
13036
|
+
}
|
|
13037
|
+
}
|
|
13038
|
+
if (typeof window !== "undefined" && window.location?.pathname) {
|
|
13039
|
+
const currentPath = window.location.pathname.replace(/\/+$/, "");
|
|
13040
|
+
const targetPath = href.split(/[?#]/)[0].replace(/\/+$/, "");
|
|
13041
|
+
if (currentPath && targetPath && currentPath === targetPath) return true;
|
|
13042
|
+
}
|
|
13043
|
+
return false;
|
|
13044
|
+
}
|
|
12877
13045
|
function createSummaryPill(value, hash2, href) {
|
|
12878
13046
|
const pill = document.createElement("span");
|
|
12879
13047
|
pill.className = "inline-flex max-w-full items-center rounded-md border border-border/60 bg-muted/40 px-2 py-0.5 text-xs text-foreground";
|
|
@@ -12892,7 +13060,7 @@ function createSummaryPill(value, hash2, href) {
|
|
|
12892
13060
|
pill.appendChild(label);
|
|
12893
13061
|
return pill;
|
|
12894
13062
|
}
|
|
12895
|
-
function createFrontmatterSummary(entries, onShowDetails, docKind, referenceProvider) {
|
|
13063
|
+
function createFrontmatterSummary(entries, onShowDetails, docKind, referenceProvider, meta) {
|
|
12896
13064
|
const summary = document.createElement("div");
|
|
12897
13065
|
summary.dataset.frontmatterSummary = "true";
|
|
12898
13066
|
summary.className = "divide-y divide-border/60";
|
|
@@ -12972,7 +13140,12 @@ function createFrontmatterSummary(entries, onShowDetails, docKind, referenceProv
|
|
|
12972
13140
|
let href;
|
|
12973
13141
|
if (referenceProvider && (docKind === "effort" || docKind === "equipment")) {
|
|
12974
13142
|
const match = docKind === "effort" ? referenceProvider.resolveEffort(val) : referenceProvider.resolveEquipment(val);
|
|
12975
|
-
if (match)
|
|
13143
|
+
if (match) {
|
|
13144
|
+
const candidateHref = referenceProvider.openHref(docKind, match.slug);
|
|
13145
|
+
if (!isSelfReferenceHref(docKind, meta, match.slug, candidateHref, referenceProvider)) {
|
|
13146
|
+
href = candidateHref;
|
|
13147
|
+
}
|
|
13148
|
+
}
|
|
12976
13149
|
}
|
|
12977
13150
|
aliasItems.push({ text: val, hash: false, href });
|
|
12978
13151
|
}
|
|
@@ -13100,7 +13273,7 @@ var DefaultFrontmatterWidget = class extends WidgetType {
|
|
|
13100
13273
|
persistedDetailed.set(view.dom, true);
|
|
13101
13274
|
view.dispatch({ effects: setFrontmatterDetailed.of(true) });
|
|
13102
13275
|
view.dom.querySelector('[aria-label="Show property summary"]')?.focus();
|
|
13103
|
-
}, docKind, referenceProvider));
|
|
13276
|
+
}, docKind, referenceProvider, meta));
|
|
13104
13277
|
} else {
|
|
13105
13278
|
box.appendChild(createColumnHeader());
|
|
13106
13279
|
if (entries.length === 0) {
|
|
@@ -13257,9 +13430,11 @@ var DefaultFrontmatterWidget = class extends WidgetType {
|
|
|
13257
13430
|
const pill = document.createElement("span");
|
|
13258
13431
|
pill.className = match ? "group/pill inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-muted/50 text-foreground border border-border/60" : chipIsReference ? "group/pill inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-destructive/10 text-destructive border border-destructive/30" : "group/pill inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-muted/40 text-foreground/90 border border-border/60";
|
|
13259
13432
|
const pillText = document.createElement("span");
|
|
13260
|
-
|
|
13433
|
+
const aliasHref = isAliasRow && match && referenceProvider ? referenceProvider.openHref(valueKind, match.slug) : void 0;
|
|
13434
|
+
const isSelfAlias = isAliasRow && match && referenceProvider && aliasHref ? isSelfReferenceHref(docKind, meta, match.slug, aliasHref, referenceProvider) : false;
|
|
13435
|
+
if (isAliasRow && match && referenceProvider && aliasHref && !isSelfAlias) {
|
|
13261
13436
|
const aliasLink = document.createElement("a");
|
|
13262
|
-
aliasLink.href =
|
|
13437
|
+
aliasLink.href = aliasHref;
|
|
13263
13438
|
aliasLink.textContent = chip;
|
|
13264
13439
|
aliasLink.className = "hover:underline cursor-pointer";
|
|
13265
13440
|
pillText.appendChild(aliasLink);
|
|
@@ -13267,7 +13442,7 @@ var DefaultFrontmatterWidget = class extends WidgetType {
|
|
|
13267
13442
|
pillText.textContent = isAliasRow ? chip : match ? match.label : chip;
|
|
13268
13443
|
}
|
|
13269
13444
|
pill.appendChild(pillText);
|
|
13270
|
-
if (match && referenceProvider && (!isAliasRow || idx === 0)) {
|
|
13445
|
+
if (match && referenceProvider && (!isAliasRow || idx === 0 && !isSelfAlias)) {
|
|
13271
13446
|
const openLink = document.createElement("a");
|
|
13272
13447
|
openLink.href = referenceProvider.openHref(valueKind, match.slug);
|
|
13273
13448
|
openLink.title = `Open ${match.label} page`;
|
|
@@ -21917,5 +22092,5 @@ function editorPreset(optionsOrDialect = "markdown") {
|
|
|
21917
22092
|
}
|
|
21918
22093
|
|
|
21919
22094
|
export { AGG_OPTIONS, CANONICAL_BLOCK_TYPES, CLAUSE_META, ClauseIcon, ComposerRegistry, DEFAULT_DIAGNOSTICS_DEBOUNCE_MS, DEFAULT_OUTPUT_FILTERS, DEFAULT_PRIMARY_FILTER, DefaultFrontmatterWidget, EditorDialog, GROUPBY_OPTIONS, GoalRings, INTERNAL_FRONTMATTER_KEYS, KIND_OPTIONS, METRIC_OPTIONS, MULTI_VALUE_TYPES, MetricBadge, OUTPUT_TYPE_CLASS, OUTPUT_TYPE_DOT, OutputFilterPills, OutputStatementsTable, PLANE_OPTIONS, PRBadge, ProposedMetricBadge, QueryBlockView, QueryObjectBuilder, QueryValue, ROLLUP_OPTIONS, ResultsSpreadsheetGrid, RowsResultsChrome, RowsTable, RpePopoverControl, SERIES_COLORS, SOURCE_OPTIONS, SUGGESTION_BINDINGS, SessionSummaryCard, SingleLineYAxisTick, StackedBar, TARGET_OPTIONS, TIME_OPTIONS, TONE_CLASS, TokenSlotPill, TopList, UNIT_OPTIONS, WHERE_AGGREGATORS, WHERE_METRICS, WidgetChart, WidgetProblemBadge, WqlBars, WqlComposer, WqlDiagnosticsStrip, WqlEmptyState, WqlQueryInspectorModal, WqlScopeMap, WqlTable, WqlTimeseries, ZONE_META, ZONE_ORDER, ZoneDistribution, acceptCompletionOrFirst, activeCursorSection, addRuntimePanel, affiliateTagFacet, applyAmazonAffiliateTag, attachmentUrlFacet, autocompleteTooltipTheme, bindTokenParamIntoWql, bindTokenToQueryObject, blockTypesFromBlocks, buildAddableFilterGroups, buildScopeZones, buildSpreadsheetRows, canonicalSuggestionItems, compactNumber, composerRegistry, computeSessionPrHighlights, computeYAxisWidth, configureOverlayActions, createExecutorDocumentHost, cursorFocusExtension, customCompletionSources, cycleBaselineLayer, dateRangeSlot, dispatchAddRuntimePanel, dispatchExpandRuntimePanel, dispatchGutterHighlights, dispatchRemoveRuntimePanel, editQueryClause, editingQuerySectionsField, editingWidgetsField, editorFocusField, editorFocusTracker, editorPreset, editorTheme, embedPreviewDecorations, expandRuntimePanel, extractBlockQueries, extractMetricsByCategory, fenceCompletion, findQueryBlockSection, findWorkoutErrors, forceSectionParse, formatAnalyticsFloat, formatAxisTick, formatClockTime, formatCompactMetricValue, formatHumanQuerySummary, formatMMSS, formatMetricValue, formatSummaryDurationMMSS, formatTimeseriesTick, formatTimeseriesTooltipValue, formatTimestamp, frontmatterDebugMode, frontmatterDetailed, frontmatterKeymap, frontmatterPreview, frontmatterPreviewField, frontmatterReferenceIndex, frontmatterSource, frontmatterSuggestions, frontmatterVisibility, getClauseMeta, getClauseSupportError, getClauseZone, getCursorFocusState, getOverlayActions, getSuggestionBinding, gutterHighlightsField, gutterUnified, handleFenceAutoWrap, handleSmartUrlPaste, inlineButtonDecoration, insertMarkdownLinkCommand, insertWhiteboardNewline, invalidateSuggestions, isAmazonRetailHost, isEditorFocused, isInternalFrontmatterKey, isNavigableUrl, isWhiteboardScriptBody, lineIdsExtension, linkOpen, linkPreview, loadSuggestions, markdownSyntaxHiding, markdownTablePreview, matchFilterTypeahead, mergeSeries, mergeSuggestionItems, mergeTagSuggestions, mobileDockedCompletionFacet, navigationFacet, nestedCompletion, nestedCompletionOptions, normalizeOutputFilter, normalizeSimplePipelineToAggregate, notebookSlugsFromBlocks, outputToRunResult, outputsToRunResult, patchBlockQuery, presentBadges, previewDecorations, primaryQueryOf, promoteFindToChartObject, queryBlockPreview, readSessionRpe, referenceIndexReload, registeredSectionWidgets, removeRuntimePanel, removeSeriesLayer, resolveCodeLanguage, resolveQueryDraft, resolveWidgetDisplayUnit, runtimePanelField, saveBlockQuerySource, sectionAtPos, sectionField, sectionGeometry, sectionIdentity, sectionIdentityHistory, sectionMove, sectionRestore, sectionSaved, sessionQueryFence, sessionQueryInsert, sessionQueryWql, setEditorFocused, setFrontmatterDetailed, setFrontmatterSource, setGutterHighlights, setPrimaryQueryOnObject, setQuerySourceEditing, setSuggestionBinding, shouldTriggerBackspaceCompletion, slashBlockCompletion, smartIncrement, summarizeAggregate, summarizeFind, summarizePipeline, tagsFromStaticBlocks, toChartResult, toggleCompareLayer, toggleGoalLayer, toggleInlineMarkdown, toggleWidgetEdit, tooltipTimestamp, urlAtPos, useChartShape, useComposerSlots, useSessionPrHighlights, useSuggestions, useWqlStageCounts, widgetBlockPreview, wodAutoWrap, wodAutocompletion, wodBackspaceCompletion, wodCompletionIconOption, wodCompletionKeymap, wodCompletionSource, wodEditorKeymap, wodIndentKeymap, wodLinter, wodOverlayPanel, workoutLintSource, wqlToPills, wrapInTimeFence };
|
|
21920
|
-
//# sourceMappingURL=chunk-
|
|
21921
|
-
//# sourceMappingURL=chunk-
|
|
22095
|
+
//# sourceMappingURL=chunk-QGB3HYJU.mjs.map
|
|
22096
|
+
//# sourceMappingURL=chunk-QGB3HYJU.mjs.map
|