Skip to content

fix: clear removed decorations on Android and iOS - #34

Merged
SectionTN merged 1 commit into
mainfrom
fix/native-decorations-clear
Nov 18, 2026
Merged

SectionTN merged 1 commit into
mainfrom
fix/native-decorations-clear

Conversation

@SectionTN

@SectionTN SectionTN commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

on Android and iOS, removing the decorations prop sent an empty list with whatever decorationsRevision the app still passed. once that revision was older than the 256 edits the editor keeps, the native view ignored the list and the old underlines, gaps and backgrounds stayed on screen. a removed prop now clears for the current text, like the web does since #26.

Removing the decorations prop sent an empty set with the revision still in
decorationsRevision. Once that revision fell out of the 256-edit log, the
native view ignored the set and the old marks and gaps stayed. A removed prop
now clears at the current revision, as on the web.
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

When decorations is absent, CodeEditor now sends decorationsRevision as -1. A regression test checks that removing decorations clears the host decorations array, even when the revision remains unchanged.

Changes: Decoration clearing

Layer / File(s) Summary
Reset revision when decorations are removed
src/CodeEditor.tsx, src/__tests__/CodeEditor.test.tsx
CodeEditor sends revision -1 when decorations is absent. The test removes decorations at revision 3 and checks that the host array is empty and the revision is -1.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Merge Risk: Minimal · up to 60150

Removing the decorations prop now clears underlines, gaps and backgrounds on Android and iOS, even when the revision number has not changed. No remaining merge-blocking risk was found, and a regression test covers the removal case.

Security architecture risk: Minimal · up to 60150

This narrowly scoped correction uses the existing current-text convention when removing decorations. No material security, failure-containment, or ownership regression was identified in the inspected paths.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed behavior is confined to clearing the receiving editor's decoration state. It does not expand the native methods exposed to callers or alter revision handling for a supplied decoration array.

Trust Boundaries and Controls

  • inferred — The bypassed stale-revision check protects edit-coordinate mapping, not caller authorization. Current-text handling was already available through the default -1 revision; this change selects it automatically for an empty clear rather than granting a new capability over nonempty decoration data.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix: clear removed decorations on Android and iOS" matches the main change. The PR stops sending a stale decorationsRevision when decorations is removed. It sends the empty set at revision …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "fix: clear removed decorations on Android and iOS" matches the main change. The PR stops sending a stale decorationsRevision when decorations is removed. It sends the empty set at revision -1, so the native view on Android and iOS clears old underlines, gaps, and backgrounds. The summary covers CodeEditor.tsx and its new test, which both support this behavior. The title names the platforms, but the web wrapper fix in the same PR is not mentioned. That is a minor omission and does not make the title misleading.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 192b32a2-5782-4a92-a4cf-3705c62afeff
Commits

Reviewing files that changed from the base of the PR and between bb5bb38 and 6015091.

Files selected for processing: 2

  • src/CodeEditor.tsx
  • src/__tests__/CodeEditor.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@SectionTN
SectionTN merged commit 6015091 into main Nov 18, 2026
10 checks passed
@SectionTN
SectionTN deleted the fix/native-decorations-clear branch November 18, 2026 15:25
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