Skip to content

fix(mobile): the first of two identically labeled PR checkboxes can be toggled - #43406

Open
saphid wants to merge 3 commits into
pingdotgg:mainfrom
saphid:hunter/c-ed7c67bb7b
Open

saphid wants to merge 3 commits into
pingdotgg:mainfrom
saphid:hunter/c-ed7c67bb7b

Conversation

@saphid

@saphid saphid commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Problem

Tapping the first of two identically labeled unchecked tasks in a mobile PR description reverts when a code block separates the tasks. The matcher invents possible index restarts, although the bundled native renderers keep task indices across views.

Deterministic repro on origin/main (0df79074ad5f21478b616fe812746c0896ec90d7) — run from the repository root after vp i:

node --input-type=module <<'NODE'
import { markdownTaskMarkerOffset } from './packages/shared/src/markdownTaskList.ts';
import { splitPullRequestBody } from './packages/client-runtime/src/pullRequestMarkdown.ts';
const md = '- [ ] Same\n\n```txt\nx\n```\n\n- [ ] Same';
const segments = splitPullRequestBody(md, () => []);
console.log(JSON.stringify(segments));
console.log(JSON.stringify(segments.flatMap(segment => segment.kind === 'markdown' ? [0, 1].map(index => markdownTaskMarkerOffset(segment.text, index, 'Same', true)) : [])));
NODE

Observed: one markdown segment, then [null,28]. Expected: the same segment, then [2,28]; index 0 must resolve to the first marker so its tap can be saved.

Change

Match only the task at the native document index within the supplied markdown segment, retaining checked-state, rendered-label, and attachment guards. Both iOS and Android use this shared matcher; update existing tests that assumed native indices restarted after code blocks and quotes. Web and desktop use a different checkbox path and need no change; no contracts, providers, connection modes, or UI copy change.

Scope

Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.

Verification

  • The focused regression failed against the unmodified base implementation: AssertionError: expected [ null, 28 ] to deeply equal [ 2, 28 ].
  • vp test run packages/shared/src/markdownTaskList.test.ts: all 5 tests pass in 3 consecutive head runs, covering duplicate labels, nested and quoted tasks, fenced look-alikes, hard breaks, stale indices/state, and attachments.
  • vp run check:changed: exit 0.
  • Before/after runtime transcript: the real PR body splitter supplies one markdown segment; the matcher changes from [null,28] to [2,28].
  • Verified the document-global index in the bundled native iOS SegmentRenderer.m and Android RenderedSegment.kt.

Not shown:

  • Native iOS/Android taps, screenshots, and layout inspection: Device access is disabled in this environment.
  • A real GitHub PR description save, desktop/web interaction, and remote/tunnel sessions.

Authored by GPT-6.1 Sol (Codex); reviewed by Gemini 4 Neon (Antigravity).

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 26, 2026
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Task marker lookup now checks the task at the supplied document-wide index. It returns the marker offset only when the task’s checked state and rendered text match the supplied values.

Changes: Task marker matching

Layer / File(s) Summary
Document-index task lookup
packages/shared/src/markdownTaskList.ts, packages/shared/src/markdownTaskList.test.ts
The lookup selects the task at the supplied index and checks its state and rendered text. Tests use document indices for quoted, wrapped, and repeated-label tasks, and cover mismatched values and attachment labels.

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

Change: Bug fix

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · up to f683d

This change makes task checkbox taps in mobile PR descriptions hit the correct item when identical tasks are separated by a code block. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the mobile fix: the first of two identically labeled PR checkboxes can be toggled. The changeset makes markdownTaskMarkerOffset match only the task at the native document index, which …
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the bug and a deterministic repro with expected and observed output. The Chang…
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.
Full details: Title check

Explanation

The title names the mobile fix: the first of two identically labeled PR checkboxes can be toggled. The changeset makes markdownTaskMarkerOffset match only the task at the native document index, which addresses that bug. The title is specific and matches the main change. Its wording is long (78 characters) but the scope is clear.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the bug and a deterministic repro with expected and observed output. The Change section explains the matcher fix and the iOS/Android and web/desktop scope. The Scope section states why no issue is needed. The Verification section lists focused test runs, a failing-before result, a check run, and a runtime transcript. It also states what was not verified (native device taps, screenshots, real GitHub save, desktop/web interaction). The template's optional agent-model line is filled in. Screenshots are not included, but the PR states that device access was unavailable, and the change has no visible UI effect, so the template's before/after screenshot requirement does not clearly apply. The description is complete enough to pass.

Finishing Touches

Generate unit tests (beta)

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

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5305564 and f683d03.

Files selected for processing: 2

  • packages/shared/src/markdownTaskList.test.ts
  • packages/shared/src/markdownTaskList.ts

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

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 26, 2026
juliusmarminge and others added 2 commits November 26, 2026 11:04
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The native renderers number tasks across the whole document, so the
index names one task; check that task's state and text instead of
filtering every task. Drop assertions the cross-block case now covers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

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

Labels

size:S 10-29 changed lines (additions + deletions). takeover:in-progress A takeover lead is working on this PR vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants