@genesislcap/ai-assistant 15.69.0 → 15.71.0-FUI-2650.1

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.
Files changed (139) hide show
  1. package/dist/ai-assistant.api.json +97 -0
  2. package/dist/ai-assistant.d.ts +65 -0
  3. package/dist/chat-driver.cjs +18031 -0
  4. package/dist/chat-driver.cjs.map +4 -4
  5. package/dist/chat-driver.mjs +18024 -0
  6. package/dist/chat-driver.mjs.map +4 -4
  7. package/dist/custom-elements.json +5524 -2684
  8. package/dist/dts/chat-driver-node.d.ts +2 -0
  9. package/dist/dts/chat-driver-node.d.ts.map +1 -1
  10. package/dist/dts/code-review/code-review.types.d.ts +76 -0
  11. package/dist/dts/code-review/code-review.types.d.ts.map +1 -0
  12. package/dist/dts/code-review/code-reviewer.agent.d.ts +77 -0
  13. package/dist/dts/code-review/code-reviewer.agent.d.ts.map +1 -0
  14. package/dist/dts/code-review/code-reviewer.prompt.d.ts +23 -0
  15. package/dist/dts/code-review/code-reviewer.prompt.d.ts.map +1 -0
  16. package/dist/dts/code-review/gate.d.ts +44 -0
  17. package/dist/dts/code-review/gate.d.ts.map +1 -0
  18. package/dist/dts/code-review/index.d.ts +27 -0
  19. package/dist/dts/code-review/index.d.ts.map +1 -0
  20. package/dist/dts/code-review/review-changes.d.ts +70 -0
  21. package/dist/dts/code-review/review-changes.d.ts.map +1 -0
  22. package/dist/dts/code-review/rules/context-trigger-map.d.ts +6 -0
  23. package/dist/dts/code-review/rules/context-trigger-map.d.ts.map +1 -0
  24. package/dist/dts/code-review/rules/context.registry.d.ts +123 -0
  25. package/dist/dts/code-review/rules/context.registry.d.ts.map +1 -0
  26. package/dist/dts/code-review/rules/fui-ai-extensions.d.ts +13 -0
  27. package/dist/dts/code-review/rules/fui-ai-extensions.d.ts.map +1 -0
  28. package/dist/dts/code-review/rules/fui-blotter.d.ts +16 -0
  29. package/dist/dts/code-review/rules/fui-blotter.d.ts.map +1 -0
  30. package/dist/dts/code-review/rules/fui-chart.d.ts +20 -0
  31. package/dist/dts/code-review/rules/fui-chart.d.ts.map +1 -0
  32. package/dist/dts/code-review/rules/fui-column-defs.d.ts +21 -0
  33. package/dist/dts/code-review/rules/fui-column-defs.d.ts.map +1 -0
  34. package/dist/dts/code-review/rules/fui-components.d.ts +9 -0
  35. package/dist/dts/code-review/rules/fui-components.d.ts.map +1 -0
  36. package/dist/dts/code-review/rules/fui-criteria.d.ts +32 -0
  37. package/dist/dts/code-review/rules/fui-criteria.d.ts.map +1 -0
  38. package/dist/dts/code-review/rules/fui-custom-renderer.d.ts +15 -0
  39. package/dist/dts/code-review/rules/fui-custom-renderer.d.ts.map +1 -0
  40. package/dist/dts/code-review/rules/fui-dashboard.d.ts +19 -0
  41. package/dist/dts/code-review/rules/fui-dashboard.d.ts.map +1 -0
  42. package/dist/dts/code-review/rules/fui-dialogs.d.ts +19 -0
  43. package/dist/dts/code-review/rules/fui-dialogs.d.ts.map +1 -0
  44. package/dist/dts/code-review/rules/fui-entity-management.d.ts +19 -0
  45. package/dist/dts/code-review/rules/fui-entity-management.d.ts.map +1 -0
  46. package/dist/dts/code-review/rules/fui-error-boundary.d.ts +9 -0
  47. package/dist/dts/code-review/rules/fui-error-boundary.d.ts.map +1 -0
  48. package/dist/dts/code-review/rules/fui-eventing.d.ts +8 -0
  49. package/dist/dts/code-review/rules/fui-eventing.d.ts.map +1 -0
  50. package/dist/dts/code-review/rules/fui-flexlayout.d.ts +17 -0
  51. package/dist/dts/code-review/rules/fui-flexlayout.d.ts.map +1 -0
  52. package/dist/dts/code-review/rules/fui-flyout-panel.d.ts +10 -0
  53. package/dist/dts/code-review/rules/fui-flyout-panel.d.ts.map +1 -0
  54. package/dist/dts/code-review/rules/fui-form-component.d.ts +9 -0
  55. package/dist/dts/code-review/rules/fui-form-component.d.ts.map +1 -0
  56. package/dist/dts/code-review/rules/fui-formatters.d.ts +12 -0
  57. package/dist/dts/code-review/rules/fui-formatters.d.ts.map +1 -0
  58. package/dist/dts/code-review/rules/fui-foundation-comms.d.ts +10 -0
  59. package/dist/dts/code-review/rules/fui-foundation-comms.d.ts.map +1 -0
  60. package/dist/dts/code-review/rules/fui-global-filters.d.ts +33 -0
  61. package/dist/dts/code-review/rules/fui-global-filters.d.ts.map +1 -0
  62. package/dist/dts/code-review/rules/fui-import-surface.d.ts +37 -0
  63. package/dist/dts/code-review/rules/fui-import-surface.d.ts.map +1 -0
  64. package/dist/dts/code-review/rules/fui-inline-editing.d.ts +10 -0
  65. package/dist/dts/code-review/rules/fui-inline-editing.d.ts.map +1 -0
  66. package/dist/dts/code-review/rules/fui-layout.d.ts +7 -0
  67. package/dist/dts/code-review/rules/fui-layout.d.ts.map +1 -0
  68. package/dist/dts/code-review/rules/fui-notifications.d.ts +12 -0
  69. package/dist/dts/code-review/rules/fui-notifications.d.ts.map +1 -0
  70. package/dist/dts/code-review/rules/fui-primitives.d.ts +26 -0
  71. package/dist/dts/code-review/rules/fui-primitives.d.ts.map +1 -0
  72. package/dist/dts/code-review/rules/fui-rapid-grid-pro.d.ts +18 -0
  73. package/dist/dts/code-review/rules/fui-rapid-grid-pro.d.ts.map +1 -0
  74. package/dist/dts/code-review/rules/fui-redux-store.d.ts +8 -0
  75. package/dist/dts/code-review/rules/fui-redux-store.d.ts.map +1 -0
  76. package/dist/dts/code-review/rules/fui-reporting.d.ts +19 -0
  77. package/dist/dts/code-review/rules/fui-reporting.d.ts.map +1 -0
  78. package/dist/dts/code-review/rules/fui-styling.d.ts +15 -0
  79. package/dist/dts/code-review/rules/fui-styling.d.ts.map +1 -0
  80. package/dist/dts/code-review/rules/fui-trade-form.d.ts +13 -0
  81. package/dist/dts/code-review/rules/fui-trade-form.d.ts.map +1 -0
  82. package/dist/dts/code-review/submit-code-review.tool.d.ts +12 -0
  83. package/dist/dts/code-review/submit-code-review.tool.d.ts.map +1 -0
  84. package/dist/dts/code-review/unified-diff.d.ts +7 -0
  85. package/dist/dts/code-review/unified-diff.d.ts.map +1 -0
  86. package/dist/dts/code-review/verdict.d.ts +23 -0
  87. package/dist/dts/code-review/verdict.d.ts.map +1 -0
  88. package/dist/dts/components/code-review-result/code-review-result.d.ts +26 -0
  89. package/dist/dts/components/code-review-result/code-review-result.d.ts.map +1 -0
  90. package/dist/dts/index.d.ts +1 -0
  91. package/dist/dts/index.d.ts.map +1 -1
  92. package/dist/dts/react.d.ts +20 -10
  93. package/dist/esm/chat-driver-node.js +6 -0
  94. package/dist/esm/code-review/code-review.types.js +6 -0
  95. package/dist/esm/code-review/code-reviewer.agent.js +167 -0
  96. package/dist/esm/code-review/code-reviewer.prompt.js +103 -0
  97. package/dist/esm/code-review/gate.js +93 -0
  98. package/dist/esm/code-review/index.js +28 -0
  99. package/dist/esm/code-review/review-changes.js +123 -0
  100. package/dist/esm/code-review/rules/context-trigger-map.js +20 -0
  101. package/dist/esm/code-review/rules/context.registry.js +772 -0
  102. package/dist/esm/code-review/rules/fui-ai-extensions.js +306 -0
  103. package/dist/esm/code-review/rules/fui-blotter.js +596 -0
  104. package/dist/esm/code-review/rules/fui-chart.js +669 -0
  105. package/dist/esm/code-review/rules/fui-column-defs.js +862 -0
  106. package/dist/esm/code-review/rules/fui-components.js +245 -0
  107. package/dist/esm/code-review/rules/fui-criteria.js +538 -0
  108. package/dist/esm/code-review/rules/fui-custom-renderer.js +612 -0
  109. package/dist/esm/code-review/rules/fui-dashboard.js +604 -0
  110. package/dist/esm/code-review/rules/fui-dialogs.js +588 -0
  111. package/dist/esm/code-review/rules/fui-entity-management.js +1014 -0
  112. package/dist/esm/code-review/rules/fui-error-boundary.js +244 -0
  113. package/dist/esm/code-review/rules/fui-eventing.js +628 -0
  114. package/dist/esm/code-review/rules/fui-flexlayout.js +860 -0
  115. package/dist/esm/code-review/rules/fui-flyout-panel.js +432 -0
  116. package/dist/esm/code-review/rules/fui-form-component.js +898 -0
  117. package/dist/esm/code-review/rules/fui-formatters.js +415 -0
  118. package/dist/esm/code-review/rules/fui-foundation-comms.js +518 -0
  119. package/dist/esm/code-review/rules/fui-global-filters.js +778 -0
  120. package/dist/esm/code-review/rules/fui-import-surface.js +452 -0
  121. package/dist/esm/code-review/rules/fui-inline-editing.js +445 -0
  122. package/dist/esm/code-review/rules/fui-layout.js +431 -0
  123. package/dist/esm/code-review/rules/fui-notifications.js +439 -0
  124. package/dist/esm/code-review/rules/fui-primitives.js +1216 -0
  125. package/dist/esm/code-review/rules/fui-rapid-grid-pro.js +650 -0
  126. package/dist/esm/code-review/rules/fui-redux-store.js +522 -0
  127. package/dist/esm/code-review/rules/fui-reporting.js +506 -0
  128. package/dist/esm/code-review/rules/fui-styling.js +1229 -0
  129. package/dist/esm/code-review/rules/fui-trade-form.js +618 -0
  130. package/dist/esm/code-review/submit-code-review.tool.js +43 -0
  131. package/dist/esm/code-review/unified-diff.js +96 -0
  132. package/dist/esm/code-review/verdict.js +24 -0
  133. package/dist/esm/components/code-review-result/code-review-result.js +89 -0
  134. package/dist/esm/index.js +3 -0
  135. package/dist/react.cjs +25 -18
  136. package/dist/react.mjs +23 -17
  137. package/docs/code-review.md +137 -0
  138. package/package.json +24 -17
  139. package/scripts/smoke-chat-driver-node.mjs +15 -0
@@ -0,0 +1,445 @@
1
+ /**
2
+ * Context injected into the UI Builder system prompt.
3
+ * Covers inline cell editing for EntityManagement and standalone GridPro.
4
+ *
5
+ * Tags for selective context injection — loaded when the conversation mentions these keywords.
6
+ */
7
+ export const FUI_INLINE_EDITING_TAGS = [
8
+ 'inline edit',
9
+ 'editable',
10
+ 'cell edit',
11
+ 'edit in grid',
12
+ 'cellEditor',
13
+ 'edit directly',
14
+ 'edit inline',
15
+ 'editable column',
16
+ 'edit cell',
17
+ 'in-place edit',
18
+ 'grid editing',
19
+ 'selectEditor',
20
+ 'numberEditor',
21
+ 'stringEditor',
22
+ 'dateEditor',
23
+ 'multiselectEditor',
24
+ 'fk reference',
25
+ 'foreign key column',
26
+ 'dropdown editor',
27
+ 'allow editing',
28
+ 'make column editable',
29
+ 'edit row',
30
+ 'update row',
31
+ ];
32
+ export const FUI_INLINE_EDITING_DEPS = ['fui-column-defs'];
33
+ export const FUI_INLINE_EDITING_CONTEXT = `
34
+ ## INLINE CELL EDITING
35
+
36
+ ### Import paths (verified)
37
+
38
+ \`\`\`ts
39
+ // GridProRendererTypes — the enum of built-in editor / renderer strings
40
+ // Import from root (no /react). This is the correct package for this project.
41
+ import { GridProRendererTypes } from '@genesislcap/rapid-grid-pro';
42
+
43
+ // ColDef — ag-Grid column definition type (from the ag-Grid community package)
44
+ import type { ColDef } from '@ag-grid-community/core';
45
+
46
+ // EntityManagement React wrapper
47
+ import { EntityManagement } from '@genesislcap/foundation-entity-management/react';
48
+
49
+ // Connect — only needed for standalone GridPro (manual commit). Prefer getConnect() in React.
50
+ import { getConnect } from '@genesislcap/foundation-comms';
51
+ \`\`\`
52
+
53
+ ### GridProRendererTypes — cell editor enum values (source-verified from grid-pro.types.d.ts)
54
+
55
+ | Enum value | String | Used for |
56
+ |---|---|---|
57
+ | \`GridProRendererTypes.stringEditor\` | \`'stringEditor'\` | Plain text field |
58
+ | \`GridProRendererTypes.numberEditor\` | \`'numberEditor'\` | Numeric input |
59
+ | \`GridProRendererTypes.dateEditor\` | \`'dateEditor'\` | Date (or datetime) picker |
60
+ | \`GridProRendererTypes.selectEditor\` | \`'selectEditor'\` | Single-select dropdown, optionally server-fed |
61
+ | \`GridProRendererTypes.multiselectEditor\` | \`'multiselectEditor'\` | Multi-select, optionally server-fed |
62
+
63
+ ---
64
+
65
+ ### EntityManagement — built-in inline editing (preferred)
66
+
67
+ EntityManagement handles inline editing **automatically** via its internal \`List\` component. The \`List\` sets \`readOnlyEdit\` on the underlying ag-Grid and intercepts \`cellEditRequest\` events, committing changes to the server with \`connect.commitEvent(updateEvent, { DETAILS: {...} })\`. You do NOT need to wire \`onCellEditingStopped\` manually.
68
+
69
+ To enable inline editing on a column, add \`editable: true\` plus a \`cellEditor\` and (where needed) \`cellEditorParams\` to the column definition.
70
+
71
+ **ENUM fields — do NOT set \`cellEditor\`.** When a field is typed as an enum on the server, the datasource metadata auto-configures \`selectEditor\` with the correct static values. Inside EntityManagement, \`editable: true\` alone is sufficient (its internal \`List\` sets \`auto-cell-renderer-by-type\` on the grid). Adding a manual \`cellEditor\` will override this and break the auto-populated options.
72
+
73
+ \`\`\`tsx
74
+ import { GridProRendererTypes } from '@genesislcap/rapid-grid-pro';
75
+ import type { ColDef } from '@ag-grid-community/core';
76
+
77
+ const columns: ColDef[] = [
78
+ // Plain string field
79
+ {
80
+ field: 'NAME',
81
+ headerName: 'Name',
82
+ editable: true,
83
+ cellEditor: GridProRendererTypes.stringEditor,
84
+ // cellEditorParams: { placeholder: 'Enter name…' } -- optional
85
+ },
86
+ // Numeric field
87
+ {
88
+ field: 'QUANTITY',
89
+ headerName: 'Quantity',
90
+ editable: true,
91
+ cellEditor: GridProRendererTypes.numberEditor,
92
+ // cellEditorParams: { withFormatting: true, placeholder: '0' } -- optional
93
+ },
94
+ // Date field
95
+ {
96
+ field: 'TRADE_DATE',
97
+ headerName: 'Trade Date',
98
+ editable: true,
99
+ cellEditor: GridProRendererTypes.dateEditor,
100
+ // cellEditorParams: { withTime: true } -- add for datetime fields; default false
101
+ },
102
+ // ENUM field — editable only, NO cellEditor. The grid auto-detects the enum type
103
+ // from server metadata and sets the correct select editor with the right values.
104
+ {
105
+ field: 'DIRECTION',
106
+ headerName: 'Direction',
107
+ editable: true,
108
+ // DO NOT add cellEditor here for enum fields
109
+ },
110
+ // FK / reference field — see the "Reference fields" section below for full pattern
111
+ {
112
+ field: 'INSTRUMENT_ID',
113
+ headerName: 'Instrument',
114
+ editable: true,
115
+ valueFormatter: (params) => params.data?.INSTRUMENT_NAME ?? params.value,
116
+ cellEditor: GridProRendererTypes.selectEditor,
117
+ cellEditorParams: {
118
+ allOptionsResourceName: 'ALL_INSTRUMENTS',
119
+ valueField: 'INSTRUMENT_ID',
120
+ labelField: 'INSTRUMENT_NAME',
121
+ async: true,
122
+ allowCustomOptions: false,
123
+ },
124
+ },
125
+ ];
126
+ \`\`\`
127
+
128
+ #### Reference / FK fields — show the name, store the ID
129
+
130
+ When a column is a foreign key (typically named \`*_ID\`) and the view already joins the related entity (e.g. the TRADE view includes both \`INSTRUMENT_ID\` and \`INSTRUMENT_NAME\`), configure the column so the user sees the display name while the underlying ID is what gets committed:
131
+
132
+ 1. **Detect the pattern**: a field named \`*_ID\` that has a corresponding \`*_NAME\` field in the same row data is a FK reference.
133
+ 2. **Check the available resource**: look at existing \`resourceName\`/\`datasourceConfig\` usages in the codebase to find the correct DataServer/Request Server resource name (commonly \`ALL_<ENTITY_PLURAL>\`, e.g. \`ALL_INSTRUMENTS\`, \`ALL_COUNTERPARTYS\`).
134
+ 3. **Column def**:
135
+ - \`field\`: the ID column (e.g. \`'INSTRUMENT_ID'\`) — this is what the update event expects
136
+ - \`valueFormatter\`: read \`params.data?.INSTRUMENT_NAME\` so the cell displays the name in read mode
137
+ - \`cellEditor: GridProRendererTypes.selectEditor\`
138
+ - \`cellEditorParams.valueField\`: the ID column (e.g. \`'INSTRUMENT_ID'\`) — value stored on select
139
+ - \`cellEditorParams.labelField\`: the name column (e.g. \`'INSTRUMENT_NAME'\`) — what the user sees in the dropdown
140
+ - \`cellEditorParams.allOptionsResourceName\`: the resource that lists all options
141
+
142
+ \`\`\`tsx
143
+ {
144
+ field: 'INSTRUMENT_ID',
145
+ headerName: 'Instrument',
146
+ editable: true,
147
+ valueFormatter: (params) => params.data?.INSTRUMENT_NAME ?? params.value,
148
+ cellEditor: GridProRendererTypes.selectEditor,
149
+ cellEditorParams: {
150
+ allOptionsResourceName: 'ALL_INSTRUMENTS',
151
+ valueField: 'INSTRUMENT_ID',
152
+ labelField: 'INSTRUMENT_NAME',
153
+ async: true,
154
+ allowCustomOptions: false,
155
+ },
156
+ },
157
+ \`\`\`
158
+
159
+ **MANDATORY — check the resource name before writing it.** Use \`vfs_list\` or grep the codebase for existing \`resourceName\` / \`allOptionsResourceName\` usages for the same entity to confirm the exact resource name. Do not guess.
160
+
161
+ **Resource type:** The resource does not have to be a DataServer (\`ALL_*\`). Request-Reply (REQ_REP) resources are preferred for option lookups — they are typically named after the entity without a prefix (e.g. \`COUNTERPARTY\`, \`INSTRUMENT\`, \`TRADE_TYPE\`). Always verify whether a REQ_REP or DataServer resource exists for the entity before choosing a name.
162
+
163
+ **Hidden fields — skip FK reference wiring.** If a column def has \`hide: true\`, do not configure \`cellEditor\` or \`valueFormatter\` for it. The field is not visible, so inline editing is irrelevant. Only apply the FK reference pattern to visible columns, or when the user explicitly asks to un-hide a field.
164
+
165
+ **Hide the modal Edit button** when using inline editing so the user is not presented with two editing paths:
166
+
167
+ \`\`\`tsx
168
+ <EntityManagement
169
+ updateEvent="EVENT_TRADE_MODIFY"
170
+ columns={columns}
171
+ hideEdit // ← hides the per-row Edit button / Edit option in the actions menu
172
+ // ...other props
173
+ />
174
+ \`\`\`
175
+
176
+ > \`hideEdit\` is a boolean attribute on both \`EntityManagement\` (attr: \`hide-edit\`) and the inner \`List\` WC. Verified in entities.ts and list.ts source (\`@attr({ mode: 'boolean', attribute: 'hide-edit' }) hideEdit\`). When \`crudMenuPosition\` is not \`CrudMenuPosition.Column\`, the Edit button is also hidden automatically.
177
+
178
+ #### Cell editor params reference (source-verified from cell-editors/*.ts)
179
+
180
+ | Editor | \`cellEditor\` value | Key \`cellEditorParams\` fields |
181
+ |--------|---------------------|-------------------------------|
182
+ | Text / string | \`GridProRendererTypes.stringEditor\` | \`placeholder?: string\` |
183
+ | Number | \`GridProRendererTypes.numberEditor\` | \`placeholder?: string\`, \`withFormatting?: boolean\`, \`formatOptions?: any\`, \`disabled?: boolean\`, \`onChange?: (value: number, params) => void\` |
184
+ | Date | \`GridProRendererTypes.dateEditor\` | \`withTime?: boolean\` (default \`false\` — uses \`'datetime-local'\` input when true) |
185
+ | Dropdown / select | \`GridProRendererTypes.selectEditor\` | \`allOptionsResourceName: string\`, \`valueField: string\`, \`labelField: string\`, \`async: boolean\`, \`allowCustomOptions: boolean\`, \`values?: any[]\`, \`datasourceOptions?: DatasourceOptions[]\`, \`position?: (rowData) => string\` |
186
+ | Multi-select | \`GridProRendererTypes.multiselectEditor\` | \`allOptionsResourceName: string\`, \`valueField: string\`, \`labelField: string\`, \`async: boolean\`, \`values?: any[]\`, \`datasourceOptions?: DatasourceOptions[]\`, \`selectedOptionsCallback?: (data) => Promise<any[]>\` |
187
+
188
+ > \`DatasourceOptions\` imports from \`@genesislcap/foundation-comms\` — only needed for advanced datasource configuration of the select/multiselect editors. Typically not required for straightforward server-resource lookups.
189
+
190
+ > **\`multiselectEditor\` does NOT have \`allowCustomOptions\`** — that param only exists on \`selectEditor\`. Source-verified from multiselect.editor.ts \`MultiselectEditorParams\` interface.
191
+
192
+ **\`selectEditor\` vs UISchema options:** The \`cellEditorParams\` fields mirror the connected-lookup UISchema options. \`allOptionsResourceName\` is the server DataServer/Request Server resource name, \`valueField\` is the column that becomes the cell value, \`labelField\` is what the user sees in the dropdown.
193
+
194
+ #### How the auto-commit works (internals — do NOT replicate manually inside EntityManagement)
195
+
196
+ The \`List\` component (inside EntityManagement) listens for \`cellEditRequest\` events (ag-Grid \`readOnlyEdit\` mode), fetches the \`updateEvent\` JSON schema, builds the full row payload filtered to schema fields, and calls:
197
+
198
+ \`\`\`ts
199
+ await this.connect.commitEvent(this.updateEvent, {
200
+ DETAILS: { ...schemaPayload, [editedField]: newValue },
201
+ });
202
+ \`\`\`
203
+
204
+ Error handling is also built in: on \`ERROR\` response the cell reverts to its old value and \`submit-failure\` is emitted on the \`EntityManagement\` component; on success \`submit-success\` is emitted.
205
+
206
+ The schema-filtered payload approach means only fields defined in the event's INBOUND schema are sent, even if the view contains extra joined columns (e.g. \`INSTRUMENT_NAME\` from a join). This prevents unexpected server rejection of unknown fields.
207
+
208
+ ---
209
+
210
+ ### Standalone GridPro — manual inline editing
211
+
212
+ When using \`RapidGridPro\` **without** EntityManagement, there is no built-in commit. You must wire it yourself via \`gridOptions.onCellEditingStopped\`. Also set \`autoCellRendererByType\` on the grid if you rely on metadata-derived editors (enum \`selectEditor\`, date editor, …) — without it the grid strips the auto-assigned \`cellEditor\`/\`cellRenderer\` from schema columns (default \`false\`; EntityManagement sets it for you):
213
+
214
+ \`\`\`tsx
215
+ import { getConnect, commitGenesisEvent } from '@genesislcap/foundation-comms';
216
+ import { EventTradeModify } from '../generated/genesis-event-types'; // typed DETAILS — PREFER when this file is listed (depth like store imports — e.g. ../../ from a route page)
217
+ import { GridProRendererTypes } from '@genesislcap/rapid-grid-pro';
218
+ import { RapidGridPro } from '@genesislcap/rapid-grid-pro/react';
219
+ import { GridProGenesisDatasource } from '@genesislcap/grid-pro/react';
220
+ import type { CellEditingStoppedEvent, ColDef, GridOptions } from '@ag-grid-community/core';
221
+ import { useMemo } from 'react';
222
+
223
+ // Column defs — same editable / cellEditor pattern as EntityManagement above
224
+ const columns: ColDef[] = [
225
+ {
226
+ field: 'QUANTITY',
227
+ editable: true,
228
+ cellEditor: GridProRendererTypes.numberEditor,
229
+ },
230
+ ];
231
+
232
+ function MyGrid() {
233
+ const gridOptions: GridOptions = useMemo(() => ({
234
+ onCellEditingStopped: async (event: CellEditingStoppedEvent) => {
235
+ if (!event.valueChanged) return;
236
+ const connect = getConnect();
237
+ // Typed commit — DETAILS is checked against the generated *Details type.
238
+ // PREFER when generated/genesis-event-types.ts is listed and EVENT_TRADE_MODIFY is in the map.
239
+ await commitGenesisEvent(connect, new EventTradeModify(event.data));
240
+ // Fallback (file absent or event not in the map; never create/edit it):
241
+ // await connect.commitEvent('EVENT_TRADE_MODIFY', { DETAILS: event.data });
242
+ },
243
+ }), []);
244
+
245
+ return (
246
+ <RapidGridPro gridOptions={gridOptions as any}>
247
+ <GridProGenesisDatasource resourceName="ALL_TRADES" />
248
+ </RapidGridPro>
249
+ );
250
+ }
251
+ \`\`\`
252
+
253
+ **Note:** Prefer the EntityManagement approach when you need CRUD — it handles error recovery, schema validation (only sends schema-allowed fields), and optimistic state updates automatically. Use the manual GridPro approach only when EntityManagement is not the right fit (e.g. display-only grids that need ad-hoc edits on a single field with a custom commit flow).
254
+
255
+ ---
256
+
257
+ ### Complete example — EntityManagement with mixed inline editors
258
+
259
+ \`\`\`tsx
260
+ import type { ColDef } from '@ag-grid-community/core';
261
+ import { EntityManagement } from '@genesislcap/foundation-entity-management/react';
262
+ import { GridProRendererTypes } from '@genesislcap/rapid-grid-pro';
263
+
264
+ const columns: ColDef[] = [
265
+ { field: 'TRADE_ID', headerName: 'ID' },
266
+ {
267
+ field: 'INSTRUMENT_ID',
268
+ headerName: 'Instrument',
269
+ editable: true,
270
+ valueFormatter: (params) => params.data?.INSTRUMENT_NAME ?? params.value,
271
+ cellEditor: GridProRendererTypes.selectEditor,
272
+ cellEditorParams: {
273
+ allOptionsResourceName: 'ALL_INSTRUMENTS', // verify this name first
274
+ valueField: 'INSTRUMENT_ID',
275
+ labelField: 'INSTRUMENT_NAME',
276
+ async: true,
277
+ allowCustomOptions: false,
278
+ },
279
+ },
280
+ {
281
+ field: 'QUANTITY',
282
+ headerName: 'Qty',
283
+ editable: true,
284
+ cellEditor: GridProRendererTypes.numberEditor,
285
+ },
286
+ {
287
+ field: 'TRADE_DATE',
288
+ headerName: 'Date',
289
+ editable: true,
290
+ cellEditor: GridProRendererTypes.dateEditor,
291
+ },
292
+ {
293
+ field: 'SIDE',
294
+ headerName: 'Side',
295
+ editable: true,
296
+ // ENUM — do NOT set cellEditor; auto-detected from server metadata
297
+ },
298
+ ];
299
+
300
+ export default function TradeGrid() {
301
+ return (
302
+ <EntityManagement
303
+ resourceName="ALL_TRADES"
304
+ updateEvent="EVENT_TRADE_MODIFY"
305
+ columns={columns}
306
+ hideEdit // hide the modal Edit button when using inline editing
307
+ enableSearchBar
308
+ />
309
+ );
310
+ }
311
+ \`\`\`
312
+
313
+ ---
314
+
315
+ ### DANGEROUS PATTERNS
316
+
317
+ #### DP-1: Adding \`cellEditor\` to ENUM fields
318
+
319
+ \`\`\`ts
320
+ // WRONG — overrides the auto-detected enum type and breaks the dropdown options:
321
+ { field: 'DIRECTION', editable: true, cellEditor: GridProRendererTypes.selectEditor }
322
+
323
+ // CORRECT — \`editable: true\` alone is sufficient; the grid auto-configures enum editors:
324
+ { field: 'DIRECTION', editable: true }
325
+ \`\`\`
326
+
327
+ #### DP-2: Manual \`commitEvent\` wiring inside EntityManagement
328
+
329
+ \`\`\`ts
330
+ // WRONG — EntityManagement's List component handles this internally:
331
+ // Adding gridOptions.onCellEditingStopped that calls connect.commitEvent will
332
+ // duplicate the internal commit and cause double-commits / race conditions.
333
+ const gridOptions = {
334
+ onCellEditingStopped: async (event) => {
335
+ await connect.commitEvent('EVENT_TRADE_MODIFY', { DETAILS: event.data });
336
+ }
337
+ };
338
+ // Then passing gridOptions to EntityManagement — DO NOT DO THIS.
339
+
340
+ // CORRECT — just set editable: true on columns. EntityManagement handles the rest.
341
+ // Only wire onCellEditingStopped manually for standalone GridPro (without EntityManagement).
342
+ \`\`\`
343
+
344
+ #### DP-3: Applying FK reference pattern to hidden columns
345
+
346
+ \`\`\`ts
347
+ // WRONG — configuring cellEditor on a hidden column:
348
+ { field: 'INSTRUMENT_ID', hide: true, editable: true, cellEditor: GridProRendererTypes.selectEditor }
349
+
350
+ // CORRECT — skip FK wiring for hidden fields; only apply to visible columns:
351
+ { field: 'INSTRUMENT_ID', hide: true }
352
+ \`\`\`
353
+
354
+ #### DP-4: Guessing \`allOptionsResourceName\`
355
+
356
+ \`\`\`ts
357
+ // WRONG — guessing the resource name from entity name alone:
358
+ cellEditorParams: { allOptionsResourceName: 'ALL_INSTRUMENTS' } // may not exist
359
+
360
+ // CORRECT — verify the resource name with vfs_list or by searching existing resourceName usages:
361
+ // grep for 'allOptionsResourceName' / 'resourceName' in existing column def files,
362
+ // or call query_project_schema('queries') to confirm Data Server resource names.
363
+ \`\`\`
364
+
365
+ #### DP-5: Wrong import path for GridProRendererTypes
366
+
367
+ \`\`\`ts
368
+ // WRONG — importing from the base grid-pro package or foundation-zero-grid-pro:
369
+ import { GridProRendererTypes } from '@genesislcap/grid-pro';
370
+ import { GridProRendererTypes } from '@genesislcap/foundation-zero-grid-pro';
371
+
372
+ // CORRECT — this app uses rapid-grid-pro which re-exports from grid-pro:
373
+ import { GridProRendererTypes } from '@genesislcap/rapid-grid-pro';
374
+ \`\`\`
375
+
376
+ #### DP-6: Not memoizing gridOptions that contain callbacks
377
+
378
+ \`\`\`tsx
379
+ // WRONG — creates a new gridOptions object on every render, causing grid re-initialization:
380
+ function MyGrid() {
381
+ const gridOptions = {
382
+ onCellEditingStopped: async (event) => { /* ... */ },
383
+ };
384
+ return <RapidGridPro gridOptions={gridOptions as any} />;
385
+ }
386
+
387
+ // CORRECT — wrap in useMemo so the reference is stable:
388
+ function MyGrid() {
389
+ const gridOptions = useMemo(() => ({
390
+ onCellEditingStopped: async (event: CellEditingStoppedEvent) => { /* ... */ },
391
+ }), []);
392
+ return <RapidGridPro gridOptions={gridOptions as any} />;
393
+ }
394
+ \`\`\`
395
+
396
+ #### DP-7: Expecting enum auto-editors on a standalone RapidGridPro
397
+
398
+ \`\`\`tsx
399
+ // WRONG — on a standalone grid, editable:true alone gives the plain AG text editor
400
+ // for enum fields: without autoCellRendererByType the grid strips the
401
+ // metadata-derived cellEditor/cellRenderer from schema columns.
402
+ <RapidGridPro>
403
+ <GridProGenesisDatasource resourceName="ALL_TRADES" />
404
+ </RapidGridPro>
405
+ // with column: { field: 'SIDE', editable: true }
406
+
407
+ // CORRECT — enable auto renderers/editors by type on standalone grids:
408
+ <RapidGridPro autoCellRendererByType>
409
+ <GridProGenesisDatasource resourceName="ALL_TRADES" />
410
+ </RapidGridPro>
411
+ // (EntityManagement sets auto-cell-renderer-by-type internally — no action needed there.)
412
+ \`\`\`
413
+
414
+ #### DP-8: Using \`allowCustomOptions\` on multiselectEditor
415
+
416
+ \`\`\`ts
417
+ // WRONG — allowCustomOptions does not exist on MultiselectEditorParams:
418
+ {
419
+ field: 'TAGS',
420
+ editable: true,
421
+ cellEditor: GridProRendererTypes.multiselectEditor,
422
+ cellEditorParams: {
423
+ allOptionsResourceName: 'ALL_TAGS',
424
+ valueField: 'TAG_ID',
425
+ labelField: 'TAG_NAME',
426
+ async: true,
427
+ allowCustomOptions: true, // DOES NOT EXIST on multiselectEditor
428
+ },
429
+ }
430
+
431
+ // CORRECT — allowCustomOptions is only valid on selectEditor, not multiselectEditor:
432
+ {
433
+ field: 'TAGS',
434
+ editable: true,
435
+ cellEditor: GridProRendererTypes.multiselectEditor,
436
+ cellEditorParams: {
437
+ allOptionsResourceName: 'ALL_TAGS',
438
+ valueField: 'TAG_ID',
439
+ labelField: 'TAG_NAME',
440
+ async: true,
441
+ // No allowCustomOptions here
442
+ },
443
+ }
444
+ \`\`\`
445
+ `.trim();