Skip to content

Move the Markdown engine into the repository and fix two Android list layouts - #10499

Merged
boudra merged 5 commits into
mainfrom
vendor-react-native-enriched-markdown
Nov 23, 2026
Merged

boudra merged 5 commits into
mainfrom
vendor-react-native-enriched-markdown

Conversation

@boudra

@boudra boudra commented Nov 22, 2026

Copy link
Copy Markdown
Collaborator

Linked issue

Refs #7240: this moves the engine into the repository. The engine rework that issue describes is still to do.

Type of change

  • Bug fix
  • New feature
  • Enhancement
  • Refactor
  • Docs

Reasoning

Three open PRs (#9964, #10380, #9429) and several contributor PRs each grow the same 1.17 MB patch-package patch for react-native-enriched-markdown. You can't review a patch to a patch, and two PRs that touch it always conflict, even when they change different files. This PR moves the library into the repository as a private workspace, packages/react-native-enriched-markdown. After this, a Markdown engine fix is a normal source diff.

Users get the two Android fixes from #9964 and #10380:

  • A numbered list inside a bulleted item no longer draws its numbers over the item text.
  • An assistant reply with quotes inside a list no longer overlaps its footer and the next message.

Nothing else changes for users.

Goals

  • Commit 1 is the exact npm package 1.2.0-nightly-20261014-766fc0e67 with the existing patch applied, byte for byte. You can check it with the steps in its commit message.
  • The app, Metro, Vitest, TypeScript, Gradle (:react-native-enriched-markdown) and CocoaPods resolve the same package name from the workspace. Only one copy is installed.
  • The package is never published. It is "private": true and is not in PUBLISH_WORKSPACES. Its version follows the root version like every other workspace.
  • fix(app): keep numbered sub-list markers off their text on Android #9964 and Keep Android assistant replies from overlapping the next message #10380 land as separate commits. Each one equals its PR's patch applied to the pristine package.
  • Format, lint and knip skip the vendored code. CI routes changes to it through the app and browser suites.

Non-goals

Commits

  1. chore(app): vendor react-native-enriched-markdown with the Paseo patch applied: a verbatim copy, 906 files, inert by itself.
  2. chore(app): consume react-native-enriched-markdown from its workspace:
    • Workspace wiring: package.json for the package, root and app; the lockfile drops the nested registry copy.
    • Deletes the patch and its postinstall-patches.mjs entry.
    • Adds ignore rules, CI path routing and docs.
  3. fix(app): keep numbered sub-list markers off their text on Android: fix(app): keep numbered sub-list markers off their text on Android #9964.
  4. fix(app): keep Android assistant replies inside their turns: Keep Android assistant replies from overlapping the next message #10380. It shares only ListRenderer.kt with fix(app): keep numbered sub-list markers off their text on Android #9964, and the hunks don't overlap.
  5. chore(app): match the vendored Markdown web block renderer source to its build: the old patch changed lib/.../BlockRenderers.js (the renderers.codeBlock override and the image zoom-in cursor) but not its src. This ports both changes to src. The app runs lib, so runtime behavior is unchanged.

Supersedes

Other open PRs that edit the patch need to move their hunks into packages/react-native-enriched-markdown after this merges: #9429, #9319, #10257, #9880 and #9587.

QA

Run locally on Linux at b5913fd2a:

  • Commit 1 is pristine plus the patch. The npm tarball with the old patch applied (git apply) equals commit 1's tree byte for byte, file modes included.
  • fix(app): keep numbered sub-list markers off their text on Android #9964 and Keep Android assistant replies from overlapping the next message #10380. Each PR's patch applied to the pristine package equals the tree after commits 3 and 4. Both PRs were based on the same patch as main.
  • Install. npm install creates one node_modules/react-native-enriched-markdown symlink to the workspace and leaves the lockfile unchanged. The package postinstall downloads the grammars into the ignored directories.
  • Checks. npm run build:app-deps, npm run typecheck, npm run lint (0 errors) and npm run format:check pass.
  • Script tests. node --test scripts/*.test.mjs: the codegen tests pass for iOS and Android, and ci-workflow.test.mjs passes 29/29. merge-mac-manifest, stamp-rollout and validate-desktop-manifests fail the same way on main; they are Vitest files.
  • App tests. The Markdown unit tests (4 files, 241 tests) and the browser tests renderers.web.browser.test.tsx and assistant selection copy (66 tests) pass.
  • Android. npm run test:android --workspace=@getpaseo/app builds :react-native-enriched-markdown from the workspace through autolinking and passes 26 Robolectric tests: InlineCodeFormattingTest 3, ListRenderingTest 18, TaskListInteractionTest 3, ListBlockquoteMeasurementTest 2.

Not run: an iOS build (CocoaPods/Xcode), an EAS build, a device or simulator pass, and the Nix desktop build.

Risk surface

  • Native resolution (not tested on iOS):
    • The library now builds from packages/react-native-enriched-markdown through the root node_modules symlink. It used to build from packages/app/node_modules.
    • Android autolinking and Gradle were exercised by test:android. CocoaPods and an EAS build were not run.
    • The podspec and build.gradle read the app's enriched-markdown block from packages/app/package.json as before.
    • Upstream's build scripts detect upstream's own monorepo by packages/core and a root vendor/. Neither path exists here, and the doc says not to add them.
  • Install:
    • npm install runs the package's postinstall, which downloads the tree-sitter grammars into gitignored cpp/highlight/vendor/{grammars,tree-sitter}. The npm package did the same download before.
    • nix/npm-deps.hash is not updated here. The lockfile no longer fetches the registry tarball, so the nix-update-hash bot refreshes the hash on main.
  • Release: the package is private. sync-workspace-versions and npm version now bump its version with the others, so it starts at 0.17.1. PUBLISH_WORKSPACES and release:check are unchanged.

…h applied

Copy react-native-enriched-markdown@1.2.0-nightly-20261014-766fc0e67 (upstream
software-mansion/enriched-markdown 766fc0e67) into
packages/react-native-enriched-markdown, with
patches/react-native-enriched-markdown+1.2.0-nightly-20261014-766fc0e67.patch
applied. Nothing else changes in this commit; the package is not a workspace yet.

Reproduce:

  npm pack react-native-enriched-markdown@1.2.0-nightly-20261014-766fc0e67
  tar xzf react-native-enriched-markdown-*.tgz
  mkdir -p t/node_modules && mv package t/node_modules/react-native-enriched-markdown
  (cd t && git init -q && git apply ../patches/react-native-enriched-markdown+*.patch)
  diff -r t/node_modules/react-native-enriched-markdown packages/react-native-enriched-markdown

The diff is empty.
Make packages/react-native-enriched-markdown a private workspace and point the
app at it, then remove the patch-package patch it replaces.

- package.json: private, version follows the root like every workspace, only the
  postinstall script that downloads tree-sitter grammars. Upstream's
  devDependencies would install a second react-native, so they are gone.
- The package keeps its name, so autolinking, the Gradle project
  :react-native-enriched-markdown, the CocoaPods spec and imports are unchanged.
- Lockfile: drop the nested registry copy under packages/app/node_modules; npm
  links node_modules/react-native-enriched-markdown to the workspace.
- Formatting, lint and knip skip the vendored code. CI routes changes to it
  through the app and browser suites.
- The codegen test checks the vendored package's generated props.
- docs/markdown-renderer.md describes the fork and how to edit it.
From #9964, moved from the package patch into the vendored package.

On Android, a numbered list nested in a bulleted item drew "1." over
the first letters of each item. A nested item's text indent summed the
root list's narrow bullet column with a fixed marginLeft, while its
marker was right-aligned to its own wider "99." column, so the number
landed on the text. iOS already indents from the item's own column.

Backport the Android hunks of upstream enriched-markdown #1015 (size
the number column to the widest marker) and #1023 (nested items start
their text from their own marker column).

test:android now also runs the backported ListRenderingTest and
TaskListInteractionTest suites. docs/markdown-renderer.md lists the
fork's backports, this one and #924, which the removed postinstall
comment used to track.

The vendored tree equals the #9964 patch applied to the pristine
package.
From #10380, moved from the package patch into the vendored package.

On Android, an assistant reply with blockquotes nested inside a list
could overlap its "Worked for ..." footer and the next user message:
the displayed text and the layout measurement applied spans in
different orders, and the list-wide line height inflated the blockquote
spacers when it ran after them.

Use the same span order for Android Markdown measurement and display.
Apply list line height before blockquote spacers so nested quotes keep
their configured padding and the reply fits above the turn footer.

test:android now also runs ListBlockquoteMeasurementTest.

Applied on top of #9964; the two changes share only ListRenderer.kt,
where #10380's import and line-height call sit beside #9964's marker
width code. Every other file equals the #10380 patch applied to the
pristine package.
…its build

The package patch changed lib/module/web/renderers/BlockRenderers.js (the
renderers.codeBlock override and the zoom-in cursor on images) but not
src/web/renderers/BlockRenderers.tsx. The app runs lib, so behavior does
not change. Port both changes into src so src stays the source of lib.
@paseo-bot

paseo-bot Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Confidence 4/5

The first commit matches the patched npm package, and both Android fixes carry over from their prior patches.

What changes

Android readers get readable list markers and chat replies where nested Markdown previously overlapped.

  • ⚠️ This revision changes the npm dependencies that Nix caches, so a direct Nix build needs the hash that the post-merge workflow refreshes.
  • Nested Android list items use their own marker width, and ordered lists reserve more space for numbers of 100 or higher.
  • Android chat replies with quotes inside lists reserve room above the turn footer and the next message.
  • The app installs the Markdown engine from a private workspace in place of the registry package and its install-time patch.
  • The local Android test command now checks list layout, task markers, and nested quotes.

Size

+87,286/−8 production · +1,649/−4 tests and fixtures · +32,685/−0 generated output · +922/−4 manifests and configuration · +339/−12 docs and licenses · +21/−18 lockfile · +0/−3,998 replaced patch

  • The import accounts for most of the diff and gives future Markdown fixes regular source diffs.
  • Keeping the existing build output avoids adding a generator to CI and requires web edits to keep source and output in sync.
What I verified
  • I reproduced the baseline from the npm tarball and old patch. File contents and executable bits match. I compared both imported fixes against their patches and inspected the combined changes in the one shared file.
  • A clean npm ci installed one workspace copy and downloaded the grammars. Expo autolinking found the workspace for iOS and Android.
  • I ran the CI routing and native codegen checks (38 tests) and three focused Markdown and selection-copy suites (268 tests). All passed.
  • Metro exported the web app, and all 26 Android Markdown Robolectric tests passed against the workspace.
  • The earlier PRs report emulator checks for nested list markers and reply overlap.
  • CocoaPods compilation, EAS, device rendering, and Nix packaging remain unverified in this review.

Reviews (1) · Last reviewed commit: b5913fd2a · Reviewed by Paseo

@boudra
boudra merged commit 80c4432 into main Nov 23, 2026
22 checks passed
@boudra
boudra deleted the vendor-react-native-enriched-markdown branch November 23, 2026 03:15
@paseo-bot paseo-bot Bot added the community-notified Merged work has been communicated to the people who reported or discussed it label Nov 23, 2026
camerontaylor added a commit to camerontaylor/paseo that referenced this pull request Nov 25, 2026
Merge upstream v0.17.4 (2b3559b) into custom. Resolve against
v0.17.0-beta.1, which custom already contains, because the release
branch does not carry it and Git picked the 0.16.2 merge base.

Graft upstream deferred ACP turns (getpaseo#10310) onto the fork's prompt lane,
shared and vendor turns, steering and detach, with every local terminal
deduplicated. Adopt agent queue, steer and interrupt (getpaseo#10483) while
keeping the fork's skill and expected-turn steer guards. Port provider
accounts onto the new provider pages (getpaseo#9661). Move the Android table and
text selection change into the vendored enriched-markdown engine
(getpaseo#10499), which replaces the patch file. Regenerate the lockfile and Nix
dependency hash. Per-file decisions are in fork/CHANGELOG.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-notified Merged work has been communicated to the people who reported or discussed it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant