Revert "Implemented the Phase C1C polish pass."

This reverts commit ca63a994dcbd941eff84d2a2860d53810f036123.
This commit is contained in:
Nick Beckley 2026-06-19 22:07:34 +01:00
parent ca63a994dc
commit ae064d04b6
4 changed files with 13 additions and 90 deletions

View File

@ -1067,8 +1067,7 @@ body.timeline-inspector-resizing {
padding-top: 14px; padding-top: 14px;
} }
.plot-lane-svg-overlay, .plot-lane-svg-overlay {
.plot-lane-warning-overlay {
position: absolute; position: absolute;
inset: 0 auto auto 0; inset: 0 auto auto 0;
z-index: 4; z-index: 4;
@ -1076,10 +1075,6 @@ body.timeline-inspector-resizing {
overflow: visible; overflow: visible;
} }
.plot-lane-warning-overlay {
z-index: 8;
}
.plot-line-svg-path { .plot-line-svg-path {
fill: none; fill: none;
stroke-width: 3.5; stroke-width: 3.5;
@ -1291,7 +1286,6 @@ body.timeline-inspector-resizing {
.thread-marker { .thread-marker {
position: relative; position: relative;
z-index: 5; z-index: 5;
left: var(--thread-marker-offset-x, 0);
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;

File diff suppressed because one or more lines are too long

View File

@ -1589,26 +1589,14 @@
if (!svg) { if (!svg) {
return; return;
} }
let warningSvg = board.querySelector("[data-plot-line-warning-svg]");
if (!warningSvg) {
warningSvg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
warningSvg.setAttribute("class", "plot-lane-warning-overlay");
warningSvg.setAttribute("data-plot-line-warning-svg", "true");
warningSvg.setAttribute("aria-hidden", "true");
board.append(warningSvg);
}
svg.replaceChildren(); svg.replaceChildren();
warningSvg.replaceChildren();
const boardRect = board.getBoundingClientRect(); const boardRect = board.getBoundingClientRect();
const width = Math.max(board.scrollWidth, boardRect.width); const width = Math.max(board.scrollWidth, boardRect.width);
const height = Math.max(board.scrollHeight, boardRect.height); const height = Math.max(board.scrollHeight, boardRect.height);
svg.setAttribute("viewBox", `0 0 ${width} ${height}`); svg.setAttribute("viewBox", `0 0 ${width} ${height}`);
svg.setAttribute("width", String(width)); svg.setAttribute("width", String(width));
svg.setAttribute("height", String(height)); svg.setAttribute("height", String(height));
warningSvg.setAttribute("viewBox", `0 0 ${width} ${height}`);
warningSvg.setAttribute("width", String(width));
warningSvg.setAttribute("height", String(height));
const makeSvg = (name, attributes = {}) => { const makeSvg = (name, attributes = {}) => {
const element = document.createElementNS("http://www.w3.org/2000/svg", name); const element = document.createElementNS("http://www.w3.org/2000/svg", name);
@ -1621,60 +1609,6 @@
return rowRect.top - boardRect.top + rowRect.height / 2; return rowRect.top - boardRect.top + rowRect.height / 2;
}; };
const resetMarkerOffsets = () => {
board.querySelectorAll("[data-plot-event-node]").forEach((marker) => {
marker.style.removeProperty("--thread-marker-offset-x");
});
};
const markerSceneId = (marker) => marker.closest("[data-plot-line-slot]")?.dataset.sceneId || "";
const safeMarkerOffset = (marker) => {
const slot = marker.closest("[data-plot-line-slot]");
if (!slot) {
return 0;
}
const slotRect = slot.getBoundingClientRect();
const markerRect = marker.getBoundingClientRect();
return Math.max(0, Math.min(22, (slotRect.width - markerRect.width) / 2 - 6));
};
const applySameSceneSplitOffsets = () => {
resetMarkerOffsets();
const rowsById = new Map([...board.querySelectorAll("[data-plot-line-row]")]
.filter((row) => row.dataset.plotLineId)
.map((row) => [row.dataset.plotLineId, row]));
const offsets = new Map();
const addOffset = (marker, direction) => {
const offset = safeMarkerOffset(marker);
if (offset > 0) {
offsets.set(marker, direction * offset);
}
};
board.querySelectorAll("[data-plot-event-node]").forEach((marker) => {
const type = (marker.dataset.plotEventType || "").toLowerCase();
if (type !== "branch" && type !== "split") {
return;
}
const targetIds = type === "branch"
? [marker.dataset.targetPlotLineId || ""].filter(Boolean)
: (marker.dataset.targetPlotLineIds || "").split(",").map((value) => value.trim()).filter(Boolean);
targetIds.forEach((targetId) => {
const firstTargetMarker = rowsById.get(targetId)?.querySelector("[data-plot-event-node]");
if (firstTargetMarker && markerSceneId(marker) === markerSceneId(firstTargetMarker)) {
addOffset(marker, -1);
addOffset(firstTargetMarker, 1);
}
});
});
offsets.forEach((offset, marker) => marker.style.setProperty("--thread-marker-offset-x", `${offset}px`));
};
applySameSceneSplitOffsets();
const pointFor = (row, marker) => { const pointFor = (row, marker) => {
const slot = marker.closest("[data-plot-line-slot]"); const slot = marker.closest("[data-plot-line-slot]");
if (!slot) { if (!slot) {
@ -1800,10 +1734,10 @@
} }
} }
warningSvg.append(group); svg.append(group);
}; };
const drawConnector = (source, targetRow, colour, type, targetPlotLineId = "") => { const drawConnector = (source, targetRow, colour, type) => {
if (!targetRow) { if (!targetRow) {
if (window.console?.warn) { if (window.console?.warn) {
window.console.warn(`Plot line ${type} connector skipped because target plot line data is missing.`); window.console.warn(`Plot line ${type} connector skipped because target plot line data is missing.`);
@ -1811,20 +1745,15 @@
return; return;
} }
const targetPoint = rowDataById.get(targetPlotLineId)?.points[0]; const target = { x: source.x, y: rowCenterY(targetRow) };
const target = targetPoint || { x: source.x + 42, y: rowCenterY(targetRow), radius: 10 }; const flowX = Math.max(28, Math.min(46, Math.abs(target.y - source.y) * 0.28));
const sourceRadius = Math.max(8, source.radius || 12); const sourceRadius = Math.max(8, source.radius || 12);
const targetRadius = Math.max(8, target.radius || 12); const startX = source.x + sourceRadius;
const direction = target.x >= source.x ? 1 : -1; const targetX = startX + flowX;
const startX = source.x + direction * sourceRadius; const midX = startX + flowX / 2;
const endX = target.x - direction * targetRadius;
const flowX = Math.max(24, Math.min(52, Math.abs(target.y - source.y) * 0.28 + Math.abs(endX - startX) * 0.2));
const controlOffset = direction * flowX;
const firstControlX = startX + controlOffset;
const secondControlX = endX - controlOffset;
svg.append(makeSvg("path", { svg.append(makeSvg("path", {
class: `plot-line-svg-connector plot-line-svg-connector-${type}`, class: `plot-line-svg-connector plot-line-svg-connector-${type}`,
d: `M ${startX} ${source.y} C ${firstControlX} ${source.y}, ${secondControlX} ${target.y}, ${endX} ${target.y}`, d: `M ${startX} ${source.y} C ${midX} ${source.y}, ${midX} ${target.y}, ${targetX} ${target.y}`,
stroke: colour stroke: colour
})); }));
}; };
@ -1889,12 +1818,12 @@
rowData.forEach(({ points, colour }) => { rowData.forEach(({ points, colour }) => {
points.forEach((point) => { points.forEach((point) => {
if (point.type === "branch" || point.type === "merge") { if (point.type === "branch" || point.type === "merge") {
drawConnector(point, rowLookup.get(point.targetPlotLineId), colour, point.type, point.targetPlotLineId); drawConnector(point, rowLookup.get(point.targetPlotLineId), colour, point.type);
} }
if (point.type === "split" && point.targetPlotLineIds.length >= 2) { if (point.type === "split" && point.targetPlotLineIds.length >= 2) {
point.targetPlotLineIds.forEach((targetPlotLineId) => { point.targetPlotLineIds.forEach((targetPlotLineId) => {
drawConnector(point, rowLookup.get(targetPlotLineId), colour, point.type, targetPlotLineId); drawConnector(point, rowLookup.get(targetPlotLineId), colour, point.type);
}); });
} else if (point.type === "split" && point.targetPlotLineIds.length > 0 && window.console?.warn) { } else if (point.type === "split" && point.targetPlotLineIds.length > 0 && window.console?.warn) {
window.console.warn("Plot line split connector skipped because fewer than two targets are available."); window.console.warn("Plot line split connector skipped because fewer than two targets are available.");

File diff suppressed because one or more lines are too long