Skip to content

Take odrcore 6.11.0 - #185

Merged
andiwand merged 6 commits into
mainfrom
take-odrcore-7.0.0
Aug 29, 2026
Merged

Take odrcore 6.11.0#185
andiwand merged 6 commits into
mainfrom
take-odrcore-7.0.0

Conversation

@andiwand

@andiwand andiwand commented Aug 29, 2026

Copy link
Copy Markdown
Member

odrcore 6.10.1 → 6.11.0, resolved against the tag. The release went out as a minor despite carrying a breaking change.

Paired with opendocument-app/OpenDocument.droid#634.

Two workarounds come back fixed, one does not

Three were filed from #183. Two go:

filed fixed by what goes here
core#730 target="_blank" on every view core#756 the WKUIDelegate no longer has to catch served links
core#728 the text fallback core#743 the charset check in CoreWrapper.translate
core#706 / core#726 no top-level fit core#745 nothing — see below

The charset check was always a workaround for the core answering "text" to anything it did not recognise. Now decode throws and listFileTypes comes back empty, which the guard three lines above already catches — and it catches the NUL-padded binaries the charset check missed.

The link target needed new code rather than a deletion. Only external links carry target="_blank" now, so served links navigate in place and never reach createWebViewWith; what does reach it is the web, which went nowhere before and now goes to the browser.

The fit stays ours

viewportMode = .fitWidthByView was the headline of this PR and it is reverted. Driving both builds in a simulator, it makes an ODT render worse than today: the mode pins initial-scale=1.0 and leaves the fit to a script inside the view, and in WKWebView that script's zoom never lands, so the page sits at actual size with body text at ~2× and only its first third on screen.

ODT, portrait differing pixels vs the shipping build
with fitWidthByView 11.4%
with it off, nothing else changed 1.2%

So the user script stays. Filed as opendocument-app/OpenDocument.core#761 with the emitted viewport for each mode.

Worth recording from the same run: on iOS 26 WKWebView fits a top-level page by itself at load, so in portrait the script is no longer doing anything. It is still needed on rotation — without it, turning the phone leaves the document at the old scale (9% of pixels differ). That is the half fit_width_by_view was meant to take over.

Picked up from Android

The spreadsheet limits are stated rather than inherited, the same numbers as droid#623 and droid#634: 100000 × 500 with a 500000-cell budget. Without this the bump silently moves them, since core#757 raised the default from 10000 rows and added the budget.

The apple binding makes this awkward: spreadsheetLimit is a TableDimensions boxed in an NSValue, and Swift has no @encode, so the type encoding is a string literal. Filed as opendocument-app/OpenDocument.core#759.

HTML is drawn by the system again. odrcore has no html type, so an .html decoded as text and the reader showed the page's source; html, htm and xhtml were in the extension list #183 replaced with "ask the core", and nothing took over. systemDrawsItBetter already means what is wanted, so html joins iWork in it, by type. public.xhtml conforms to xml and not to html, so both types are named — xml alone would catch flat ODF, which odrcore does render.

EPS, DXF and PSD stay out of the listing, and a probe says why: a WKWebView answers canShowMIMEType false for all three (com.adobe.photoshop-image, com.adobe.encapsulated-postscript, and DXF has no declared type at all). There was never a native rendering behind those three claims.

Markdown now opens as prose. It has no signature, so odrcore reads a .md as text and only the name can say otherwise; CoreWrapper.openFile opens again as the type the name states, under droid's own rule — a document, or a format the core cannot detect from its bytes. Csv is neither and stays the core's decision. This is what a131cf3 held back, so the listing gets its markdown line.

iWork keeps the system's rendering

odrcore reads .pages, .numbers and .key since core#732/738/739, so they stop being archives and the routing from #183 — it saw a container, the system knows a document — stops firing on its own. But src/odr/internal/iwork/PLAN.md has stages 3 and 4, styles and drawables, still open, so a .pages renders body text and anchored tables only. That is less than the phone draws, so the three are named explicitly instead.

Verified

69 tests, 0 failures; ODR Full, ODR Lite and ODR Screenshots all build; format clean. CI green.

Beyond CI, both builds were driven in an iPhone 17 Pro simulator on iOS 26 and photographed portrait → landscape → portrait for the text, sheet, office and pdf screens, then diffed frame for frame against the shipping build. Sheet is identical, pdf differs by 0.8–2% (the pdf fixes), office by 0.7%. That comparison is what found the viewport regression.

Not covered: a real device, and an iPad.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y7ALzy5VB32UfQn263Tbnk

andiwand and others added 2 commits August 29, 2026 11:31
Three workarounds this app filed upstream come back fixed, and go: the
fit-to-width user script, replaced by odrcore's new viewport mode; the charset
check, now that a file which is not text no longer comes back as text; and the
handling for a blanket link target, leaving only the web to send to the browser.

States the spreadsheet limits rather than inheriting them, as OpenDocument.droid
does.

Pages, Keynote and Numbers keep the system's rendering. odrcore reads all three
now, so the routing that caught them - a container the system knows as a
document - no longer fires and they are named instead. It reads their text and
not their styles or pictures, which is less than the phone draws.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7ALzy5VB32UfQn263Tbnk
The view fits itself by applying a zoom now, and webkit leaves that out of
getBoundingClientRect while elementFromPoint expects it in - so the tap the test
aims at the middle of an editable run landed outside it and hit nothing.

odrcore 6.11.0 ships getViewportRect for this. Only the test hit-tests in
script; a real tap is webkit's own and was never affected.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7ALzy5VB32UfQn263Tbnk
@andiwand
andiwand force-pushed the take-odrcore-7.0.0 branch from 0222593 to 86a4992 Compare August 29, 2026 09:31
@andiwand andiwand changed the title Take odrcore 7.0.0 Take odrcore 6.11.0 Aug 29, 2026
@andiwand
andiwand marked this pull request as ready for review August 29, 2026 09:32
The same correction as OpenDocument.droid, minus one line.

PostScript (EPS) and AutoCAD (DXF) have never been file types odrcore has.
Photoshop (PSD) had a type but declared html output it could not produce,
and 6.11.0 stops claiming it. HTML has no type either. Four claims with
nothing behind them.

Going the other way: rtf and Apple iWork were already promised here and are
true as of this release, and flat ODF - FODT, FODS, FODP, FODG - opens like
the packaged kind, which Info.plist already declares.

Markdown is the line this listing does not get. The core opens one, but it
has no signature and only decodes when it is asked for by name, and
CoreWrapper decodes by detection alone - so a `.md` arrives here as the
plain text it also is. `decode(path:as:)` is what would change that, and
until something calls it this listing would be promising prose the app does
not render. OpenDocument.droid asks, through `nameOutranksText`, and says
markdown.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013MnPChoTUsGrb6TMMy8nc1
andiwand and others added 3 commits August 29, 2026 12:58
Two things, both found by driving the app in a simulator.

The new viewport mode goes back. It pins initial-scale=1.0 and leaves the fit to
a script inside the view, and in a WKWebView that script's zoom never lands: an
odt opened at actual size with the body text twice the size and only its first
third on screen. Photographed against the shipping build, 11.4% of pixels
differed; with the mode off, 1.2%. So the user script stays, and the mode is
opendocument-app/OpenDocument.core#761.

Markdown has no signature, so odrcore reads a .md as text and only its name can
say otherwise. Opening again as the type the name states, under the rule
OpenDocument.droid already uses: a document, or a format the core cannot detect
from its bytes. Csv is neither and stays the core's own decision.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7ALzy5VB32UfQn263Tbnk
The line a131cf3 held back. `CoreWrapper` asks by name where the bytes only say
text, so the promise is good; the wording is OpenDocument.droid's.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7ALzy5VB32UfQn263Tbnk
odrcore has no html type, so an .html decodes as text and the reader showed the
page's source. It used to be drawn: html, htm and xhtml were in the extension
list #183 replaced with "ask the core", and nothing took over.

`systemDrawsItBetter` already means what is needed here, so html joins iWork in
it, by type rather than by extension. `public.xhtml` conforms to xml and not to
html, so both types are named - xml alone would catch flat ODF, which odrcore
does render.

The listing gets HTML back with it. EPS, DXF and PSD stay out: a WKWebView
answers canShowMIMEType false for all three, so there was never a native
rendering to promise.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7ALzy5VB32UfQn263Tbnk
@andiwand
andiwand merged commit eb8006e into main Aug 29, 2026
4 checks passed
@andiwand
andiwand deleted the take-odrcore-7.0.0 branch August 29, 2026 11:53
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