# Instant admin routes — design

Audience: AI coding agents first.

## Outcome

Make `#/translations/fields` sole Fields route. Remove standalone `#/fields` navigation and route. Make every eligible admin data page paint through existing canonical loading stack: route skeleton → valid memory/localStorage snapshot → permission-safe WordPress REST snapshot → deferred revalidation.

Push final tree to `origin/master`, build verified release, deploy to dev1, and verify installed version/archive/admin assets.

## Route contract

- Remove sidebar item `fields`.
- Remove top-level route handler and `renderFields()` loader.
- Keep Translations tab `fields`; it MUST continue loading `fields-translate.js`.
- Requests for legacy `#/fields` MUST redirect to `#/translations/fields`; do not retain a second rendering path.
- Sidebar active state for canonical Fields page remains `translations`.

## Loading contract

Use only `AdminDataPolicy`, `adminStores`, `DataStore`, and `DataRegion`. NEVER add page-owned localStorage keys, polling, cache services, or bypass headers.

For every route:

1. Render route-owned skeleton before lazy page chunk resolves.
2. Eligible stable data MUST use a canonical policy descriptor and `getDataStore()`.
3. Valid browser snapshot MUST paint synchronously.
4. WordPress cache snapshot MUST follow permission-safe server policy.
5. Deferred ordinary GET MUST revalidate without clearing visible data.
6. Mutation success MUST invalidate descriptor tags; failures MUST preserve/restore prior state.
7. Reconciliation MUST preserve focus, scroll, tabs, pagination, search, disclosure, selection, and busy controls.
8. Destroy MUST abort requests and remove subscriptions, timers, listeners, and observers.

## Eligibility

Persist stable user-scoped configuration, catalogs, completed history, dashboard summaries, content/string result pages, languages, fields, settings, onboarding plans, team overview, workflow metrics, and assignments when their existing policy permits it.

Keep these live/nonpersistent:

- active job/progress/polling fields;
- licensing, entitlements, checkout, payment, nonce, and authorization state;
- migration execution/progress;
- mutable control busy state;
- any response carrying nonce-like parameters.

Existing policy `liveFields` remains authoritative. Do not weaken isolation by user/site/blog/locale/plugin version/route/query/invalidation generation.

## Audit boundary

Audit all routes registered in `admin/src/main.js` and all pages in `admin/src/pages/`. A page already using the canonical stack needs tests/contract confirmation, not gratuitous refactoring. Direct API calls used only for mutations or live refresh may remain. Direct initial GET for eligible stable page data MUST be migrated.

## Verification

- Unit-test route redirect and absence of duplicate navigation.
- Add a route matrix test proving every admin route has a route skeleton and every eligible initial GET is policy/store-bound.
- Test cached-first ordering, deferred revalidation, invalid snapshot eviction, mutation invalidation, stale-visible behavior, and teardown.
- Run full admin lint/build/tests and affected PHP policy/cache suites.
- Run canonical remote Chromium/Firefox route sweep; no dev1 browser test.
- Push `origin/master`; build distribution; deploy exact ZIP through `tools/deploy-dev1.mjs`; verify active version and every packaged admin asset.

## Architecture decisions

- Reuse existing four primitives; no new abstraction passes deletion/seam tests.
- Keep live-data exclusions in policy, not page conditionals.
- Treat page-wide conversion as an audit plus surgical migrations, not a rewrite.
