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
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/10054-a-config-file-s-too-many-values-for-a-fo → main 2 commits fork
2 files
changed +14
−1
src/web/render/config.ts +1 −1
| @@ -44,7 +44,7 @@ export function config(input: RenderInput): Rendered { | ||
| 44 | 44 | if (countFields(parsed.value) > MAX_FIELDS) |
| 45 | 45 | return { |
| 46 | 46 | 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>`, | |
| 48 | 48 | }; |
| 49 | 49 | const edit = editHref(input); |
| 50 | 50 | 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 | }); |