feat: place calls and current results beside the function

This commit is contained in:
cflmy committed 2026-11-24 13:26:52 +08:00
1 parent 07fa0d62a8
commit b6962b2b38
3 files changed
+95 -25

No files matched your search

+26
View File
@@ -1382,3 +1382,29 @@
.mq-heading-anchor { display: block; }
.mq-document math { font-family: "Noto Sans Math", math; }
}
@layer semantics {
.mq-document h2 .mq-fn-call {
margin-inline-start: .8rem;
vertical-align: middle;
border-color: var(--mq-gold);
color: var(--mq-focus);
}
.mq-result-slot:empty { display: none; }
.mq-result-slot .mq-run-panel {
border-color: var(--mq-olive);
background: var(--mq-surface);
margin-block: 1.25rem 1.75rem;
}
.mq-run-panel > summary {
cursor: pointer;
font-weight: 650;
color: var(--mq-olive);
margin-block-end: .6rem;
}
.mq-run-panel[hidden] { display: none; }
}
+10
View File
@@ -598,6 +598,14 @@
};
closeAllDialogs();
clearRunOutput();
var panel = runPanel();
var slot = $$(".mq-result-slot").find(function (element) {
return element.dataset.resultFor === payload.target.function_id ||
(payload.target.kind === "entry" && element.dataset.resultFor.split(".").pop().split("::").pop() === "main");
});
if (slot && panel) slot.appendChild(panel);
else if (panel) $("#mq-document").after(panel);
if (panel) panel.open = true;
showRunPanel();
setRunBusy(true);
setRunStatus("正在提交运行请求…");
@@ -698,6 +706,8 @@
output.append(document.createTextNode(decoders[stream].decode(bytes, { stream: true })));
output.hidden = false;
} else if (/^(branch|loop|control|call)\./.test(observation.kind)) {
var wrap = $("#mq-run-trace-wrap");
if (wrap) wrap.hidden = false;
var events = $("#mq-run-events");
if (events && events.childElementCount < 100) {
appendLine(events, "li", "", observation.kind +