docs(mobile): record agent conventions for tests, variants, and file modules - #13173
juliusmarminge wants to merge 1 commit into
Conversation
…modules apps/mobile has no AGENTS.md, so agents relearn the same small conventions from scratch: the Node-environment test setup and vi.mock pattern, the @effect/vitest vs vite-plus/test split, Platform.OS vs file-variant divergence (with the current uniwind platform-variant warning), naming, relative imports, and the pnpm file: module reinstall gotcha. Record the verified conventions without duplicating the implementation catalog. Co-authored-by: Apex <noreply@callstack.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This PR adds a single mobile-scoped agent-conventions document and does not modify executable code, configuration, product defaults, or static-analysis behavior. Its impact is limited to development guidance, with no direct production runtime or deployment risk. You can add or adjust custom eligibility rules. Learn more. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pingdotgg/t3code/.coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughAdded ChangesMobile Development Guidance
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~3 minutes Change: Other Merge Risk: ⚪ Minimal · up to The PR adds mobile development guidance without changing runtime behavior, so it is mergeable. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
The problem
apps/mobilehas noAGENTS.md(the repository root has the only one, andCLAUDE.mdis just@AGENTS.md), so agents relearn the same small mobile conventions from scratch: the Node-environment test setup andvi.mockpattern, the@effect/vitest/vite-plus/testsplit,Platform.OSvs file-variant divergence, naming, relative imports, and the pnpmfile:module reinstall gotcha.The fix
A short, factual
apps/mobile/AGENTS.md. This is now an ordinary single-commit PR against currentmain(68607c5); #13150 was closed unmerged, so all renderer/test-host guidance was removed and every statement was re-verified againstorigin/main:vp test runuses the repository-root Vitest config (test.environment: "node"; focused runs reportenvironment 0ms). On main, 33 files undersrcimport@effect/vitest(13 mixing it withvite-plus/testforvi), 160 usevite-plus/test, and only the standalone.mjsconfig-plugin test underplugins/importsvitest. Thevi.hoisted+vi.mock+ import-under-test-after pattern matches existing files. The two.test.tsxfiles undersrcrender viarenderToStaticMarkupwithreact-nativemocked — recorded as what exists, and the doc says to follow a localmodules/*package's own setup there (e.g.react-dom/client+ DOM shims in t3-markdown-text).Platform.OSclassName branches. Uniwindios:/android:class variants are documented as must-not-use: unguarded in this repo's Metro pipeline (Android classes apply on iOS and vice versa); revert(mobile): git sheets back to Platform.OS ternaries (un-guarded uniwind variants broke both platforms) #13169 reverted refactor(mobile): git sheets use uniwind platform variants instead of className ternaries #13161 (ec28eefa0d0) for exactly this reason, and the ban stands until the pipeline is fixed/upgraded and platform isolation is proved on both devices. Verified on current main: the revert removed the git-sheet usages, but a few remain insrc(settings rows/screens,NewTaskDraftScreen,worktree-setup-card); the doc states they still leak, need remediation, and no more should be added. Behavior differences branch onPlatform.OS; file variants (.ios/.android/.nativeover the extensionless base,Name.shared.tsxre-export perAndroidHomeFab) for wholesale UI differences.*RouteScreen.tsxfiles, PascalCase components vs kebab-case logic modules; hook files split roughly evenly betweenuseCamelCase.tsanduse-kebab-case.ts, so the doc says to match the surrounding directory.@/alias orbaseUrlinapps/mobile/tsconfig.json(zero@/imports insrc);@t3tools/client-runtimehas no root export and a root lint rule (RESTRICTED_IMPORT_PATHSinvite.config.ts) forces explicit subpaths.docs/internals/mobile-development.md(pnpm copiesmodules/*; edit →vp ibefore Metro sees it) instead of re-deriving it.The earlier
docs/internals/mobile-navigation.mdaudit item did not reproduce: all six links and theREADME.md#developmentanchor resolve onmain, the three cited Swift media-presentation files exist undert3-native-controls/ios/(which is where the AVKit/Quick Look implementations live;t3-markdown-texthas no Swift at all), so that file is unchanged.No runtime code touched. Screenshots n/a (docs only).
Verification
vp test run src/features/home/thread-dismissal.test.ts→ 4 passed (environment 0ms, confirming the documented Node environment)vp test run src/native/voiceTranscription.ios.test.ts→ 4 passed (confirms the platform-variant test convention)vp fmtclean.Model: callstack/Apex via pi (T3 Code).
Summary by CodeRabbit