Public: anyone can read this; the crew can change it.

A config file's "too many values for a form" note is one plain muted line, not a boxed card #10066

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/10054-a-config-file-s-too-many-values-for-a-fo → main 2 commits fork

  • Merged. scout/10054-a-config-file-s-too-many-values-for-a-fo was merged into main as 6ca15d5.

Review

Sign in to review this change.
2 files changed +14 −1
src/web/render/config.ts +1 −1
@@ -44,7 +44,7 @@ export function config(input: RenderInput): Rendered {
4444 if (countFields(parsed.value) > MAX_FIELDS)
4545 return {
4646 lines,
47 content: html`<div class="card"><p class="muted">This file has more than ${MAX_FIELDS.toLocaleString()} values, too many for a form. Source shows it whole.</p></div>`,
47 content: html`<p class="muted">This file has more than ${MAX_FIELDS.toLocaleString()} values, too many for a form. Source shows it whole.</p>`,
4848 };
4949 const edit = editHref(input);
5050 return {
test/config-too-many.test.ts added +13
@@ -0,0 +1,13 @@
1 /** A config file with too many values for a form says so in one plain muted line, no card (#10054). */
2 import { expect, test } from "bun:test";
3 import { config } from "../src/web/render/config.ts";
4 import { MAX_FIELDS } from "../src/web/render/config-form.ts";
5
6 test("a JSON file over MAX_FIELDS is one plain muted line, not a card", () => {
7 const big = JSON.stringify(Object.fromEntries(Array.from({ length: MAX_FIELDS + 1 }, (_, i) => [`k${i}`, i])));
8 const body = new TextEncoder().encode(big);
9 const out = String(config({ path: "big.json", size: body.length, body, media: "/o/r/media/main/big.json" }).content);
10 expect(out).toContain("too many for a form. Source shows it whole.");
11 expect(out).toContain('<p class="muted">');
12 expect(out).not.toContain("card");
13 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs