Skip to content

Commit 440677c

Browse files
committed
fix: scroll in devtools
1 parent e08793b commit 440677c

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

cmd/rfw/plugins/devtools/devtools.js

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const markup = `
5555
.node .meta{margin-left:auto; display:flex; align-items:center; gap:6px; font-variant-numeric:tabular-nums; color:var(--rose-300)}
5656
.node .meta span{display:inline-flex; align-items:center; gap:4px; padding:2px 8px; border-radius:999px; border:1px solid var(--tile-border); background:var(--tile-bg)}
5757
58-
.rfw-detail{flex:1;background:var(--chip-bg);display:flex;flex-direction:column}
58+
.rfw-detail{overflow-y:auto; flex:1;background:var(--chip-bg);display:flex;flex-direction:column}
5959
.rfw-detail .rfw-subheader{display:flex;align-items:center;gap:10px;padding:8px 12px;border-bottom:1px solid var(--border)}
6060
.kv{display:grid; grid-template-columns:160px 1fr; gap:8px 12px; padding:12px}
6161
.kv div{padding:6px 8px; background:var(--tile-bg); border:1px solid var(--tile-border); border-radius:10px; overflow:auto}
@@ -458,7 +458,8 @@ function selectNode(n) {
458458
detailKind.textContent = n.kind;
459459
const rows = [];
460460
rows.push(renderRow("Path", n.path || ""));
461-
if (typeof n.updates === "number") rows.push(renderRow("Updates", String(n.updates)));
461+
if (typeof n.updates === "number")
462+
rows.push(renderRow("Updates", String(n.updates)));
462463
if (typeof n.average === "number" && Number.isFinite(n.average))
463464
rows.push(renderRow("Average render", formatMs(n.average)));
464465
if (typeof n.time === "number" && Number.isFinite(n.time))
@@ -474,9 +475,8 @@ function selectNode(n) {
474475
if (n.signals && Object.keys(n.signals).length)
475476
rows.push(renderJSONRow("Signals", n.signals));
476477
if (n.store) {
477-
const storeLabel = [n.store.module, n.store.name]
478-
.filter(Boolean)
479-
.join("/") || "-";
478+
const storeLabel =
479+
[n.store.module, n.store.name].filter(Boolean).join("/") || "-";
480480
rows.push(renderRow("Store", storeLabel));
481481
if (n.store.state && Object.keys(n.store.state).length) {
482482
rows.push(renderJSONRow("Store state", n.store.state));
@@ -487,7 +487,8 @@ function selectNode(n) {
487487
}
488488
if (Array.isArray(n.timeline) && n.timeline.length)
489489
rows.push(renderTimelineRow("Timeline", n.timeline));
490-
detailKV.innerHTML = rows.join("") || renderRow("Info", "No metadata available");
490+
detailKV.innerHTML =
491+
rows.join("") || renderRow("Info", "No metadata available");
491492
}
492493

493494
function escapeHTML(s) {
@@ -525,14 +526,14 @@ function renderTimelineRow(label, events) {
525526
function renderStoreBindingsRow(label, bindings) {
526527
const items = bindings
527528
.map((binding) => {
528-
const storeLabel = [binding.module, binding.name]
529-
.filter(Boolean)
530-
.join("/") || "-";
531-
const keys = Array.isArray(binding.keys) && binding.keys.length
532-
? binding.keys
533-
.map((key) => `<span class="store-key">${escapeHTML(key)}</span>`)
534-
.join("")
535-
: '<span class="store-key muted">(all keys)</span>';
529+
const storeLabel =
530+
[binding.module, binding.name].filter(Boolean).join("/") || "-";
531+
const keys =
532+
Array.isArray(binding.keys) && binding.keys.length
533+
? binding.keys
534+
.map((key) => `<span class="store-key">${escapeHTML(key)}</span>`)
535+
.join("")
536+
: '<span class="store-key muted">(all keys)</span>';
536537
return `<div class="store-binding"><span class="store-badge">${escapeHTML(
537538
storeLabel,
538539
)}</span><div class="store-keys">${keys}</div></div>`;
@@ -551,7 +552,7 @@ function formatJSON(value) {
551552

552553
function renderRow(label, value, isMono = false) {
553554
const content = escapeHTML(value == null ? "" : value);
554-
const cls = isMono ? " class=\"mono\" style=\"white-space:pre-wrap\"" : "";
555+
const cls = isMono ? ' class="mono" style="white-space:pre-wrap"' : "";
555556
return `<b>${escapeHTML(label)}</b><div${cls}>${content}</div>`;
556557
}
557558

0 commit comments

Comments
 (0)