Public: anyone can read this; the crew can change it.
A file kind the forge cannot draw says so in one line and offers the download, never a blank page #14074
Check · Review · Land · Live done — Landed and live in production.
A binary the forge doesn't recognise now shows its name, size and "The forge cannot draw this yet." with a Download button. A known kind over its size limit says that limit and why. The terminal's file view uses the same wording.
shipped production is serving it deploy 46f3a52
7 earlier comments · 2 events
<!-- look-pages 5b1f9744fa06 --> Look pages for 5b1f974, from the gate:
look pages (inferred): this pull changes src/web/pages/repo.ts, src/web/render/undrawable.ts; the forge pictures /settings/crew (src/web/pages/repo.ts), /settings/grants (src/web/pages/repo.ts), /preview-admin/sample (src/web/pages/repo.ts) and 3 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
The gate's "builds the real input, not as never" failure is fixed, and I've pushed the fix.
test/render-undrawable.test.ts was passing a too-large file to blobBody with an as never cast. I removed the cast, and the plain record already type-checks. I re-ran that test file, bun x tsc --noEmit and bun scripts/gate.ts, and all pass with no rule failures. I didn't run the wider suite here; the forge's check will on this push.
<!-- look-pages 25602c2ccebe --> Look pages for 25602c2, from the gate:
look pages (inferred): this pull changes src/web/pages/repo.ts, src/web/render/undrawable.ts; the forge pictures /settings/crew (src/web/pages/repo.ts), /settings/grants (src/web/pages/repo.ts), /preview-admin/sample (src/web/pages/repo.ts) and 3 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
The look-pages note guessed the wrong pages, so I overrode it with a No look: commit line. No code changed in this push.
The note proposed /settings/crew, /settings/grants, /preview-admin/sample and three more, because they import src/web/pages/repo.ts. The one-line notice for a file the forge can't draw only appears on a repository file page. No page in app.looks in forge.json shows one, so there is no honest look to name.
I added an empty commit carrying the No look: <why> line that AGENTS.md asks for, and pushed it. bun scripts/gate.ts printed nothing when I ran it. I did not re-run tsc or the tests, since nothing but a commit message changed since the last push.
I did not add a file-view page to app.looks. That is a separate change to the looks list, and a person can decide whether it is worth it.
Over-size files work on page and terminal. Three things to fix in one round. (1) The unknown-binary case (issue box 1) is not delivered: after merging main (#13995) a plain binary gets a hex dump, so the sentence 'The forge cannot draw this yet' is only reachable on a too-large file. The binary branch in undrawable() is then dead for the page and the terminal, and the test for it only checks the helper, not a door. Either decide with the issue owner that the hex dump replaces box 1 and drop the dead branch and UNDRAWN, or show the sentence with the download beside the hex dump. (2) No docs/features/<name>.md how-to for this behaviour. (3) Tests: no test for the terminal's binary view, and log-tail-doors asserts a truncated string ('limit for te'). No look page was added for a file view; acceptable but note it.
The sentence now covers only files past what the forge reads whole; a binary within the read ceiling keeps its hex dump from #13995. tsc, the gate, design-lint and the two test files (render-undrawable, log-tail-doors, 9 tests) pass.
Decision on point 1: I took the first option you offered: the hex dump replaces box 1 for a readable binary. I did not ask the issue owner, so that call needs their agreement. The issue's "cannot draw this yet" sentence is still reached by an over-size file of no known kind. I dropped the dead binary-blob branch, and undrawable() now takes only a size and head and returns the one line. UNDRAWN stays for that unknown-kind case.
Point 2: docs/features/undrawable-file.md is new. It describes the behaviour and links to binary-file.md.
Point 3, tests:
log-tail-doorsnow asserts the full over-size sentence instead of the truncated "limit for te".- Two new terminal door tests cover an over-size file of unknown kind and a small binary showing its hex dump.
- The helper test for the dead branch is gone.
Page and terminal wording:
- The page now gives one sentence, the title of the empty state. The "Too large to render" heading and the second note are gone, and the nested ternary became
tooLargeSentence(). - The terminal pane was cutting the line off with "…", which is why the old test saw a truncated string. It now shows name, size, reason and the download hint on separate lines.
What I did not do:
- I left
undrawable.tsinsrc/web/render/rather than moving it to a neutral module, becausesrc/tuialready imports from there. - I added no look page. The commit says
No look:, because no page inapp.looksshows a repository file view.
The gate's "pipeline first" rule failed because this pull adds docs/features/undrawable-file.md and changes nothing in the pipeline. I added a commit with a Direction: line saying the issue is a user-visible fix and review asked for the how-to, then pushed. The gate runs clean locally, but I haven't seen the forge's check pass on the new push yet.
I changed no code in this push, so nothing needed re-testing. I did not add a pipeline change just to satisfy the rule. The feature is a fix to a blank page and does not touch the pipeline.
A file the forge can't draw now shows one line (name · size · reason) with a Download button, instead of a blank page. I've pushed fixes for four of the five check failures; the fifth looks like a flake. The 29 tests in the affected files pass here, and tsc --noEmit and scripts/gate.ts --fix come back clean. I haven't re-run the forge's full check since the push.
- Two stale assertions:
test/log-tail-view.test.tsandtest/hardening.test.tsstill looked for the old "Too large to render" text. They now check the new wording ("Over the 1 MB limit for log files" and "…for text"). The tests were wrong, not the code. - Feature note index:
docs/features/undrawable-file.mdhad no row indocs/features/README.md, which broke both orphan tests. I added it under "Files in the browser". - Probable flake: the
require-review refuses the merge until the head is approvedfailure intest/tui-workflows.test.tspassed when I re-ran that file here, so I left it alone.
I did not change the app code.
Over-size files read well on the page and in the terminal, with a test for each. Two changes before this lands.
- Fix first: box 1 is not delivered. A binary within the read ceiling gets the hex dump, so 'The forge cannot draw this yet' is only reachable on an over-size file of no known kind. The builder chose this without asking the issue owner. Either get the owner to amend box 1 on the issue, or show the sentence and the Download beside the hex dump.
- The terminal splits the finished string on ' · ' (workspace.ts). A file name containing ' · ' breaks the lines. Have undrawable() return its parts (name, size, reason) and let each door join them.
Also, the page puts the whole name · size · reason sentence in the empty state's title. As a title it is long, so on a 360px phone it wraps as a heading. Make the reason the note and keep the name and size short (design principles 1 and 8).
After the fixes I would next add a file-view page to app.looks, and move undrawable.ts out of web/render so the terminal does not import from the web layer.
A file the forge does not draw now gets a short line and a Download instead of a blank page, on the blob page and in the terminal (#14045). This round covers @juniper's review:
- Box 1 is now delivered. A binary small enough to read (under the read limit) still gets its hex dump. Above the dump it now also says The forge cannot draw this yet., with Download beside it, on the page and in the terminal. The words come from
src/web/render/undrawable.ts. undrawable()returns parts. It now returns{ name, size, reason }. The page joins them with·; the terminal puts each on its own line (src/tui/screens/workspace.ts). Nothing splits a finished string any more, so a file name containing·stays whole.- The title stays short. On an over-size file the empty state's title is now
name · sizeand the reason is the note under it (src/web/pages/repo.ts), so the title fits one line on a 360px phone.
Three tests asserted that a small binary does not say the sentence, which is the choice the review rejected. I changed them to expect the sentence and Download beside the dump: test/log-tail-doors.test.ts, test/blob-binary-page.test.ts and test/fuzz-renderers.test.ts. New tests in test/render-undrawable.test.ts cover:
- a name containing
·; - the short title with the reason in the note;
- the sentence beside the hex dump.
docs/features/undrawable-file.md now describes the new behavior.
Not done here: the two follow-ups the review suggested. I didn't add a file-view page to app.looks, and undrawable.ts is still under web/render, so the terminal still imports from the web layer. Moving it alone would not fix that: it relies on kinds.ts, which also lives in web/render.
Checks: tsc, scripts/gate.ts --fix and scripts/design-lint.ts are clean. The test files that cover this change pass: 445 tests, 0 failures.
To try it: on the preview, open the blob page of a small .bin file (sentence plus hex dump) and of a markdown file over 1 MB (short title, the reason as the note, Download).
🤖 Generated with Claude Code
All three earlier asks are met. (1) A readable binary now says "The forge cannot draw this yet." beside its hex dump and Download, on the page and in the terminal; an over-size file of no known kind says it too. (2) docs/features/undrawable-file.md exists and is indexed; README is untouched. (3) The truncated assertion is now the full sentence, and the terminal has a test for the over-size unknown file and one for the small binary. undrawable() returns parts, so a name holding the separator stays whole, and the title is name · size with the reason as the note, so it holds one line on a 360px phone. The page is a plain empty state with a Download link, with no new component, accent or box, and it works with JavaScript off. Two things I would do next. Non-blocking: move undrawable.ts and kinds.ts to a neutral module so src/tui stops importing from src/web. Non-blocking: add a file-view page to app.looks so this state gets pictured.
A binary the forge doesn't recognise now shows its name, size and "The forge cannot draw this yet." with a Download button. A known kind over its size limit says that limit and why. The terminal's file view uses the same wording. I did not run the full suite;
tsc,gate.ts,design-lintand the affected test files pass (render-undrawable,blob-media-ceiling,hardening,log-tail-doors,blob-binary-page,fuzz-renderers,log-tail-view). The forge runs the full check on push.What changed
src/web/render/undrawable.tsholds the one sentence and the limit wording, so the page and the terminal cannot drift. The two sentences are:name · size · The forge cannot draw this yet.name · size · Over the 50 MB limit for image files, because the browser would have to load it whole.Non-media kinds say "because the page reads a file whole to draw it." Text over 1 MB gets the same form.blobBodyinsrc/web/pages/repo.tsuses it for unknown binaries and for over-size files. A log tail, an archive reason or a notebook or G-code note still takes precedence.test/render-undrawable.test.tshas a test per case.blob-media-ceiling,blob-binary-page,fuzz-renderers,log-tail-doors,hardening). Those tests were asserting the old text, not a behaviour.What I chose not to do
src/web/pages/media.ts; it already serves downloads at any size.Try it: open the blob page of an unknown
.binfile, or of a 3 MB.md, and read the sentence and Download button. In the terminal, open the same file in the workspace.The pre-push hook refused the push until a commit message had a
Try:line, so the commit message has one.🤖 Generated with Claude Code
Closes #14045