Skip to content

armgit / qm

Public Imported from GitHub
0

Multiplayer agent harness for work.

fix: publish the measured pane density on every sync

Joshua Francef868d68dae9a
diff --git a/plugins/web-ui/src/split.ts b/plugins/web-ui/src/split.ts
index a270f4e7e..0428ba699 100644
--- a/plugins/web-ui/src/split.ts
+++ b/plugins/web-ui/src/split.ts
@@ -857,8 +857,10 @@ class PaneContent implements IContentRenderer {
private syncDensity(): void {
const next = paneDensity(this.element);
- if (!next || next === this.density) return;
+ if (!next) return;
+ const changed = next !== this.density;
this.element.dataset.density = this.density = next;
+ if (!changed) return;
for (const handler of this.redrawOnResize) handler();
}
diff --git a/plugins/web-ui/test/tab-switch-scroll-snap.test.ts b/plugins/web-ui/test/tab-switch-scroll-snap.test.ts
index 6c5148510..497ca9b7a 100644
--- a/plugins/web-ui/test/tab-switch-scroll-snap.test.ts
+++ b/plugins/web-ui/test/tab-switch-scroll-snap.test.ts
@@ -20,7 +20,29 @@ test("responsive pane summaries do not replace the transcript scroller", () => {
);
});
-test("hidden panes retain their last meaningful density", () => {
+test("hidden panes retain their last meaningful density, and every measure writes the attribute", () => {
const fn = split.match(/private syncDensity\(\): void \{[\s\S]*?\n {2}\}/)?.[0] ?? "";
- assert.match(fn, /if \(!next\s*\|\|\s*next === this\.density\) return;/);
+ assert.match(fn, /if \(!next\) return;/, "an unmeasurable pane keeps its last density");
+ assert.doesNotMatch(
+ fn,
+ /next === this\.density\) return;/,
+ "the DOM write must not be skipped when the measured tier equals the starting one",
+ );
+ const write = fn.indexOf("this.element.dataset.density");
+ const gate = fn.indexOf("if (!changed) return;");
+ assert.ok(write >= 0, "the tier is published to the DOM");
+ assert.ok(
+ gate > write,
+ "only the redraw callbacks are gated on an actual change — a pane that mounts at its starting tier still gets the attribute",
+ );
+});
+
+test("pane composer sizing hangs off the density attribute, so writing it is load-bearing", () => {
+ const css = readFileSync(new URL("../src/shell.css", import.meta.url), "utf8");
+ const block = css.match(/\[data-density\] \.composer-input \{[^}]*\}/)?.[0] ?? "";
+ assert.match(
+ block,
+ /min-height: 0;/,
+ "without the attribute the pane composer falls back to the main-window min-height",
+ );
});