Skip to content

feat(orcad): ship the mobile web page so phones paired to orcad get it - #29882

Merged
Jinwoo-H merged 4 commits into
mainfrom
jinwoo/orcad-ships-mobile-web
Oct 17, 2026
Merged

Jinwoo-H merged 4 commits into
mainfrom
jinwoo/orcad-ships-mobile-web

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​258 $\color{#cf222e}{\Huge{\mathbf{−}}}$​40 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​218
Prod 18 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​247 $\color{#cf222e}{\Huge{\mathbf{−}}}$​32 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​215

What was missing

orcad packages never carried the mobile web page (out/mobile-web). So an orcad server did not advertise mobileWeb.bundle.v1, answered mobileWeb.bundle.manifest with mobile_web_bundle_unavailable, and phones paired directly to it (orca serve --mobile-pairing on orcad, managed SSH servers, WSL, local serve) got the app's old built-in screens instead of the page. This blocks deleting that native fallback later.

What changed

  • src/shared/orcad-artifacts.ts: out/mobile-web/manifest.json is a required orcad artifact. The page's content-addressed assets join the hashed artifact list from that manifest (orcadMobileWebAssetFilenames), so orcadArtifactFilenames and orcadTemplateCommonFilenames now take that asset list. The page is a common template file (one copy for all targets).
  • config/scripts/orcad-mobile-web-bundle.mjs: build-orcad copies the built page tree after assertMobileWebBundleBuilt (the same guard electron-builder's beforePack uses, which also refuses unlisted files). A missing or stale out/mobile-web fails the build.
  • Template build and verify-packaged-orcad-template.cjs pin the template's common inventory to the page manifest and checksum every asset. The materializer reads the asset names from the template manifest (no extra file read on the WSL trusted-record path) and verifies each against its digest. Install identity (readOrcadArtifactIdentity, computeOrcadFullVersion) hashes every asset.
  • No resolver change: orcad's appPath is its slot root, and getBundledMobileWebBundleRoot already probes <appPath>/out/mobile-web.
  • CI: lanes that build orcad get the page first through a new build-mobile-web-bundle composite action (which uses install-mobile-dependencies and its lockfile drift guard). In node-server-tests.yml a new mobile_web_bundle job builds it once; the glibc 2.28 and Alpine container lanes and the release template job download that artifact, so the shipped template carries the page the lanes tested. In e2e.yml the shared build job builds it into e2e-build-out. The PR orcad smoke builds it only when its own scope step says the smoke runs. The Windows SSH hosts sparse checkout now includes mobile/.

Why this design

It reuses the built page, the existing packaging guard, and the existing resolver path. The asset list comes from the page's own manifest rather than a fixed list, because asset names change every build, and every asset stays under the same per-file sha256 checks as the rest of the artifact set.

Size

The page is about 8.4 MB raw (130 assets). It adds that once to the desktop's orcad template (common files, not per target) and to each materialized slot and SSH/WSL upload. A local single-target template went to 35 MB with the page included.

Known follow-up, not in this PR: the desktop installer now carries the page twice (in the app and in the orcad template). In a release those two copies can also differ byte for byte, since esbuild chunk hashes depend on the build path, so deduping them would also give desktop and orcad hosts one buildId.

Mixed versions

No wire change: the capability and RPCs already exist and old phones already handle them from desktop hosts. Older orcad servers keep serving no page, and newer phones handle that as they do now. The SSH install dir is keyed by the content hash, which now includes the page, so an updated desktop installs a fresh dir instead of reusing an older one.

Testing

  • Unit/contract: artifact list and manifest parsing, build guard (missing, stale, missing asset), template verifier (changed asset, inventory drift), materializer (page copied and checksum-verified), install identity, preflight refuses a missing page asset, resolver finds the orcad slot layout. CI workflow structure tests updated.
  • pnpm tc, changed-code quality gate, oxfmt.
  • Guard: build-orcad-node.mjs with out/mobile-web moved away fails with "no bundle manifest ... Run pnpm build:mobile-web".
  • Real end to end on macOS (isolated HOME and ORCA_USER_DATA, own ports), Android emulator with the OTA release APK, paired by deep link to --mobile-pairing:
    • With this change: orcad advertises mobileWeb.bundle.v1, mobileWeb.bundle.manifest returns buildId 62dbc11e... with 130 assets / 8366243 bytes. The phone shows "Downloading the latest app ... of 8.4 MB", then the page-rendered workspace list. Network diagnostics show "Web shell: downloading app 130 assets", "activating app", "page painted source=download build=62dbc11e".
    • Control (same orcad built from main): no capability, manifest answers mobile_web_bundle_unavailable, no download screen, native workspace list, and diagnostics stop at "Authenticated" with no web shell lines.
    • Template path: build-orcad-template.mjs --targets darwin-arm64 puts 131 out/mobile-web/* entries in commonSha256. A slot materialized from it with assembleOrcadArtifact into a temp cache has the page, its identity matches its .version, and orcad started from that slot advertises the capability and serves the same buildId.

orcad never carried out/mobile-web, so it did not advertise
mobileWeb.bundle.v1 and phones paired directly to an orcad server fell
back to the app's built-in native screens.

The built page now ships in every orcad package at out/mobile-web, the
path getBundledMobileWebBundleRoot already probes under the install
root. Its manifest is a fixed artifact; its content-addressed assets
join the hashed artifact list from that manifest, as one shared copy in
the template's common files. build-orcad fails when the page is missing
or stale, and CI lanes that build orcad now build the page first.
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f58f5456-3cfc-45ce-aef6-60983caf9553
📥 Commits

Reviewing files that changed from the base of the PR and between f9d471c and 67bad94.

📒 Files selected for processing: 3
  • src/main/orcad/orcad-artifact-materializer.test.ts
  • src/main/orcad/orcad-artifact-materializer.ts
  • src/shared/orcad-artifacts.ts
🚧 Files skipped from review as they are similar to previous changes: 2
  • src/main/orcad/orcad-artifact-materializer.ts
  • src/main/orcad/orcad-artifact-materializer.test.ts

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

📝 Walkthrough

The change adds mobile web manifest parsing and bundle staging to Orcad artifact handling. Manifest-listed assets are included in artifact names, template inventories, version and identity calculations, materialization, and checksum verification. CI workflows build the bundle or transfer it as an artifact before Orcad builds and tests. The PR workflow also separates terminal-smoke scope detection from execution and gates the bundle build and smoke on the detected scope.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 67bad

Orcad packages now include the mobile page and verify its assets; CI prepares the required bundle, and no actionable merge-blocking risk remains.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description is detailed and explains the user impact, implementation, rationale, compatibility, testing, and size impact. However, it omits the required Linked Issue and Visual Proof sections, and… Add an actual linked issue under “Linked Issue” or document the maintainer exception. Add before-and-after visual proof, or write N/A with a reason if no visual proof applies. Complete the required checklist and state the AI disclosure st…
Docstring Coverage Warning Docstring coverage is 54.17% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 24 functions across 23 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: shipping the mobile web page in OrCAD packages for paired phones.
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: Description check

Explanation

The description is detailed and explains the user impact, implementation, rationale, compatibility, testing, and size impact. However, it omits the required Linked Issue and Visual Proof sections, and it does not include the repository checklist or explicit AI disclosure status.

Resolution

Add an actual linked issue under “Linked Issue” or document the maintainer exception. Add before-and-after visual proof, or write N/A with a reason if no visual proof applies. Complete the required checklist and state the AI disclosure status when applicable.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7f37ba4c-3943-4a37-b873-ed1d6b07589c
📥 Commits

Reviewing files that changed from the base of the PR and between d963f2a and 5fb4718.

📒 Files selected for processing: 29
  • .github/actions/build-mobile-web-bundle/action.yml
  • .github/workflows/e2e.yml
  • .github/workflows/node-server-tests.yml
  • .github/workflows/pr.yml
  • .github/workflows/ssh-hostile-hosts.yml
  • .github/workflows/ssh-windows-hosts.yml
  • .github/workflows/win-orcad-serve-switch-e2e.yml
  • .github/workflows/wsl-orcad-e2e.yml
  • config/scripts/build-orcad-template.mjs
  • config/scripts/build-orcad.mjs
  • config/scripts/node-server-change-scope.test.mjs
  • config/scripts/orcad-artifact-version.mjs
  • config/scripts/orcad-artifact-version.test.mjs
  • config/scripts/orcad-mobile-web-bundle.mjs
  • config/scripts/orcad-mobile-web-bundle.test.mjs
  • config/scripts/orcad-template-test-fixture.mjs
  • config/scripts/orcad-terminal-smoke-change-scope.test.mjs
  • config/scripts/release-cut-token-permissions.test.mjs
  • config/scripts/verify-packaged-orcad-template.cjs
  • config/scripts/verify-packaged-orcad-template.test.mjs
  • src/main/orcad/orcad-artifact-identity.ts
  • src/main/orcad/orcad-artifact-materializer.test.ts
  • src/main/orcad/orcad-artifact-materializer.ts
  • src/main/orcad/orcad-artifact-preflight.test.ts
  • src/main/orcad/orcad-runtime-entry-artifacts.test.ts
  • src/main/runtime/rpc/methods/mobile-web-bundle.test.ts
  • src/main/ssh/remote-install-model.ts
  • src/shared/orcad-artifacts.test.ts
  • src/shared/orcad-artifacts.ts

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

Comment thread src/main/ssh/remote-install-model.ts Resolved
The guard already refuses unlisted files, so staging copies the
bundle directory as native-chat-visuals is copied. The shipped template
takes the page the qualification lanes tested, the e2e build artifact
carries it, and the PR smoke builds it through install-mobile-dependencies
behind its own scope step. Drops tests that duplicated the guard's own.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔇 Additional comments: 9
.github/workflows/e2e.yml: 1

137-139: Zizmor self-repository hint is a style warning only.

The ./.github/actions/... reference matches how the repository references its other local actions. The hashFiles guard also supports older refs. No change is needed.

.github/workflows/node-server-tests.yml: 2

334-334: LGTM!

Also applies to: 464-464, 522-526


563-567: LGTM!

.github/workflows/pr.yml: 1

415-442: LGTM!

config/scripts/node-server-change-scope.test.mjs: 1

577-577: LGTM!

config/scripts/orcad-mobile-web-bundle.test.mjs: 1

1-6: LGTM!

Also applies to: 50-58

config/scripts/orcad-terminal-smoke-change-scope.test.mjs: 1

95-115: LGTM!

config/scripts/pr-preflight-gates.test.mjs: 1

246-246: LGTM!

config/scripts/node-server-native-compat-scope.test.mjs: 1

331-334: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

The assertion relies on fragile string slicing.

floor.if.slice(0, -3) assumes the expression ends with exactly }}. The .replace(...) call also assumes the exact text and whitespace of the inserted clause. If the workflow text is reformatted, replace silently does nothing, and the test then fails with a confusing message. This is acceptable now, but it is brittle.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ac3fd554-4c8a-4fdf-86db-5bad78e811ef
📥 Commits

Reviewing files that changed from the base of the PR and between 5fb4718 and f9d471c.

📒 Files selected for processing: 11
  • .github/workflows/e2e.yml
  • .github/workflows/node-server-tests.yml
  • .github/workflows/pr.yml
  • config/scripts/node-server-change-scope.test.mjs
  • config/scripts/node-server-native-compat-scope.test.mjs
  • config/scripts/orcad-mobile-web-bundle.mjs
  • config/scripts/orcad-mobile-web-bundle.test.mjs
  • config/scripts/orcad-terminal-smoke-change-scope.test.mjs
  • config/scripts/pr-preflight-gates.test.mjs
  • src/main/orcad/orcad-artifact-materializer.ts
  • src/shared/orcad-artifacts.ts

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

@Jinwoo-H
Jinwoo-H merged commit 776c791 into main Oct 17, 2026
60 checks passed
@Jinwoo-H
Jinwoo-H deleted the jinwoo/orcad-ships-mobile-web branch October 17, 2026 02:30
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