Skip to content

feat(html): offer an archive's entries as files, not as one page of base64 - #671

Merged
andiwand merged 1 commit into
mainfrom
feat/html-archive-resources
Aug 9, 2026
Merged

feat(html): offer an archive's entries as files, not as one page of base64#671
andiwand merged 1 commit into
mainfrom
feat/html-archive-resources

Conversation

@andiwand

@andiwand andiwand commented Aug 9, 2026

Copy link
Copy Markdown
Member

🤖 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.odt came to a 540 KB page for 172 KB of
archive. And data: cannot be navigated to at the top level in any current
browser, so the only thing you could do with an entry was save it.

Entries are HtmlResources now, like an image in a document: the locator
decides where they go, bring_offline writes them out, and the http server
serves 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 the
output directory, or a files.html that would overwrite the listing, gets none.

HtmlResourceType gains file, appended — the bindings mirror it by ordinal.

Testing

Full suite: 818 passed, 8 skipped, no failures. html.archive_listing now
asserts no data: in the page, a link per entry, and the entry written beside
the listing. Reference output regenerated and pinned: zip/small.zip gains
hello.txt and nested/note.txt next to a listing that shrank from 889 to
864 bytes.

Rebase note

The branch was stacked on #670's pre-merge commits. It is rebased onto main
with only its own commit; the archive listing's service picked up the
resource-serving fix that landed with #670, so warmup() now covers both the
stylesheet and the entries and locate_filesystem_resources is gone.

@andiwand
andiwand force-pushed the feat/html-sheet-chrome branch 2 times, most recently from 5fb7907 to d890ced Compare August 9, 2026 12:33
Base automatically changed from feat/html-sheet-chrome to main August 9, 2026 12:53
@andiwand
andiwand force-pushed the feat/html-archive-resources branch from effb232 to 7d744dd Compare August 9, 2026 13:12
@andiwand andiwand changed the title Offer an archive's entries as files, not as one page of base64 feat(html): offer an archive's entries as files, not as one page of base64 Aug 9, 2026
@andiwand
andiwand force-pushed the feat/html-archive-resources branch from 7d744dd to 7c369c6 Compare August 9, 2026 13:17
@andiwand
andiwand marked this pull request as ready for review August 9, 2026 13:17

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/odr/html.hpp
Comment thread src/odr/internal/html/filesystem.cpp
…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
andiwand force-pushed the feat/html-archive-resources branch from 7c369c6 to 2d2bd54 Compare August 9, 2026 13:26
@andiwand
andiwand merged commit 4ac7a54 into main Aug 9, 2026
25 checks passed
@andiwand
andiwand deleted the feat/html-archive-resources branch August 9, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant