Skip to content

Show math-only lines whole on iPhone and draw rules in the text color - #318

Merged
max-miller1204 merged 3 commits into
mainfrom
fix/phone-math-clip-and-rule
Nov 21, 2026
Merged

max-miller1204 merged 3 commits into
mainfrom
fix/phone-math-clip-and-rule

Conversation

@max-miller1204

Copy link
Copy Markdown
Owner

What changed and why

Two phone math bugs that share the inline math code. Closes #315. Closes #317.

#315, iPhone: a line holding only inline math is cut off at the top (the choice rows "(−0.10, +0.20)" and "(+0.20, −0.10)", and the answered card's lone pair). In the #314 shots, every glyph's ink starts on the same row: 1518 px on the choice rows, 735 px in the card. Alone, the card's pair shows a 45 px parenthesis and 36 px digits; after text, the same pair is 57 px and 39 px.

Cause, in React Native 0.88.1:

  • Text defaults to overflow: 'hidden' (Libraries/Text/Text.js:546-551), so its view clips to its bounds (BaseViewProps.cpp:581-582, RCTViewComponentView.mm:443). Anything inline that lies outside the Text's frame is cut off.
  • A Text with no text has only the attachment characters, which carry no font and no paragraph style (RCTAttributedTextUtils.mm:409-419). So its lineHeight doesn't apply, and its one line is just the pictures' boxes, with the baseline at the bottom. Upstream's Position iOS inline views from their line's actual baseline (#59921) react/react-native#59921 message names the same case.
  • The view's frame still adds the attachment font's descender (RCTTextLayoutManager.mm:631), TextKit's Helvetica 12 (2.76 pt, as found in Put inline math on the text baseline on iOS #314). So the picture sits 2.76 pt above the Text's top, and that strip is cut off.
  • The math's depth hangs below the box, so below the Text, and is cut off too.

Predicted cut on the card's pair: 8.3 px at the top, and 6.2 px at the picture's bottom (about 4.7 px at the parenthesis's bottom). Measured: about 8 px and 4 px.

Fix, iOS only (MathLabel.tsx, NativeMarkdown.tsx):

  • In a Text with no text, inlineLift returns -2.76 pt, bringing each picture down onto the line.
  • depthRoom gives the Text a paddingBottom for the depth of pictures on a last line with no text. For a Text with text whose last hard line holds only math, that's the depth beyond the 2.76 pt that line already leaves.

Such rows grow by the math's depth (about 4 to 5 pt), which is what showing it whole takes. Android keeps its layout: no lift and no padding there.

#317, phone: \rule draws black. MathJax's TeX \rule fills its space with the \color in effect, or with black when there is none (mathjax-full BaseMethods.js:573,582). Black there stands for the text's colour. The readability check (inks) only looked at token glyphs, so it never saw the rule, and the black rule stayed in both themes. MathJax also marks the rule's rectangle data-bgcolor="true", like a \colorbox, so a picture drawn without its colours deleted the rule outright.

Fix (choice-math.ts, both platforms):

  • A rule with no \color in effect becomes currentColor, so it takes the text colour.
  • A rule counts as ink of its own colour in the readability check.
  • A rule's rectangle (inside an mspace group) loses its background mark, so a theme that drops colours recolours it instead of deleting it.

\colorbox backgrounds behave as before.

Verified

  • Mobile unit tests, one file at a time under a 300s cap: all 14 files pass. Each new test fails against main:
    • math-baseline.test.ts: math in a Text of its own shows whole (choice, answered card, message, and a math-only last line after text). On main the picture's top is 2.76 pt above the Text's top. Android keeps its layout.
    • choice-math.test.ts: a rule is drawn in the text colour or its own \color, flattened and unflattened. \color{black} stays black in light and is recoloured, not dropped, in dark. A rule beside an unreadable glyph is kept. \colorbox is unchanged. This fails with rulesAsInk removed.
  • npm run typecheck, npm run lint, npm run deps:check: pass.
  • Fingerprints are unchanged from main: iOS b294c68b58b762e9cac472a7ee00c0a6127b4216, Android f5bb079b3763b614ffd3e8076dcba382425718a3. JS only, so it ships as an OTA update.
  • Android: no layout change (lift and padding are iOS only); only the rule's colour changes. I took no emulator shot on this desktop; the prove check covers Android.
  • iPhone CI job: the proof is the quiz-waiting and quiz-answered shots and pairs, measured before and after.

Source

A Text holding only inline math has no text font, so React Native's iOS text
makes it one line as tall as the pictures' boxes, with its baseline at its
bottom, yet still places each view a TextKit descender higher; Text cuts off
what it holds at its frame, so the top of the math and its depth were lost.
Such pictures now come down onto the line, and the Text leaves room below its
last line for a depth that a text-less line can't hold (#315).

MathJax fills a \rule with black when no \color is in effect, and marks its
rectangle as a background box. A rule without a \color now takes the text
color, counts as ink when deciding whether a picture's colors stand out, and
is kept, recolored, when a theme draws a picture without its colors (#317).

Verified: checks
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Preview ready for 6197bec5ea86 (0.6.1-preview.20261121.231). On your server:

lh preview 318

It runs beside your server on port 3775 with fresh, empty data, and Ctrl+C stops it and deletes it. Release files. Each push builds a new one.

…ounding

A math-only Text's depth room is now added to the bottom padding its style
already has, so a table cell keeps its 4 pt. A \rule MathJax filled with black
takes the nearest \color above it, which math inside \text doesn't see while
it is parsed, and any other fill is left alone. React Native rounds an inline
view's origin to the pixel grid, so math-only pictures come down half a point
more and keep half a point more room below, and a capped lift stops half a
point under its line's top.

Verified: checks
@max-miller1204

Copy link
Copy Markdown
Owner Author

Round 1 review, addressed in 79818f9. Each fix has a test that fails on 73447c0.

Important

  1. A math-only table cell lost its padding: fixed. bottomPadding(style, room) adds the depth room to what the Text's style already gives (paddingBottom, else paddingVertical, else padding). NativeMarkdown passes [s.prose, style, extra], so a cell keeps its 4 pt. Test: | $(x)$ | text | on iOS gets padding of at least 4 + depth (on 73447c0 it got only the depth).
  2. A rule lost its inherited colour inside \text: fixed. A rule's colour now resolves from its nearest coloured ancestor, as glyphs do. Only MathJax's literal black is rewritten: to that ancestor's colour, or currentColor when there is none. Test: \textcolor{red}{x\text{$\rule{1em}{1em}$}} is red in both themes.

Nits

  • Only a literal black is rewritten. \text{\color{red}\rule[2pt]{1em}{1em}} and \mmlToken{mspace}[…,mathbackground="red"]{} stay red in both themes, both tested (on 73447c0 they went to currentColor). \color{black}\rule still resolves to its ancestor's black, and drops to currentColor where black doesn't stand out.

  • The iPhone: a line of only inline math is clipped at the top #315 test is now independent of depthRoom. It models React Native's own placement instead:

    • the box size is rounded up to the pixel grid after adding 0.01 pt (ParagraphShadowNode.cpp:121-126);
    • the box's origin is 2.76 pt above the line, rounded to the nearest pixel (:423-424);
    • Codex's case shows that rounding: -2.76 pt becomes -3.0 pt at 2x.

    The test asserts nothing is cut at 1x, 2x and 3x, for a choice, the answered card, a message pair and \rule{1em}{4em}. It failed on 73447c0 ("choice at 1x: 0.24 pt cut off at the top"). The fix leaves a 0.5 pt margin for that rounding (at most half a pixel): math-only pictures come down 3.26 pt, keep 0.5 pt more room below, and a capped lift stops 0.5 pt under its line's top.

Measured on 73447c0 (run 44908731007, iPhone 3x). Ink extents use a 200 threshold so the faint tips of thin strokes count; a whole pair after text at 16 pt has a 57 px parenthesis rising 5 px above a 39 px zero.

Spot Before (run 44889291506) After (73447c0) Whole
Choice "(−0.10, +0.20)", 14 pt: "(" / "0" 39 / 31 px, "(" level with "0" (cut) 50 / 35 px, "(" 4 px above "0", 11 px below the baseline 50 / 34, 4.4 above, 11.4 below
Answered card lone "(+0.20, −0.10)", 16 pt: "(" / "0" 45 / 36 px (cut) 57 / 40 px, "(" 5 px above "0", 12 px below the baseline 57 / 39, 5 above, 13 below
\rule colour, light / dark (0,0,0) / (0,0,0) (61,61,58) / (230,230,230) text colour (#e6e6e6 in dark)
#314 baseline pages (quiz-answered-*-1..3) light pixel-identical; dark identical, shifted 73 px by scroll

So 73447c0 already showed the pairs whole at 3x. 79818f9 adds the rounding margin for 1x and 2x and keeps the cell padding. Its run: https://github.com/max-miller1204/learnharness-nightly/actions/runs/44946965028. Fingerprints are unchanged (iOS b294c68b, Android f5bb079b).

@max-miller1204

Copy link
Copy Markdown
Owner Author

Room left around the math-only pairs on 73447c0 (run 44908731007, 3x), adding to the table in the round 1 comment. This backs the #315 model.

The choice row's borders are pixel-identical before and after: row 2 spans 1491 to 1601 px. The 16 pt checkbox (plus its 3 pt margin) sets the row's height, and the Text is shorter even with its depth room. That pins the Text's frame: its top is the row's top plus a 1 pt border plus 8 pt padding, which is 1518 px.

Choice "(−0.10, +0.20)", 14 pt Model (React Native's placement at 3x) Measured
Room above the picture origin -2.76 pt rounds to -2.667, lowered 2.76: 0.093 pt (0.28 px) ink starts at 1518, the Text's top: 0 px
Text's bottom 1518 + box 39 px (12.705 pt rounded up to the pixel) + depth padding 12.7 px = 1569.7
Room below the picture 1569.7 - (1518.28 + 50.8) = 0.6 px ink ends at 1568 (last row 1569): about 0.7 px
Before (run 44889291506) picture 2.76 pt above the Text, depth outside it "(" 39 px, level with "0": 8 px cut at the top, 4.7 at the bottom

So at 3x the pair was whole, with under a pixel to spare at each end. At 2x the same placement rounds to -3.0 pt, which would cut 0.24 pt; that's Codex's case, and the 0.5 pt margin in 79818f9 covers it. On 79818f9 the room should grow by 1.5 px at the top and 3 px at the bottom at 3x, with the row's height still set by the checkbox. I'll post that table when run 44946965028 finishes.

A \rule with no width or no height draws nothing, so it no longer counts as
ink when deciding whether a picture's colors stand out, and isn't recolored:
a \colorbox holding a strut keeps its box and its text's color again, as on
main. The test of a last line holding only math in a Text with text is back,
on its own, covering the half point left for pixel rounding there, and the
test comments name React Native's functions instead of line numbers.

Verified: checks
@max-miller1204

Copy link
Copy Markdown
Owner Author

Round 2 review, addressed in 6197bec. Each fix has a test that fails on 79818f9 or 73447c0.

  1. A zero-size strut counted as ink: fixed. drawnRule counts only an mspace with a background, a positive width, and a positive height or depth. inks skips anything else, and the recolouring only rewrites drawn rules. Test: \colorbox{yellow}{\rule{0pt}{1.2em}\color{black}{x}} keeps the yellow box and the black x on both themes, as main does (main draws yellow, black in light and dark). On 79818f9 the dark theme dropped both.
  2. The dropped case is back, as its own test. Earlier text, newline, $(+0.20, -0.10)$: the lift stays 0, and at 1x, 2x and 3x the padding holds depth - 2.76 + half a pixel. That covers the + PIXEL_ROUNDING term. On 73447c0 it fails: "after text at 1x: 0.50 pt cut off at the bottom".
  3. Comments: the test cites ParagraphShadowNode's getContentWithMeasuredAttachments and layout instead of line numbers, and the history sentence is gone.

Accepted as noted: an author's explicit mathbackground="black" on a raw mspace is treated as MathJax's default.

All 14 mobile test files pass one at a time under a cap; typecheck and lint pass. Fingerprints are unchanged: iOS b294c68b, Android f5bb079b. MathLabel.tsx and NativeMarkdown.tsx are unchanged from 79818f9, so the next iPhone run measures the same layout. I'll post its table when it finishes.

@max-miller1204

Copy link
Copy Markdown
Owner Author

Measured on 6197bec (run 44948230371, green, iPhone 3x). Ink extents use a 200 threshold, so the faint tips of thin strokes count. A whole pair after text at 16 pt has a 57 px parenthesis rising 5 px above a 39 px zero.

Spot Before (run 44889291506) 73447c0 (run 44908731007) 6197bec (run 44948230371) Whole
Choice "(−0.10, +0.20)", 14 pt: "(" / "0" 39 / 31 px, cut 50 / 35 px 50 / 35 px, "(" 4 px above "0", 11 below the baseline (dark the same) 50 / 34, 4.4 above, 11.4 below
Room above the choice pair (Text's top at 1518, row borders unchanged) cut 8 px 0 px (model 0.28) 2 px (model 1.78)
Room below the choice pair (Text's bottom 1518 + 39 + padding) cut 4.7 px 0.7 px (model 0.6) 2.7 px (model 2.1; padding now depth + 1 pt)
Answered card lone pair, 16 pt: "(" / "0" 45 / 36 px, cut 57 / 40 px 57 / 40 px light, 57 / 38 dark, "(" 4 to 5 px above "0" 57 / 39, 5 above
\rule colour, light / dark (both rules) (0,0,0) / (0,0,0) (61,61,58) / (230,230,230) (61,61,58) / (230,230,230) text: #3d3d3a / #e6e6e6
#314 baseline gap (answered card, message, explanation, choice row) 9 to 13 px low 0 / -1 px 0 / -1 px at every spot 0

The light pages 1 to 3 are pixel-identical to 73447c0 and #314's run. The dark pages and pages 4 to 6 are the same pixels, shifted by scroll and by the lone pair's room (+18 px on page 4). The math-only choice rows keep their height, because the checkbox sets it.

The table cell | $(x)$ | text | isn't in the iPhone fixture: its table has math beside text, not a math-only cell. The unit test covers that case (padding at least 4 + depth).

@max-miller1204

Copy link
Copy Markdown
Owner Author

prove-learnharness: BROKEN for 6197bec

Couldn't prove the requested 2.76 pt lift and 4 to 5 pt growth, or preservation of an author's explicit black MathML fill. The math-only table padding was checked in the native component test. Android was driven in light mode, and spoken TalkBack output remains unchecked.

Check Observation
iPhone clipping, 3× light and dark Both pairs show whole, as on the web. Choice parenthesis 40 → 51 px. Lone answer parenthesis 46 → 58 px, equal to the same pair after text.
iPhone lift and size FAIL. The lift is 3.26 pt with its rounding allowance. The lone-answer card grows by 18 px (6 pt). The choice row height stays fixed.
iPhone rule colour PASS. Both rules match text in light (#3d3d3a) and dark (#e6e6e6).
#314 and ordinary lines PASS. Baseline crops match main after scroll alignment. Ordinary repeated lines stay 109 px apart.
Android PASS in light. On Pixel 6a API 36, the waiting quiz, selected rows, answered card and inline equations match main pixel for pixel in the compared regions. The two rule rectangles alone change, from black to text colour. Their sizes and positions match.
Flattener Red, nested red, zero-size struts and the six drawing controls behave as expected in both themes. FAIL. Explicit MathML mathbackground="black" is recoloured in light too.
Mechanical and OTA PASS. 158 mobile tests across 14 files, five skill link checks and typecheck. Both platform fingerprints match main.
#319 Separately filed \fcolorbox source fallback.

Answer keys were the owner's reports #315 and #317, the paired web renders, main and #314. iPhone artifacts came from runs 44948230371 and 44907871746, with 44889291506 as a cross-check.

Receipt: .prove-it/runs/20261121T231607Z-pr318-device-81fcc1/receipt.md.

Receipt

Receipt: PR #318 mobile math

Verdict: BROKEN
Checker: fresh sub-agent, independent of the builder
Scope: merge base 9aa828ee0b7689720de9b2d5e5a90f57e4ba4e44 through 6197bec5ea86650afab7e8c802e0e07a82c00d99, compared against origin/main at cff8b0e5d275451689da3335ff4ee3d41ff46cd1. No uncommitted product changes.
Changed files: apps/mobile/src/MathLabel.tsx, apps/mobile/src/NativeMarkdown.tsx, apps/mobile/src/choice-math.ts, apps/mobile/tests/choice-math.test.ts, apps/mobile/tests/math-baseline.test.ts.
Surfaces driven: iPhone simulator captures from CI, their paired web captures, the app's flattener with both themes, and Android release APKs.
Run folders: 20261121T231421Z-pr318-plan-23b76c (scripted) and 20261121T231607Z-pr318-device-81fcc1 (this receipt and device evidence).

What the change touches

Steps

Result Check Independent observation
PASS #315, iPhone waiting quiz at 3× In light and dark, the first parenthesis went from 40 to 51 px. First zero went from 31 to 34 px in light and 31 to 35 px in dark. On main both began at y=1518. On head the parenthesis begins at 1520 and the digit at 1525/1524. The whole shape agrees with the web in both themes. The outer choice borders stayed at the same rows.
PASS #315, iPhone lone answer at 3× Parenthesis went from 46 to 58 px in both themes. First zero went from 37 to 39 px in light and 37 to 40 px in dark. After text, the same parenthesis is 58 px and the zero is 40 px in the head captures. The web answer shows the whole pair too. The lone answer is on answered page 4 in these downloads. The mixed-text answer and rules are best compared on page 6 in both themes.
FAIL #315, size and lift The lone-answer card grew from 810 to 828 px in both themes, an increase of 6 pt against the brief's approximately 4 to 5 pt. The iOS math-only transform is 3.26 pt in inlineLift, including a 0.5 pt rounding allowance, against the requested 2.76 pt. The choice's outer box is set by the checkbox and stayed the same height.
PASS (unit) Math-only table cell padding The native component test confirmed the 4 pt bottom padding is kept with additional room for math depth. The iPhone table in the artifact has prose alongside its math. It covers the original table baseline.
PASS #317, iPhone at 3× Both the rule-only line and the inline rule went from #000000 to #3d3d3a in light and #e6e6e6 in dark, equal to nearby text. The web uses the text colour in both themes. Fully opaque rule ink spans 232 px vertically on both revisions. The inline tall rule shifted by a single raster row. Nearby plain text was pixel-identical.
PASS #314 baseline and ordinary line spacing The mixed choice and answered-card digits and letters retain their relative positions. In the light mixed card, the 4 ends 1 px above prose, and 8 and 0 are level. The dark thresholds yield 1 to 2 px above, identically on main and head. Pixel comparisons of the table, message, explanation, mixed choice and sentence-ending equations with their periods match in both themes after aligning scroll and the 18 px added space. The repeated ordinary lines are 109 px apart.
PASS Flattener requested drawings, both themes Default rule becomes text colour. Explicit red is pixel-identical and nested text red now reaches the rule. The yellow box and black x with the width-zero strut are pixel-identical. The separate height-zero strut also matches. Plain colorbox, boxed, fbox, fraction, square root and overline are each pixel-identical. An explicit black rule stays black in light and uses existing contrast fallback in dark. Explicit black over yellow stays black in both.
FAIL Flattener, preserve an author's explicit black \mmlToken{mspace}[width="1em",height="1em",mathbackground="black"]{} paints black on main. Head paints it in text colour even against the light background, where black is readable. The flattener output changes from fill="black" to fill="currentColor". This is authored MathML, so the replacement is outside the brief.
PASS Android visual comparison Pixel 6a API 36, emulator-5554, existing light theme. Built and installed x86_64 release APKs from exact main and head in a disposable app package. Paired each to a fresh copy of the iPhone fixture and submitted the same two choices. The waiting and selected quiz, lone answered card and inline messages were pixel-identical in the compared regions. In the final rule message, the only differences were the two 51 × 203 px rule rectangles including their antialiased edges. Both changed from black to text colour, with unchanged geometry. Both servers stored the same choices.
PASS Tests, typecheck, shipping Head passed all 14 test files individually (158 tests) and the mobile typecheck. The maintained scripted plan also passed 158 unit tests and five link checks, then exited 4 for the manual device phase. iOS runtime b294c68b58b762e9cac472a7ee00c0a6127b4216 and Android runtime f5bb079b3763b614ffd3e8076dcba382425718a3 exactly match main. The iOS fingerprint includes 26 Expo native-module sources. The diff is JS/TS only and is OTA-compatible.
KNOWN #319 The \fcolorbox source fallback remains the separately filed issue.

Evidence

  • The head iPhone artifact is run 44948230371. Main's latest CI run, 44947374400, skipped the iPhone job. The latest successful main iPhone artifact is run 44907871746 at 9aa828ee. Run 44889291506 at 647eeb9b is the Put inline math on the text baseline on iOS #314 cross-check. That revision and main have identical phone code and fixtures.
  • iphone-evidence/ contains the full-size selected screenshots and web/phone pairs. iphone-proof.txt and iphone-baseline.txt record the pixel windows, measured ink heights and baseline comparisons. Thresholds were RGB mean below 110 for light and above 120 for dark. Different edge-coverage thresholds can move extents by a pixel, consistent with the PR's reported 50/57 px.
  • flattener.png is the rendered head/main comparison. flattener-pixels/ renders each output at the same fixed origin for exact pixel comparisons. flattener-comparison.txt, flatten-*.json and authored-black-*.json contain the raw comparisons.
  • unit/, unit-summary.txt, typecheck.log and {main,head}-{ios,android}.json hold the mechanical results.

Android setup and evidence

  • Both release builds used Android x86_64 and version 0.1.0 (code 1). Generated Android files gave the test app an isolated package ID, restricted a temporary CA to the emulator host gateway, and disabled OTA checking so the installed JavaScript stayed fixed to each checkout. The fingerprint checks ran on the original app configuration.
  • Both disposable servers ran the same head standalone build with fresh copies of the iPhone quiz and lesson fixtures. The fixture uses one fake-model rule to supply the tall-rule reply after quiz submission. The TLS endpoint was reached via the emulator host gateway.
  • The window dump showed no not-responding dialog and the activity service reported no ANR since boot. Available memory stayed above the recipe’s 6 GiB floor at the build and boot checks.
  • android/ contains the captures, observed UI labels, APK metadata and answer records. android-comparison.txt contains the pixel diffs. The before and restored IME diagnostics match.

Probes

  • [PASS] Compared a width-zero rule inside a coloured box with a black glyph. Probed zero height as well. Both stayed pixel-identical in both themes.
  • [FAIL] Authored black mspace recolours in light and dark, although only MathJax's own default was authorised to change.

Retries and fixes

  • The device hub's first discovery returned "The device hub did not answer within 40 seconds." The bounded adb probe hung. The recipe's start-server retry and another device discovery restored the list.
  • The latest main workflow had no phone artifact because its iPhone job was skipped. Downloaded the latest successful iPhone job on main and verified the named Put inline math on the text baseline on iOS #314 artifact as a cross-check.
  • Used answer sheet page 4 for the lone pair after inspecting page 5. The matched mixed answer and rule panels are on page 6 of head and main.

Not covered

  • The iPhone simulator fixture has no math-only table cell. The table padding result is from the native component test.
  • Physical iPhone VoiceOver and TestFlight/store installation were outside the CI screenshot and local rendering drive.
  • Android was driven in its original light theme. Both Android colours are covered through the shared flattener, with the dark on-device comparison available on a repeat run. The TalkBack recipe uses emulator-console hardware gestures. This run was limited to the requested agent-device input, so Android spoken output was not checked.

Left behind

  • Stopped the emulator, the two disposable servers and their fake-model and TLS processes. Removed the isolated app and its paired data. Read back Gboard as the selected keyboard and disabled the test input method. Kept the temp APKs and screenshots as local evidence.

@max-miller1204
max-miller1204 merged commit 09b53a6 into main Nov 21, 2026
13 checks passed
@max-miller1204
max-miller1204 deleted the fix/phone-math-clip-and-rule branch November 21, 2026 23:33
max-miller1204 added a commit that referenced this pull request Nov 21, 2026
Brings main's phone math fix (#318, apps/mobile only) into the 0.7.0
sync. No conflicts.

Verified: checks
max-miller1204 added a commit that referenced this pull request Nov 22, 2026
The phone now draws `\fcolorbox` as a box with a thin border instead of showing its TeX source. The markup allowlist stays strict: it accepts exactly one style form, `border: <number><px|em|ex> solid <colour>`, only on MathJax's mpadded node, capped at 200 characters and parsed without backtracking. MathJax's border polygons are rewritten as paths from strictly parsed, finite points. Border colours go through one parser, which accepts known names, 3- or 6-digit hex, or an rgb() triple of 0 to 255; anything else, including none, transparent and Object keys like constructor, shows as source. The #318 readability rule covers the border too, and can now measure rgb() colours. Every kept fill and stroke is written in its normalised form, which also fixes padded and mixed-case names (`\color{Navy}`, `\color{red }`) that React Native couldn't draw. The border is KaTeX's 0.04em, matching the web. The spec (mobile-quiz-choice-math.md) describes the allowance. That's an orchestrator decision under the owner's autonomy instruction.

Reviews: two rounds with Claude and Codex. Round 1: rgb() with spaces, loose colour grammar, contrast for rgb(), strict points. Round 2: a cubic-backtracking freeze, untrimmed colours drawn invisibly, and Object.prototype names as colours. All fixed.

Prove (fresh Claude checker on the Android emulator, head and base APKs, web KaTeX beside it): new boxes PASS in light and dark. Inputs that must stay source PASS, with the 5,000-space input staying responsive and no ANR. Existing colour commands are the same as base or better. TalkBack reads quiz math as one stop per row with no raw TeX. The same run also drove #334's tool steps (on a local merge with main) and #339's braces and bars on Android, which pass. One FAIL is on main already: `\xrightarrow{f}` draws short; it's filed separately.

Closes #319

Verified: prove
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.

Phone: math \rule draws black instead of the text colour (invisible in dark mode) iPhone: a line of only inline math is clipped at the top

1 participant