@jskit-ai/agent-docs 0.1.55 → 0.1.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -456,6 +456,7 @@ Its job is usually to:
|
|
|
456
456
|
- call `useCrudListScreen()`
|
|
457
457
|
- pass page-local `listFilters`, `listBulkActions`, and `listRowActions` when needed
|
|
458
458
|
- pass `syntheticRows` when the page needs non-CRUD display rows such as an owner/master row
|
|
459
|
+
- pass read options such as `requestQueryParams` and `readEnabled` when the list read needs them
|
|
459
460
|
- render the shared `CrudListScreen`
|
|
460
461
|
- resolve list/view/edit/new URLs
|
|
461
462
|
- pass route query state through when navigating deeper
|
|
@@ -848,9 +849,35 @@ That is the right direction of growth:
|
|
|
848
849
|
- shared structured list filters live best in a CRUD-package shared module that both server and client can import
|
|
849
850
|
- shared generated screen chrome stays in `users-web`; adapted pages feed it definitions, slots, and explicit command handlers
|
|
850
851
|
|
|
851
|
-
###
|
|
852
|
+
### Shared screen read options and detail slots
|
|
852
853
|
|
|
853
|
-
Use the shared detail
|
|
854
|
+
Use the shared list and detail screens first, even when a page needs includes, permission gating, or domain sections.
|
|
855
|
+
|
|
856
|
+
`useCrudListScreen(...)` accepts the common list read-pass-through options that adapted list pages usually need:
|
|
857
|
+
|
|
858
|
+
- `requestQueryParams`
|
|
859
|
+
- `readEnabled`
|
|
860
|
+
|
|
861
|
+
For example, a permission-gated list can stay on the shared list screen:
|
|
862
|
+
|
|
863
|
+
```js
|
|
864
|
+
const canReadProjectAccess = computed(() =>
|
|
865
|
+
access.value?.canManageProjectAccess === true
|
|
866
|
+
);
|
|
867
|
+
|
|
868
|
+
const screen = useCrudListScreen({
|
|
869
|
+
resource: projectAccessResource,
|
|
870
|
+
apiSuffix: "/project-access",
|
|
871
|
+
readEnabled: canReadProjectAccess,
|
|
872
|
+
requestQueryParams() {
|
|
873
|
+
return {
|
|
874
|
+
include: "userId,roleId"
|
|
875
|
+
};
|
|
876
|
+
}
|
|
877
|
+
});
|
|
878
|
+
```
|
|
879
|
+
|
|
880
|
+
`readEnabled` gates the underlying Query-backed read. The screen still owns load, empty, error, retry, filters, row actions, and responsive list chrome. The page owns only the permission condition.
|
|
854
881
|
|
|
855
882
|
`useCrudViewScreen(...)` accepts the same read-pass-through options that adapted detail pages usually need:
|
|
856
883
|
|
package/package.json
CHANGED
|
@@ -46,6 +46,8 @@ Use the shared CRUD screen wrappers when the route is a generated CRUD page:
|
|
|
46
46
|
|
|
47
47
|
Generated screen wrapper extension rules:
|
|
48
48
|
|
|
49
|
+
- Use `useCrudListScreen({ readEnabled })` for permission-gated generated list reads instead of splitting the page or replacing the shared list screen.
|
|
50
|
+
- Use `useCrudListScreen({ requestQueryParams })` for list includes or other endpoint query params instead of putting query strings in `apiSuffix`.
|
|
49
51
|
- Use `useCrudViewScreen({ requestQueryParams })` for detail includes instead of putting query strings in `apiUrlTemplate`.
|
|
50
52
|
- Use `readEnabled` and `queryKeyFactory` on `useCrudViewScreen()` when the detail read needs the same gating or cache identity control as `useCrudView()`.
|
|
51
53
|
- Use `CrudViewScreen` slots (`before-fields`, `fields`, `after-fields`, `supporting-content`) for page-specific domain sections while keeping shared load/error/retry chrome.
|
|
@@ -94,6 +96,6 @@ Avoid:
|
|
|
94
96
|
- manually concatenating scoped route params into API URLs
|
|
95
97
|
- using a lower-level seam when a higher-level routed CRUD or command runtime already fits
|
|
96
98
|
- smuggling query params into `apiUrlTemplate`
|
|
97
|
-
- replacing `CrudListScreen` or `CrudViewScreen` only to add row actions, synthetic display rows, includes, or domain detail sections
|
|
99
|
+
- replacing `CrudListScreen` or `CrudViewScreen` only to add read gating, row actions, synthetic display rows, includes, or domain detail sections
|
|
98
100
|
- reporting routine resource load errors through hand-written global snackbar/banner calls
|
|
99
101
|
- calling `useShellRequestRecoveryRuntime().report(...)` from normal panels just to recover an HTTP read
|
|
@@ -28,6 +28,7 @@ Rules:
|
|
|
28
28
|
- Generated CRUD UI must be compact-first. Lists need searchable cards on compact widths and tables only for medium/expanded layouts.
|
|
29
29
|
- Generated CRUD list screens need real loading, empty, and error states. Empty copy should name the resource, such as "No customers yet", and offer the create action when available.
|
|
30
30
|
- Generated CRUD view/new/edit screens should use page headers plus direct sheet panels. Do not use generic card shells as the page architecture.
|
|
31
|
+
- Permission-gated generated CRUD lists should pass `readEnabled` into `useCrudListScreen(...)` instead of replacing the shared list wrapper.
|
|
31
32
|
- Compact CRUD actions should be reachable without a drawer. Use a mobile-visible primary action or FAB for create flows.
|
|
32
33
|
- Row actions should be declared with `defineCrudListRowActions(...)` in a page-local `listRowActions.js` and passed into `useCrudListScreen(...)`; the shared list screen owns the compact/wide action rendering.
|
|
33
34
|
- Use `syntheticRows` for display-only owner/master rows that should appear inside the shared list layout without becoming CRUD records.
|
|
@@ -60,6 +60,7 @@ Generated JSKIT apps should feel like real adaptive apps by default, not framewo
|
|
|
60
60
|
- CRUD row actions are client-side by default: generated list pages can create a page-local `listRowActions.js` with `defineCrudListRowActions(...)` and pass it into `useCrudListScreen(...)`; the shared list screen renders per-row actions in card and table layouts while action handlers stay explicit and page-owned.
|
|
61
61
|
- CRUD synthetic rows are display-only: pass `syntheticRows` into `useCrudListScreen(...)` for owner/master rows that are not repository records. Synthetic rows render through the shared list screen, skip standard Open/Edit links, and are excluded from bulk selection unless explicitly marked selectable.
|
|
62
62
|
- Generated CRUD page templates delegate their screen chrome to shared `users-web` screen components (`CrudListScreen`, `CrudViewScreen`, and `CrudAddEditScreen`) so list/view/form load states, retry actions, responsive shell layout, filters, bulk actions, row actions, and detail slots do not drift across generated pages.
|
|
63
|
+
- Generated CRUD list pages should use `useCrudListScreen({ requestQueryParams, readEnabled })` for list read pass-throughs instead of replacing the shared list chrome for includes or permission-gated reads.
|
|
63
64
|
- Generated CRUD detail pages should use `useCrudViewScreen({ requestQueryParams, readEnabled, queryKeyFactory })` for read pass-throughs and `CrudViewScreen` slots (`before-fields`, `fields`, `after-fields`, `supporting-content`) for domain sections instead of replacing the shared detail chrome.
|
|
64
65
|
- Routine resource-load errors stay local to the generated screen and retry affordance. Action feedback uses the shell error policy through `action-feedback`.
|
|
65
66
|
- `page.supporting-content` is a semantic supporting region in the default shell. Compact layout renders it as a closed bottom sheet; medium/expanded layouts render it as a closed side panel.
|
|
@@ -509,7 +509,7 @@ Local functions
|
|
|
509
509
|
|
|
510
510
|
### `src/client/composables/useCrudListScreen.js`
|
|
511
511
|
Exports
|
|
512
|
-
- `useCrudListScreen({ adapter = null, resource = null, resourceNamespace = "resource", apiSuffix = "", recordIdParam = "recordId", recordIdSelector = null, titleFallbackFieldKey = "", viewUrlTemplate = "", editUrlTemplate = "", newUrlTemplate = "", recordChangedEvents = [], listFilters = {}, listBulkActions = [], listRowActions = [], syntheticRows = null, routeQueryBlacklist = Object.freeze(["include", "cursor", "limit"]), requestQueryParams = null, requestRecoveryLabel = "Records", fallbackLoadError = "Unable to load records." } = {})`
|
|
512
|
+
- `useCrudListScreen({ adapter = null, resource = null, resourceNamespace = "resource", apiSuffix = "", recordIdParam = "recordId", recordIdSelector = null, titleFallbackFieldKey = "", viewUrlTemplate = "", editUrlTemplate = "", newUrlTemplate = "", recordChangedEvents = [], listFilters = {}, listBulkActions = [], listRowActions = [], syntheticRows = null, routeQueryBlacklist = Object.freeze(["include", "cursor", "limit"]), requestQueryParams = null, readEnabled = true, requestRecoveryLabel = "Records", fallbackLoadError = "Unable to load records." } = {})`
|
|
513
513
|
Local functions
|
|
514
514
|
- `formatCrudListCardValue(value)`
|
|
515
515
|
- `asList(value = [])`
|