Pages, forms, and data views
Register and verify a read-only Admin list, then give users a form for editing its records.
An Admin page owns navigation, the table, and applied filters. Service owns authorization and writes. Start with a read-only list and establish direct access, pagination, and error states before adding edits.
Get a read-only page working
Imagine adding a list that editors use to review records. Look at how similar pages are registered in apps/admin/src/config/routes.ts. Pick the URL, then verify direct access and navigation from the sidebar. If the page has a menu item, check its placement and the page title.
Start with an existing query for the same feature. AppDataView is the shared component for list presentation and related controls. Verify loading, empty, and error states before adding search, filters, or pagination. After a request finishes, check that the page still shows the filters that produced the result.
Trace an existing list
The Admin route /member/accounts offers a concrete example. Its implementation is in apps/admin/src/features/member/pages/member-accounts-page.tsx. It defines status and keyword in filterSchema, then builds the request from the applied filters, current page, and page size. Submitting the filters changes the query, resets the page to 1, and clears row selection. Go to page two, type a keyword, then observe what happens before submission, after submission, and after reset.
This page sets urlQuery: false, so a reload starts with the default filters. For a list whose filtered results need to be shared, let AppDataView serialize applied filters in the filters query parameter. Test the copied URL in a new tab, then test an older URL containing a retired option. Password controls stay local. For other values that should stay out of the URL, set queryValue: false on the field.
Add editing to the list
Use AppForm for the inputs. For an overlay that remains in the context of the current page, look at existing PageSheet usage. Follow the feature’s existing submission flow and put server errors where operators can act on them. After saving, verify that the list reflects the result, then check direct entry and refresh.
Verify a save
Map the record returned by the API to the form defaults, then map the validated draft to the write payload. Use a Zod schema for field constraints and onSubmitError to map applicable API failures to a field or to the form. Await the write and refresh the affected queries after success. If the same record appears in a list, a detail view, and a picker, verify that all three show the updated value.
| Symptom | Where to start |
|---|---|
| Direct access behaves differently from sidebar navigation | Page registration, navigation configuration, and route parameters |
| The save succeeds but the list still shows old values | How the list data is refreshed after submission |
| The action keeps getting rejected | The current session, management response, and Service permissions |
See routing and the request lifecycle for the back end and automation and assistant actions for programmatic operations.
For grouped editing, cross-field logic, and API error mapping, see forms, drafts, and validation.
For shareable filters, server-side pagination, or refresh after a write, see data views, filters, and pagination.