Skip to content

[leas code] Use canonical mobile diff and OSC implementations - #13433

Merged
nwparker merged 1 commit into
stablyai:mainfrom
nwparker:nwparker/leas-code-mobile-shared-implementations
Aug 10, 2026
Merged

nwparker merged 1 commit into
stablyai:mainfrom
nwparker:nwparker/leas-code-mobile-shared-implementations

Conversation

@nwparker

Copy link
Copy Markdown
Contributor

Summary

Replace the mobile copy of diff-comment formatting with the canonical shared implementation and remove the mobile OSC-link validator façade. Existing mobile formatter exports remain stable, and all terminal consumers now import the identical shared validator/type directly.

Net reduction: 49 lines across six files.

Screenshots

No visual change.

Testing

  • pnpm lint
  • pnpm --dir mobile typecheck
  • Mobile focused Vitest suite: 4 files, 33 tests
  • Canonical formatter Vitest suite: 10 tests
  • pnpm test
  • pnpm build
  • Added or updated high-quality tests that would catch regressions, or explained why tests were not needed
  • Android and iOS production Expo/Metro exports
  • pnpm run check:code-quality:changed
  • Focused oxlint, oxfmt, and git diff --check

AI Review Report

The review compared the deleted formatter and validator bodies with their shared owners, traced clipboard/prompt output and both untrusted remote oscLinks boundaries, resolved every new relative import to its target, and searched the repository for missed consumers. It found no high-, medium-, or low-severity issues. Named formatter exports, output bytes, validator acceptance rules, and missing-field fallback behavior remain unchanged.

Cross-platform review explicitly covered macOS, Linux, Windows, iOS, and Android. Production Metro exports proved the root-shared runtime imports bundle correctly. The patch changes no shortcuts, labels, OS paths, shell behavior, Electron boundary, SSH execution, folder-workspace assumption, Git command, or platform-specific branch.

Security Audit

Remote OSC-link data remains untrusted and passes through the same predicate before use; invalid input still becomes undefined. No command execution, path handling, authentication, secrets, dependencies, IPC fields, stream opcodes, or published payloads changed.

Notes

Independent cleanup based on current main. mobile/metro.config.js already watches repo-root src/shared. Expo emitted the existing unrelated @noble/hashes/crypto.js package-export fallback warning; both exports completed successfully.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5e8251d1-8017-49f1-a8f0-5935d2a00c47

📥 Commits

Reviewing files that changed from the base of the PR and between 403c60b and 837c073.

📒 Files selected for processing (6)
  • mobile/app/h/[hostId]/session/[worktreeId].tsx
  • mobile/src/session/mobile-diff-comments.ts
  • mobile/src/terminal/TerminalWebView.tsx
  • mobile/src/terminal/terminal-osc-link-ranges.ts
  • mobile/src/terminal/terminal-webview-contract.ts
  • mobile/src/terminal/terminal-webview-messages.ts
💤 Files with no reviewable changes (1)
  • mobile/src/terminal/terminal-osc-link-ranges.ts

📝 Walkthrough

Walkthrough

The mobile diff-comment module now uses shared formatting utilities and retains scope normalization. Terminal OSC link-range consumers now import shared definitions. The terminal-specific module no longer re-exports TerminalOscLinkRange or provides isTerminalOscLinkRanges.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main refactor to use canonical mobile diff and OSC implementations.
Description check ✅ Passed The description includes all required sections and clearly documents changes, testing, review, security, and platform considerations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker merged commit faaf3d2 into stablyai:main Aug 10, 2026
46 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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