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 3dfbd46
13 earlier comments · 2 events
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-lint and 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
- New
src/web/render/undrawable.tsholds the one sentence and the limit wording, so the page and the terminal cannot drift. The two sentences are:- Unknown binary:
name · size · The forge cannot draw this yet. - Over limit:
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.
- Unknown binary:
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.- The terminal's workspace view shows the same sentence as its note and puts the download line in the detail, where the model-file note already puts it.
test/render-undrawable.test.tshas a test per case.- I changed the expected wording in five existing tests (
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
- An unknown binary no longer shows its sniffed type (for example "WebAssembly module"), because the issue asked for name, size and the sentence. Archive, PSD and other binaries the forge can read keep their own notes.
- I did not change
src/web/pages/media.ts; it already serves downloads at any size. - The terminal's binary case is only covered by the shared-sentence test, not by a terminal test. The too-large terminal case is tested.
Try it: open the blob page of an unknown .bin file, 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
<!-- look-pages a39495d4d4d3 --> Look pages for a39495d, 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
A file the forge can't draw now says so in one sentence and offers the download. The page does this in src/web/pages/repo.ts through the new src/web/render/undrawable.ts. The terminal does it in src/tui/screens/workspace.ts, using the same module. Examples are a .bin file or a 3 MB .md.
The check failed on the "both doors" rule because this pull adds src/web/render/undrawable.ts without adding a new file under src/tui/screens/. The terminal door already exists in workspace.ts, so I added no screen. I pushed a commit carrying a No door: line that says so. bun scripts/gate.ts now passes with only the look-pages note, which the commit's "Looks:"/"No look:" lines can override. I didn't re-run the tests or tsc for this push, since it only adds an empty commit. The forge will re-run its check.
To try it, open the blob page of a .bin file or a 3 MB .md on the preview and read the sentence and the Download button.
<!-- look-pages e42ec848fc92 --> Look pages for e42ec84, 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
I fixed two of the four failures and pushed. I left the scaffold timing failure alone because it looks like timing noise. I didn't re-run the whole suite here, and the forge's check will re-run it on this push.
- Dangling else: in
src/tui/screens/workspace.tsI had putelseon its own line after a}. I moved it onto the same line, andtest/review-dangling-else.test.tspasses. - NUL
.logtest:test/tui-workspace-kinds.test.tsstill expected the old "Binary file" text. The terminal now says "The forge cannot draw this yet.", so I changed the test to expect that. The test was out of date, not the code. It passes. - Variants screen:
test/tui-variants.test.tspasses locally, so I changed nothing for it. It didn't fail on a rerun here, so I take it to be a flake. - Scaffold suite:
test/scaffold.test.tsran 3200 ms against its 3000 ms budget here, a margin of 200 ms. The forge's log shows it green on main. I read this as timing on a loaded machine. I didn't touch the test or the budget, and it may fail again.
bun x tsc --noEmit and bun scripts/gate.ts --fix are clean.
I merged main into the branch, resolved the five conflicts and pushed. The seven test files I ran after resolving pass, bun x tsc --noEmit is clean, and the forge will run the full check on this push.
main now shows a hex dump for any binary file nothing else opens (#13995). That replaced my "cannot draw this yet" sentence for plain binaries, and I kept main's behaviour.
My sentence now covers the case main doesn't:
- Over-size files: a file past its renderer's limit, or a too-large file of unknown kind, still says so in one sentence and offers the download. This is on the page in
src/web/pages/repo.tsand in the terminal insrc/tui/screens/workspace.ts. - Tests: I took main's version of the three conflicted test files (
test/blob-binary-page.test.ts,test/fuzz-renderers.test.ts,test/tui-workspace-kinds.test.ts). I rewrote the unknown-kind case intest/render-undrawable.test.tsto use a too-large file instead of a binary, because a plain binary now gets the hex dump.
<!-- 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