toga-ai 1.0.203 → 1.0.204

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.
@@ -4,7 +4,7 @@
4
4
  |-----|---------|-------|
5
5
  | [TOGa 2.5 Supply — Architecture](architecture.md) | `toga25-supply` ("TOGa 2.5 Supply") is the **React/TypeScript frontend** for the 2.0 Supply application — an iteration and improvement of `toga2-supply`. | toga25-supply/src/main.tsx, toga25-supply/src/App.tsx, toga25-supply/src/routes.tsx, toga25-supply/src/fieldsConfig/index.ts, toga25-supply/src/fieldsConfig/useClientFields.ts, toga25-supply/src/layout/, toga25-supply/src/pages/, toga25-supply/src/hooks/useTableCellInteractions.ts |
6
6
  | [Action-Button Rule Engine (Flag / Rule grammar)](features/action-button-rule-engine.md) | A declarative, fully config-driven rule engine that resolves the boolean-ish flags (`isEnabled`, `isVisible`, `isComplete`) on SalesOrder action-button options. | toga25-supply/src/pages/SalesOrders/helpers/evaluateEnableRule.ts, toga25-supply/src/pages/SalesOrders/helpers/buildPatchedTenantFields.ts, toga25-supply/src/pages/SalesOrders/view/SalesOrderRecordModalLayout/viewModel/useSalesOrderRecordModalLayoutModel.tsx, toga25-supply/src/pages/SalesOrders/view/SalesOrderApprovalModalsLayout/viewModel/useApprovalModalViewModel.tsx |
7
- | [Client-Configurable Fields (useClientFields / fieldsConfig)](features/client-configurable-fields.md) | The mechanism for config that **varies by client** (or client × role) — field overrides, filter buttons, group-by options, column pickers, layout toggles — with | toga25-supply/src/fieldsConfig/index.ts, toga25-supply/src/fieldsConfig/useClientFields.ts, toga25-supply/src/pages/SalesOrders/viewModel/FIELDS/, toga25-supply/src/pages/Inventory/viewModel/FIELDS/, toga25-supply/src/pages/Inventory/README.md, toga25-supply/src/layout/ItemRecordModalLayout/viewModel/FIELDS/, toga25-supply/src/layout/VendorItemRecordModalLayout/viewModel/FIELDS/ |
7
+ | [Client-Configurable Fields (useClientFields / fieldsConfig)](features/client-configurable-fields.md) | The mechanism for config that **varies by client** (or client × role) — field overrides, filter buttons, group-by options, column pickers, layout toggles — with | toga25-supply/src/fieldsConfig/index.ts, toga25-supply/src/fieldsConfig/useClientFields.ts, toga25-supply/src/pages/SalesOrders/viewModel/FIELDS/, toga25-supply/src/pages/Inventory/viewModel/FIELDS/, toga25-supply/src/pages/Inventory/README.md, toga25-supply/src/layout/ItemRecordModalLayout/viewModel/FIELDS/, toga25-supply/src/layout/VendorItemRecordModalLayout/viewModel/FIELDS/, toga25-supply/src/pages/SalesOrders/view/SalesOrderRecordModalLayout/view/sections/SalesOrderTopBar.tsx, toga25-supply/src/pages/SalesOrders/view/SalesOrderRecordModalLayout/viewModel/FIELDS/ |
8
8
  | [Column Visibility (URL-driven show/hide columns)](features/column-visibility.md) | A "Columns" header button that opens a modal listing every column from the table meta, lets the user show/hide columns, adjusts the table live, and persists the | toga25-supply/src/components/ColumnVisibilityModal/, toga25-supply/src/pages/SalesOrders/SalesOrders.tsx, toga25-supply/src/pages/SalesOrders/viewModel/useSalesOrdersPageViewModel.tsx, toga25-supply/src/pages/SalesOrders/hooks/useSalesOrdersTableData.tsx |
9
9
  | [Meta-Driven Page & Table Setup](features/meta-driven-table-data.md) | A page in this app is **meta-driven end to end**: the page view model fetches *page meta* (labels, sections, ACL) and *table meta* (the columns/fields + table s | toga25-supply/src/pages/SalesOrders/viewModel/useSalesOrdersPageViewModel.tsx, toga25-supply/src/pages/SalesOrders/hooks/useSalesOrdersTableState.ts, toga25-supply/src/hooks/useTablePageMeta.ts, toga-blox-npm/dist/hooks/useFetchPageMeta.d.ts, toga-blox-npm/dist/hooks/useFetchTablePageMeta.d.ts, toga-blox-npm/dist/hooks/useAssignTableFieldLabels.d.ts, toga-blox-npm/dist/components/Table/hooks/useTableData.d.ts |
10
10
  | [Record Modals & Nested Tables](features/record-modals-and-nested-tables.md) | The repo's family of modal + nested-table patterns layered over toga-blox `TableRecordModal` and `PrimaryTable*Layout`. | toga25-supply/src/layout/ItemRecordModalLayout/, toga25-supply/src/layout/SalesOrderRecordModalLayout/, toga25-supply/src/layout/SalesOrderItemsTableLayout/, toga25-supply/src/layout/ItemFulfillmentModal/, toga25-supply/src/layout/GenericNestedTables/, toga25-supply/src/hooks/useTableCellInteractions.ts |
@@ -16,6 +16,8 @@ files:
16
16
  - toga25-supply/src/pages/Inventory/README.md
17
17
  - toga25-supply/src/layout/ItemRecordModalLayout/viewModel/FIELDS/
18
18
  - toga25-supply/src/layout/VendorItemRecordModalLayout/viewModel/FIELDS/
19
+ - toga25-supply/src/pages/SalesOrders/view/SalesOrderRecordModalLayout/view/sections/SalesOrderTopBar.tsx
20
+ - toga25-supply/src/pages/SalesOrders/view/SalesOrderRecordModalLayout/viewModel/FIELDS/
19
21
  related:
20
22
  - ../architecture.md
21
23
  - column-visibility.md
@@ -70,6 +72,29 @@ registry that maps enum → real value (e.g. `MODAL_RENDERERS: Record<ModalKey,
70
72
  This is the one place app-owned JSX is grafted back onto client-authored config. Clients never
71
73
  author JSX.
72
74
 
75
+ ### Presentation intent: `kind` / `variant` (SalesOrder action buttons)
76
+
77
+ SalesOrder record-modal action buttons (`recordActionFields.actionOptions[]`, rendered by
78
+ `SalesOrderTopBar.tsx`) split **presentation** from **identity** so rendering is config-driven,
79
+ not branch-on-`valueKey`:
80
+
81
+ - **`kind`** chooses the renderer: `"icon"` (generic icon button), `"text"` (pill), or a
82
+ registry key like `"viewLog"` that maps to a dedicated component.
83
+ - **`variant`** chooses color from a **closed set** — `approve` / `deny` / `approvalWorkflow` /
84
+ `neutral` — via a `variantClass` lookup. Keying on this small vocabulary (not on each business
85
+ key) is what makes it scale.
86
+ - **`valueKey`** is decoupled: it is **only** the click-dispatch identity (`onActionClick(valueKey)`),
87
+ never a rendering switch. A new button reusing an existing `kind` + `variant` is **config-only** —
88
+ no edit to `SalesOrderTopBar.tsx`.
89
+
90
+ A `componentRegistry: Record<kind, (opt) => ReactNode>` in `SalesOrderTopBar` is the hydration
91
+ point for **whole components**: `const renderSpecial = componentRegistry[opt.kind]; if (renderSpecial)
92
+ return renderSpecial(opt);` short-circuits the generic icon/text branches to render a dedicated
93
+ component (e.g. `viewLog` → `<ViewLogButton label onOpenLog={onOpenLog} />`), with the handler wired
94
+ in one place. Same enum→non-serializable boundary as `MODAL_RENDERERS`, applied to components — keep
95
+ runtime-only signals (e.g. PO-complete) gated by config presence (`!!opt.completedLabel`) rather than
96
+ by `valueKey`.
97
+
73
98
  ### Record-modal header & action config
74
99
 
75
100
  Record-modal layouts (`ItemRecordModalLayout`, `VendorItemRecordModalLayout`) now drive the
@@ -108,11 +133,17 @@ modal's chrome from the same per-client JSON, not from the component:
108
133
  `fieldsConfig/index.ts`, derive the default defensively rather than assuming the wrapper exists:
109
134
  `const DEFAULT_ORDER_VIEW_FIELDS = (defaultBundle as any).DEFAULT ?? (defaultBundle as any) ?? {};`
110
135
  — fall through to the bundle itself, then `{}`, so a flat JSON file does not resolve to `undefined`.
136
+ - **`recordActionFields` shape.** A client `orderViewFields.json` can hold **multiple per-persona
137
+ `recordActionFields` blocks**, plus a sibling `recordActionFields.poNumber` object that configures
138
+ the Enter-PO modal fields — its nested `valueKey`s are **not** action buttons. `DEFAULT/orderViewFields.json`
139
+ has no `recordActionFields` at all. Any tooling that walks action buttons must scope strictly to the
140
+ `actionOptions` array.
111
141
  - Worked examples: `salesOrdersPageFields` (client × role) and `inventoryGroupings` (client-only +
112
142
  hydration; full write-up in `src/pages/Inventory/README.md`); `itemRecordViewFields` /
113
143
  `vendorItemRecordViewFields` are record-modal-layout examples living under `src/layout/.../viewModel/FIELDS/`.
114
144
 
115
145
  ## Change history
146
+ - 2026-06-25 — SalesOrder action buttons render by presentation intent: `kind` (icon/text/viewLog) picks the renderer, `variant` a closed color set, `valueKey` is pure click-dispatch; a `componentRegistry` keyed by `kind` hydrates dedicated components (e.g. ViewLogButton). Added the `recordActionFields`-shape gotcha (per-persona blocks + sibling `poNumber` sub-config; walk `actionOptions` only). (apeterson)
116
147
  - 2026-06-25 — Extended to record-modal layouts: per-mode `*ViewFields`/`*EditFields` JSON under `src/layout/.../viewModel/FIELDS/`, JSON-driven modal `header` (modalTag/labelTemplate/statusBadge) + `editItem` button gated via the Flag/Rule engine, and the flat-bundle defensive-default gotcha. (apeterson)
117
148
  - 2026-06-23 — Documented from the `add-client-fields` skill during initial knowledge seed. (apeterson)
118
149
  - 2026-06-25 — Client field JSON also lives under `src/layout/<Modal>/viewModel/FIELDS/<CLIENT>/`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toga-ai",
3
- "version": "1.0.203",
3
+ "version": "1.0.204",
4
4
  "description": "TOGA Technology Team Claude Knowledge System — shared AI coding harness with skills, knowledge base CLI, and project installer for Claude Code.",
5
5
  "keywords": [
6
6
  "claude",