Skip to content

fix(ios): resolve ReadingTheme to ConcreteReadingTheme in block-model call sites - #390

Merged
github-actions[bot] merged 1 commit into
devfrom
fix/reader-view-concrete-reading-theme
Aug 21, 2026
Merged

github-actions[bot] merged 1 commit into
devfrom
fix/reader-view-concrete-reading-theme

Conversation

@libravault-xyz

Copy link
Copy Markdown
Collaborator

Summary

dev is currently broken for every iOS build. Found while trying to get a clean CI run on the unrelated #389 (CircleCI config only) and confirmed it's pre-existing on dev, not caused by that PR.

#374 ("System" reading theme) and #369 (EPUB block-model rendering) each touched ReaderView.swift independently — merged with no git conflict, but broke Swift's type checker together:

ReaderView.swift:544: error: cannot convert value of type 'ReadingTheme' to expected argument type 'ConcreteReadingTheme'
ReaderView.swift:641: error: cannot convert value of type 'ReadingTheme' to expected argument type 'ConcreteReadingTheme'

#369's two MarkdownBlockView(...) call sites (paginated content + scrolling content) pass the raw readingTheme: ReadingTheme state (which can be .system) where MarkdownBlockView expects the already-resolved ConcreteReadingTheme. #374 introduced effectiveReadingTheme (readingTheme.resolved(for: systemColorScheme)) for exactly this, and the third call site (markdownContent, line 737) already uses it correctly — the two new ones from #369 just didn't get updated to match.

Fix

Use effectiveReadingTheme at both sites, matching the existing third call site. Two-line change, no behavior change beyond making .system actually resolve instead of failing to compile.

Testing

No local Xcode available to compile-check — relying on Build & Test iOS (Simulator) CI, which is what caught this in the first place.

🤖 Generated with Claude Code

… call sites

dev is currently broken for every iOS build: #374 ("System" reading
theme) and #369 (EPUB block-model rendering) each touched ReaderView.swift
independently, merged with no git conflict, but broke Swift's type
checker together. #369's two MarkdownBlockView(...) call sites (paginated
+ scrolling content) pass the raw `readingTheme: ReadingTheme` state
(which can be .system) where MarkdownBlockView expects the already-
resolved `ConcreteReadingTheme` — exactly the case #374's own
effectiveReadingTheme computed property exists to handle, and which the
third call site (markdownContent, line 737) already uses correctly.

  ReaderView.swift:544: error: cannot convert value of type 'ReadingTheme'
  to expected argument type 'ConcreteReadingTheme'
  ReaderView.swift:641: same error

Fix: use effectiveReadingTheme (already resolved for the environment
color scheme) at both sites, matching the third call site.

No local Xcode to compile-check against — verifying via CI.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions github-actions Bot added the risk:low Principal review classified this PR as low risk label Aug 21, 2026
@libravault-pipeline-bot libravault-pipeline-bot Bot added the status:needs-review QA passed, awaiting principal-review-agent label Aug 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR was opened outside the automated pipeline (author isn't libravault-pipeline-bot[bot]) and doesn't link an issue (no Closes #N-style line in its body), so there's no acceptance criteria for qa-agent.yml to verify against — it would otherwise sit with no risk/status label and nothing downstream would pick it up (see issue #223's actual history, and issue #343 for this issue-less case specifically). This deterministic backstop (pr-intake.yml) classified its risk and applied status:needs-review to route it straight to principal review.

@github-actions

Copy link
Copy Markdown
Contributor

📱 iOS Build Status: PASSED

✅ iOS Simulator Build & Unit Tests - success
✅ Android Core Modules - success

iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those.

View run details

@github-actions

Copy link
Copy Markdown
Contributor

Principal review: auto-merge

Verified directly, not just read the diff/description:

  • Types line up: MarkdownBlockView.readingTheme is declared let readingTheme: ConcreteReadingTheme (MarkdownReaderContent.swift:192). effectiveReadingTheme (ReaderView.swift:103) is readingTheme.resolved(for: systemColorScheme) → ConcreteReadingTheme. All three MarkdownBlockView/markdownContent call sites in ReaderView.swift (lines 544, 641, 737) now consistently pass effectiveReadingTheme, matching the third site that was already correct pre-feat(ios): render EPUB via block model in ReaderView (paginated + scrolling) #369.
  • CI confirms the actual claim: waited for Build & Test iOS (Simulator) to finish rather than trusting "no local Xcode" — it went IN_PROGRESS → SUCCESS. Since this was a Swift type-checker error (cannot convert value of type 'ReadingTheme' to expected argument type 'ConcreteReadingTheme'), a green build is direct proof the fix works, not just a proxy. JVM Tests, Build Android App, and Report Build Status are also SUCCESS; iOS UI Tests (informational) is explicitly non-blocking and was still finishing.
  • Policy checks: only ios/.../ReaderView.swift touched — not in agent-policy.yml sensitive_paths. No networking dependency introduced. 4-line diff, well under the 400-line auto-merge cap. Single commit; risk:low label is fresh.
  • AGENTS.md tests-with-fix rule: no new test was added, and I considered that before waving it through. Not treating it as a CONFIRMED finding: the bug was a compile-time type mismatch, so the regression guard here is the Swift compiler itself — reverting either line fails the build immediately, which CI already gates on every future PR. The fix introduces no new runtime logic, it just re-threads an existing, already-unit-tested resolved(for:) computed property to match the pattern already used correctly at the third call site.

No CONFIRMED findings. risk:low label stands. Recommending auto-merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:low Principal review classified this PR as low risk status:approved-auto-merge Principal review passed, risk:low — will auto-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant