feat(html): offer an archive's entries as files, not as one page of base64 - #671
Merged
Conversation
andiwand
force-pushed
the
feat/html-sheet-chrome
branch
2 times, most recently
from
August 9, 2026 12:33
5fb7907 to
d890ced
Compare
andiwand
force-pushed
the
feat/html-archive-resources
branch
from
August 9, 2026 13:12
effb232 to
7d744dd
Compare
andiwand
force-pushed
the
feat/html-archive-resources
branch
from
August 9, 2026 13:17
7d744dd to
7c369c6
Compare
andiwand
marked this pull request as ready for review
August 9, 2026 13:17
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7c369c6ead
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…ase64 Every entry of an archive was inlined into the listing as a `data:` URL, whole, whatever the config said — a listing of `about.odt` came to 540 KB for 172 KB of archive, and a large zip produced a page no browser would want. It also left only one thing to do with an entry: save it. `data:` cannot be navigated to at the top level in any current browser, so opening one was never on offer. Entries are `HtmlResource`s now, the same as an image in a document, so the existing locator decides where they go and `bring_offline` writes them out. The listing drops to 5 KB beside the files it names, the http server serves them by path off a warmed-up render, and the entry is a real URL — which is what makes opening it possible at all. The path is the link that opens it, the way a file listing has always worked; the glyph beside it saves it. Two glyphs would have been two things to tell apart, and one of them would have had to mean "open". An embedded entry has no URL to open, so there the path is text and only the glyph remains. Directories are no longer listed. Every entry names its whole path, so a row for the directory above it repeated what the rows below it already said, and it was the one row with nothing to open, save or measure. An entry is named by the archive, and neither its name nor its path is trusted with one: a `..` that would climb out of the output directory, or a `files.html` that would be written over the listing, gets no location and stays inline. `HtmlResourceType` gains `file` — appended, since the bindings mirror it by ordinal — for a resource that is whatever the archive happened to hold. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HcgniS5pgVa4rV1yHxuKm7
andiwand
force-pushed
the
feat/html-archive-resources
branch
from
August 9, 2026 13:26
7c369c6 to
2d2bd54
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Generated with Claude Code
Every entry of an archive was base64'd into the listing as a
data:URL, whole,whatever the config said —
about.odtcame to a 540 KB page for 172 KB ofarchive. And
data:cannot be navigated to at the top level in any currentbrowser, so the only thing you could do with an entry was save it.
Entries are
HtmlResources now, like an image in a document: the locatordecides where they go,
bring_offlinewrites them out, and the http serverserves them by path off a warmed-up render. The listing drops to 5 KB beside the
files it names, and each entry is a real URL.
In the listing, the path is the link that opens the file and the glyph
beside it saves it — one glyph, since a second would have had to mean "open" and
be told apart from the first. An embedded entry has no URL to open, so there the
path is plain text.
Directories are gone. Every entry names its whole path, so a row for the
directory above it repeated what the rows below already said, and it was the one
row with nothing to open, save or measure.
Untrusted names stay inline. The archive names the entry, so neither its
name nor its path is trusted with a location: a
..that would climb out of theoutput directory, or a
files.htmlthat would overwrite the listing, gets none.HtmlResourceTypegainsfile, appended — the bindings mirror it by ordinal.Testing
Full suite: 818 passed, 8 skipped, no failures.
html.archive_listingnowasserts no
data:in the page, a link per entry, and the entry written besidethe listing. Reference output regenerated and pinned:
zip/small.zipgainshello.txtandnested/note.txtnext to a listing that shrank from 889 to864 bytes.
Rebase note
The branch was stacked on #670's pre-merge commits. It is rebased onto
mainwith only its own commit; the archive listing's service picked up the
resource-serving fix that landed with #670, so
warmup()now covers both thestylesheet and the entries and
locate_filesystem_resourcesis gone.