Public: anyone can read this; the crew can change it.
Three more file kinds open readable: .ini/.properties, .rtf and .xml #14077
.ini, .properties, .rtf and .xml files now open as drawn views instead of raw source, and the branch is pushed. Checks: tsc, gate --fix and design-lint are clean. 40 test files that touch the file-kind registry pass (456 pass, 1 skip, 0 fail), including the new test/render-ini-rtf-xml.test.ts.
stopped closed without shipping deploy ca7db09
2 earlier comments
.ini, .properties, .rtf and .xml files now open as drawn views instead of raw source, and the branch is pushed.
Checks:
tsc,gate --fixanddesign-lintare clean.- 40 test files that touch the file-kind registry pass (456 pass, 1 skip, 0 fail), including the new
test/render-ini-rtf-xml.test.ts. - I did not run the whole suite.
scripts/fast.tsfound the diff too broad to name tests. - I did not start the app and look at a page, so none of the three views has been viewed in a browser.
What each shows:
.ini/.properties: one table per[section]with a row per key. A value is shown as•••when its key ends in key, secret, token or password. Capped at 500 settings, and over 1 MB it opens as text..confstays a config file..rtf: the text as paragraphs, with formatting dropped and font tables, pictures and other embedded parts skipped. Capped at 100,000 characters, and over 5 MB it opens as text. A.rtfthat doesn't start with{\rtfis treated as plain text..xml: the element tree with attributes and leaf text. Entities are never expanded and the doctype is skipped. Capped at 1,000 elements and 24 levels, and over 5 MB it opens as text. JUnit, OPML and feed.xmlfiles keep their own views.
What changed in the code:
- Renderers:
src/web/render/ini.ts,rtf.tsandxml.tsare new, registered inrenderers.ts. - Kinds:
kinds.tshas three new kinds, and.inimoved fromconfigto the newinikind. - Media types: the media route still serves all three as
application/octet-stream, so the allowlist is unchanged. - Docs: I added
docs/features/file-ini-rtf-xml.md, a link to it inREADME.md, and regenerated thefile-kinds.mdguide. - Test fix: I changed the
.inirow intest/render-kinds.test.tsfromconfigtoini, since the test was wrong once.inimoved.
Tests: there are 15 tests in the new file. Each renderer has a hostile sample that must come out escaped, and the registry test covers a file whose bytes disagree with its name.
Left out: the terminal (src/tui) still shows these three as source. There are no new dependencies.
To try: commit an .ini, .properties, .rtf or .xml file to a repository and open it. ?view=source still shows the raw text.
The pre-push hook refused the first push because no commit message carried a Try: line. The second commit, an empty one, adds it.
🤖 Generated with Claude Code
Left #14044 open: 4 unticked items remain (each kind has a renderer in the pattern of src/web/render/mbox.ts (plain data in, escaped html out); kinds.ts media types stay on the allowlist; a file whose bytes disagree with its name stays octet-stream; a sample of each in test/render-ini-rtf-xml.test.ts, with a hostile sample that must be escaped; …).
.ini,.properties,.rtfand.xmlfiles now open as drawn views instead of raw source, and the branch is pushed.Checks:
tsc,gate --fixanddesign-lintare clean.test/render-ini-rtf-xml.test.ts.scripts/fast.tsfound the diff too broad to name tests.What each shows:
.ini/.properties: one table per[section]with a row per key. A value is shown as•••when its key ends in key, secret, token or password. Capped at 500 settings, and over 1 MB it opens as text..confstays a config file..rtf: the text as paragraphs, with formatting dropped and font tables, pictures and other embedded parts skipped. Capped at 100,000 characters, and over 5 MB it opens as text. A.rtfthat doesn't start with{\rtfis treated as plain text..xml: the element tree with attributes and leaf text. Entities are never expanded and the doctype is skipped. Capped at 1,000 elements and 24 levels, and over 5 MB it opens as text. JUnit, OPML and feed.xmlfiles keep their own views.What changed in the code:
src/web/render/ini.ts,rtf.tsandxml.tsare new, registered inrenderers.ts.kinds.tshas three new kinds, and.inimoved fromconfigto the newinikind.application/octet-stream, so the allowlist is unchanged.docs/features/file-ini-rtf-xml.md, a link to it inREADME.md, and regenerated thefile-kinds.mdguide..inirow intest/render-kinds.test.tsfromconfigtoini, since the test was wrong once.inimoved.Tests: there are 15 tests in the new file. Each renderer has a hostile sample that must come out escaped, and the registry test covers a file whose bytes disagree with its name.
Left out: the terminal (
src/tui) still shows these three as source. There are no new dependencies.To try: commit an
.ini,.properties,.rtfor.xmlfile to a repository and open it.?view=sourcestill shows the raw text.The pre-push hook refused the first push because no commit message carried a
Try:line. The second commit, an empty one, adds it.🤖 Generated with Claude Code
Closes #14044