mirror of
https://github.com/modrinth/code.git
synced 2026-08-25 00:55:25 +00:00
1.8 KiB
1.8 KiB
name, description
| name | description |
|---|---|
| cross-platform-pages | Convert a page to the shared Modrinth page system for the website and desktop app. Use for shared layouts, wrapped layouts, or platform dependency-injection contracts. |
Convert a Cross-Platform Page
Read the applicable AGENTS.md files before you edit code.
Read these standards in full:
- Identify the target page from the request.
- Read the page and its route shell. Identify data sources, mutations, navigation, and platform APIs.
- Use a wrapped layout when both platforms use the same API source and page logic.
- Use a shared layout when platform data or operations have different implementations.
For a shared layout:
- Define a provider contract for all platform operations.
- Put common UI and state logic in the shared layout.
- Put reusable search, filter, and selection logic in local composables.
- Implement the contract in
apps/frontend/andapps/app-frontend/. - Use optional contract fields only for capabilities that are not available on both platforms.
For a wrapped layout:
- Move the page to
packages/ui/src/layouts/wrapped/and preserve its route structure. - Replace platform-only imports with common utilities or provider calls.
- Make each frontend route shell render the wrapped component.
- Match primary query options in both route shells when the layout uses
ReadyTransitionanduseReadyState. - Prefetch these queries with
ensureQueryData, as the standard specifies.
Check that both route shells resolve their imports. Check that all required provider fields have implementations.
Run only the checks that the user or the applicable AGENTS.md permits.