From b44b10a912fe1300cda71820058ac727c1c16d3b Mon Sep 17 00:00:00 2001 From: Jeremias Date: Thu, 3 Dec 2026 19:44:19 +0100 Subject: [PATCH 1/6] feat(testing-view): highlight measurements that trigger a protection Subscribe to protection/update and keep the last protection of each measurement, keyed by the low 13 bits of the compound protection id. The measurement row turns red with a shield icon until the messages are cleared, since the new protocol sends no recovery event. Measurements are matched by a new optional Variable.adjId (numeric ADJ id), which the new adj/DataPackets catalog has to fill. --- frontend/testing-view/src/App.tsx | 9 ++ .../rightSidebar/sections/MessagesSection.tsx | 2 + .../tabs/telemetry/VariableItem.tsx | 23 +++- .../slices/__tests__/messagesSlice.test.ts | 106 ++++++++++++++++++ .../src/store/slices/messagesSlice.ts | 21 +++- .../testing-view/src/types/data/protection.ts | 25 +++++ .../src/types/data/telemetryCatalogItem.ts | 5 + 7 files changed, 189 insertions(+), 2 deletions(-) create mode 100644 frontend/testing-view/src/store/slices/__tests__/messagesSlice.test.ts create mode 100644 frontend/testing-view/src/types/data/protection.ts diff --git a/frontend/testing-view/src/App.tsx b/frontend/testing-view/src/App.tsx index ebe5212d6..9785243cd 100644 --- a/frontend/testing-view/src/App.tsx +++ b/frontend/testing-view/src/App.tsx @@ -14,6 +14,7 @@ import { Testing } from "./pages/Testing"; import { useStore } from "./store/store"; import type { Connection } from "./types/common/connection"; import type { MessagePacket } from "./types/data/message"; +import type { ProtectionUpdate } from "./types/data/protection"; import type { TelemetryData } from "./types/telemetry/telemetry"; function App() { @@ -63,6 +64,14 @@ function App() { }); }); + // Callback executed when a protection triggers + const addProtection = useStore((s) => s.addProtection); + + // Subscribe to protections, to highlight the measurement that triggered them + useTopic("protection/update", (protection) => { + addProtection(protection); + }); + return ( diff --git a/frontend/testing-view/src/features/workspace/components/rightSidebar/sections/MessagesSection.tsx b/frontend/testing-view/src/features/workspace/components/rightSidebar/sections/MessagesSection.tsx index 533c592c8..f8c39c1a1 100644 --- a/frontend/testing-view/src/features/workspace/components/rightSidebar/sections/MessagesSection.tsx +++ b/frontend/testing-view/src/features/workspace/components/rightSidebar/sections/MessagesSection.tsx @@ -24,6 +24,8 @@ const MessagesSection = () => { variant="secondary" size="icon" className="text-muted-foreground hover:text-destructive h-6 w-6" + title="Clear messages and protections" + aria-label="Clear messages and protections" onClick={clearMessages} > diff --git a/frontend/testing-view/src/features/workspace/components/rightSidebar/tabs/telemetry/VariableItem.tsx b/frontend/testing-view/src/features/workspace/components/rightSidebar/tabs/telemetry/VariableItem.tsx index 6ea4396dc..08ea6c402 100644 --- a/frontend/testing-view/src/features/workspace/components/rightSidebar/tabs/telemetry/VariableItem.tsx +++ b/frontend/testing-view/src/features/workspace/components/rightSidebar/tabs/telemetry/VariableItem.tsx @@ -1,6 +1,7 @@ import { useDraggable } from "@dnd-kit/core"; import { Badge } from "@hyperloopupv/frontend-kit"; import { cn } from "@hyperloopupv/frontend-kit/lib"; +import { Shield } from "lucide-react"; import { useShallow } from "zustand/shallow"; import { canAddSeriesToChart, @@ -34,6 +35,13 @@ export const VariableItem = ({ packetId, variable }: VariableItemProps) => { })), ); + // A protection triggered on this measurement and the messages weren't cleared since + const isProtected = useStore( + (s) => + variable.adjId !== undefined && + s.activeProtections[variable.adjId] !== undefined, + ); + const { attributes, listeners, setNodeRef, transform, isDragging } = useDraggable({ id: `draggable-${packetId}-${variable.id}`, @@ -89,6 +97,7 @@ export const VariableItem = ({ packetId, variable }: VariableItemProps) => { {...listeners} className={cn( "hover:bg-accent/30 group flex items-center justify-between gap-3 border-t py-2 pl-6 pr-3", + isProtected && "bg-red-500/15 hover:bg-red-500/25", opacityStyle, cursorStyle, )} @@ -105,9 +114,21 @@ export const VariableItem = ({ packetId, variable }: VariableItemProps) => { {variable.type} + {/* Protection Icon */} + {isProtected && ( + + + + )} + {/* Variable Name */}
- + {variable.name} diff --git a/frontend/testing-view/src/store/slices/__tests__/messagesSlice.test.ts b/frontend/testing-view/src/store/slices/__tests__/messagesSlice.test.ts new file mode 100644 index 000000000..0c512a4be --- /dev/null +++ b/frontend/testing-view/src/store/slices/__tests__/messagesSlice.test.ts @@ -0,0 +1,106 @@ +import { beforeEach, describe, expect, it } from "vitest"; +import { create } from "zustand"; +import { createChartsSlice } from "../../../features/charts/store/chartsSlice"; +import { createFilteringSlice } from "../../../features/filtering/store/filteringSlice"; +import { createRightSidebarSlice } from "../../../features/workspace/store/rightSidebarSlice"; +import { createWorkspacesSlice } from "../../../features/workspace/store/workspacesSlice"; +import type { Message } from "../../../types/data/message"; +import type { ProtectionUpdate } from "../../../types/data/protection"; +import type { Store } from "../../store"; +import { createAppSlice } from "../appSlice"; +import { createCatalogSlice } from "../catalogSlice"; +import { createConnectionsSlice } from "../connectionsSlice"; +import { createMessagesSlice } from "../messagesSlice"; +import { createTelemetrySlice } from "../telemetrySlice"; + +const createTestStore = () => + create()((...a) => ({ + ...createAppSlice(...a), + ...createCatalogSlice(...a), + ...createWorkspacesSlice(...a), + ...createTelemetrySlice(...a), + ...createRightSidebarSlice(...a), + ...createConnectionsSlice(...a), + ...createMessagesSlice(...a), + ...createChartsSlice(...a), + ...createFilteringSlice(...a), + })); + +/** Protection number `position` (1-7) of the measurement `measurementId`. */ +const protection = ( + position: number, + measurementId: number, + value: ProtectionUpdate["value"] = 105.5, +): ProtectionUpdate => ({ + id: (position << 13) | measurementId, + value, + timestamp: { hour: 12, minute: 30, second: 6, subsecond: 0 }, +}); + +const MESSAGE: Message = { + id: "message-1", + kind: "info", + board: "LCU", + name: "Example", + payload: "Example message", + timestamp: { + counter: 0, + second: 0, + minute: 0, + hour: 12, + day: 1, + month: 1, + year: 2026, + }, +}; + +let store: ReturnType; + +beforeEach(() => { + store = createTestStore(); +}); + +describe("addProtection", () => { + it("activates the measurement in the low 13 bits of the protection id", () => { + store.getState().addProtection(protection(1, 3000)); + + expect(Object.keys(store.getState().activeProtections)).toEqual(["3000"]); + expect(store.getState().activeProtections[3000].id).toBe(11192); + }); + + it("keeps the last protection when several protections of one measurement trigger", () => { + store.getState().addProtection(protection(1, 3000, 105.5)); + store.getState().addProtection(protection(2, 3000, 5)); + + expect(Object.keys(store.getState().activeProtections)).toEqual(["3000"]); + expect(store.getState().activeProtections[3000].value).toBe(5); + }); + + it("keeps the protections of different measurements apart", () => { + store.getState().addProtection(protection(1, 3000)); + store.getState().addProtection(protection(1, 3001)); + + expect(Object.keys(store.getState().activeProtections)).toEqual([ + "3000", + "3001", + ]); + }); + + it("does not add messages", () => { + store.getState().addProtection(protection(1, 3000)); + + expect(store.getState().messages).toEqual([]); + }); +}); + +describe("clearMessages", () => { + it("clears the messages and the active protections", () => { + store.getState().addMessage(MESSAGE); + store.getState().addProtection(protection(1, 3000)); + + store.getState().clearMessages(); + + expect(store.getState().messages).toEqual([]); + expect(store.getState().activeProtections).toEqual({}); + }); +}); diff --git a/frontend/testing-view/src/store/slices/messagesSlice.ts b/frontend/testing-view/src/store/slices/messagesSlice.ts index 0a9b2d898..87278f7ee 100644 --- a/frontend/testing-view/src/store/slices/messagesSlice.ts +++ b/frontend/testing-view/src/store/slices/messagesSlice.ts @@ -1,11 +1,22 @@ import type { StateCreator } from "zustand"; import { config } from "../../../config"; import type { Message } from "../../types/data/message"; +import type { ProtectionUpdate } from "../../types/data/protection"; import type { Store } from "../store"; +/** The low 13 bits of a protection id are the id of the measurement it watches. */ +const MEASUREMENT_ID_MASK = 0x1fff; + export interface MessagesSlice { messages: Message[]; addMessage: (message: Message) => void; + /** + * Last protection received for each measurement, by the measurement's numeric ADJ id.\ + * Those measurements are highlighted until the messages are cleared. + */ + activeProtections: Record; + addProtection: (protection: ProtectionUpdate) => void; + /** Clears the messages and the active protections */ clearMessages: () => void; } @@ -20,5 +31,13 @@ export const createMessagesSlice: StateCreator = ( config.MAX_MESSAGES_COUNT, ), })), - clearMessages: () => set({ messages: [] }), + activeProtections: {}, + addProtection: (protection) => + set((state) => ({ + activeProtections: { + ...state.activeProtections, + [protection.id & MEASUREMENT_ID_MASK]: protection, + }, + })), + clearMessages: () => set({ messages: [], activeProtections: {} }), }); diff --git a/frontend/testing-view/src/types/data/protection.ts b/frontend/testing-view/src/types/data/protection.ts new file mode 100644 index 000000000..c7acd27d5 --- /dev/null +++ b/frontend/testing-view/src/types/data/protection.ts @@ -0,0 +1,25 @@ +/** + * Time of day at which the board detected the protection.\ + * It carries no date: it is the day the protection was received. + */ +export type ProtectionTimestamp = { + hour: number; + minute: number; + second: number; + /** Raw sub-second byte from the board (its unit is not settled yet) */ + subsecond: number; +}; + +/** + * Protection event as it arrives from the backend on `protection/update`. + */ +export type ProtectionUpdate = { + /** + * Compound id: `(position << 13) | measurementId`.\ + * The low 13 bits are the numeric ADJ id of the measurement that triggered it. + */ + id: number; + /** Value of the measurement that triggered the protection */ + value: number | boolean | string; + timestamp: ProtectionTimestamp; +}; diff --git a/frontend/testing-view/src/types/data/telemetryCatalogItem.ts b/frontend/testing-view/src/types/data/telemetryCatalogItem.ts index 3d8532a11..f0653db79 100644 --- a/frontend/testing-view/src/types/data/telemetryCatalogItem.ts +++ b/frontend/testing-view/src/types/data/telemetryCatalogItem.ts @@ -8,6 +8,11 @@ export type Variable = { name: string; type: string; units?: string; + /** + * Numeric id of the measurement in the ADJ.\ + * Protections point to the measurement they watch by this id. + */ + adjId?: number; }; export interface NumericVariable extends Variable { From 5a48533abb60f33b9b9d44411cc6ef4721972121 Mon Sep 17 00:00:00 2001 From: Jeremias Date: Fri, 4 Dec 2026 18:16:31 +0100 Subject: [PATCH 2/6] feat(testing-view): adapt catalogs to the new backend HTTP endpoints - Fetch packets, orders and protections from adj/DataPackets, adj/OrderPackets and adj/ProtectionPackets - Identify measurements by alias and command params by a measurements array with their protections instead of safe/warning ranges - Show triggered protections as messages and categorize messages by the topic they arrive on (message/update, backend/update) - Update mocks to the new shapes --- frontend/testing-view/src/App.tsx | 34 +- .../components/AddKeyBindingDialog.tsx | 20 +- .../keyBindings/hooks/useGlobalKeyBindings.ts | 31 +- .../tabs/commands/CommandItem.tsx | 29 +- .../tabs/commands/CommandParameters.tsx | 85 +- .../tabs/telemetry/VariableItem.tsx | 35 +- .../testing-view/src/hooks/useAppConfigs.ts | 11 +- frontend/testing-view/src/hooks/useLogger.ts | 2 +- frontend/testing-view/src/lib/commandUtils.ts | 38 +- frontend/testing-view/src/lib/utils.test.ts | 61 + frontend/testing-view/src/lib/utils.ts | 72 +- frontend/testing-view/src/mocks/commands.ts | 716 ++++++---- frontend/testing-view/src/mocks/telemetry.ts | 1254 ++++++++--------- .../src/types/data/commandCatalogItem.ts | 44 +- .../testing-view/src/types/data/protection.ts | 20 + .../src/types/data/telemetryCatalogItem.ts | 35 +- 16 files changed, 1355 insertions(+), 1132 deletions(-) diff --git a/frontend/testing-view/src/App.tsx b/frontend/testing-view/src/App.tsx index 9785243cd..c6b230c33 100644 --- a/frontend/testing-view/src/App.tsx +++ b/frontend/testing-view/src/App.tsx @@ -9,6 +9,7 @@ import { useAppMode } from "./hooks/useAppMode"; import { useErrorHandler } from "./hooks/useErrorHandler"; import { useTransformedBoards } from "./hooks/useTransformedBoards"; import { AppLayout } from "./layout/AppLayout"; +import { protectionToMessage } from "./lib/utils"; import { Logs } from "./pages/Logs"; import { Testing } from "./pages/Testing"; import { useStore } from "./store/store"; @@ -22,7 +23,8 @@ function App() { const { reportError } = useErrorHandler(); // Fetch app configs - const { packets, commands, isLoading } = useAppConfigs(isConnected); + const { packets, commands, protections, isLoading } = + useAppConfigs(isConnected); // Determine app mode useAppMode(packets, commands, isLoading); @@ -56,20 +58,34 @@ function App() { // Callback executed when messages are received const addMessage = useStore((s) => s.addMessage); - useTopic("message/update", (data) => { - console.log("Message received:", data); - addMessage({ - ...data, - id: crypto.randomUUID(), - }); - }); + // The backend doesn't send the category: it's the topic the message arrives on + const handleMessage = + (category: MessagePacket["category"]) => (data: MessagePacket) => { + console.log("Message received:", data); + addMessage({ + ...data, + category, + id: crypto.randomUUID(), + }); + }; + + // Each message category arrives on its own topic + useTopic("message/update", handleMessage("message")); + useTopic("backend/update", handleMessage("backend")); // Callback executed when a protection triggers const addProtection = useStore((s) => s.addProtection); - // Subscribe to protections, to highlight the measurement that triggered them + // Protections highlight the measurement that triggered them and are shown as messages useTopic("protection/update", (protection) => { addProtection(protection); + handleMessage("protection")( + protectionToMessage( + protection, + protections?.protections ?? [], + useStore.getState().telemetryCatalog, + ), + ); }); return ( diff --git a/frontend/testing-view/src/features/keyBindings/components/AddKeyBindingDialog.tsx b/frontend/testing-view/src/features/keyBindings/components/AddKeyBindingDialog.tsx index 77844d240..8529b833c 100644 --- a/frontend/testing-view/src/features/keyBindings/components/AddKeyBindingDialog.tsx +++ b/frontend/testing-view/src/features/keyBindings/components/AddKeyBindingDialog.tsx @@ -17,7 +17,10 @@ import { } from "@hyperloopupv/frontend-kit"; import { X } from "@hyperloopupv/frontend-kit/icons"; import { useEffect, useRef, useState } from "react"; -import { getDefaultParameterValues } from "../../../lib/commandUtils"; +import { + getDefaultParameterValues, + getParameterKind, +} from "../../../lib/commandUtils"; import { useStore } from "../../../store/store"; import type { CommandCatalogItem } from "../../../types/data/commandCatalogItem"; import { CommandParameters } from "../../workspace/components/rightSidebar/tabs/commands/CommandParameters"; @@ -56,7 +59,7 @@ export const AddKeyBindingDialog = ({ : null; const hasParameters = selectedCommand - ? Object.keys(selectedCommand.fields).length > 0 + ? selectedCommand.measurements.length > 0 : false; // Reset state when dialog closes @@ -73,7 +76,7 @@ export const AddKeyBindingDialog = ({ useEffect(() => { if (selectedCommand) { const defaults: Record = getDefaultParameterValues( - selectedCommand.fields, + selectedCommand.measurements, ); setParameterValues(defaults); } @@ -124,9 +127,10 @@ export const AddKeyBindingDialog = ({ const hasInvalidNumericParams = selectedCommand !== null && selectedCommand !== undefined && - Object.entries(selectedCommand.fields).some( - ([key, field]) => - field.kind === "numeric" && isNaN(parseFloat(parameterValues[key])), + selectedCommand.measurements.some( + (field) => + getParameterKind(field) === "numeric" && + isNaN(parseFloat(parameterValues[field.alias])), ); const canSubmit = @@ -199,12 +203,12 @@ export const AddKeyBindingDialog = ({
- {Object.keys(selectedCommand.fields).length} parameter(s) + {selectedCommand.measurements.length} parameter(s)
diff --git a/frontend/testing-view/src/features/keyBindings/hooks/useGlobalKeyBindings.ts b/frontend/testing-view/src/features/keyBindings/hooks/useGlobalKeyBindings.ts index 9a46c26e0..e9898b16b 100644 --- a/frontend/testing-view/src/features/keyBindings/hooks/useGlobalKeyBindings.ts +++ b/frontend/testing-view/src/features/keyBindings/hooks/useGlobalKeyBindings.ts @@ -1,7 +1,11 @@ import { logger, socketService } from "@hyperloopupv/frontend-kit/core"; import { useEffect } from "react"; import { useLogger } from "../../../hooks/useLogger"; -import { getDefaultParameterValues } from "../../../lib/commandUtils"; +import { + getDefaultParameterValues, + getFieldType, + getParameterKind, +} from "../../../lib/commandUtils"; import { useStore } from "../../../store/store"; import type { CommandCatalogItem } from "../../../types/data/commandCatalogItem"; import { @@ -76,22 +80,29 @@ export const useGlobalKeyBindings = () => { // Build payload with binding's configured parameters const payload = { id: commandToExecute.id, - fields: Object.entries(commandToExecute.fields).reduce( - (acc, [fieldKey, field]) => { + fields: commandToExecute.measurements.reduce( + (acc, field) => { + const fieldKey = field.alias; + // Use binding's parameter value or fall back to default let value = parameterValues[fieldKey]; // If no value in binding, use field defaults if (value === undefined) { - value = getDefaultParameterValues(commandToExecute.fields)[ - fieldKey - ]; + value = getDefaultParameterValues( + commandToExecute.measurements, + )[fieldKey]; } const numericValue = - field.kind === "numeric" ? parseFloat(value) : value; - - if (field.kind === "numeric" && isNaN(numericValue as number)) { + getParameterKind(field) === "numeric" + ? parseFloat(value) + : value; + + if ( + getParameterKind(field) === "numeric" && + isNaN(numericValue as number) + ) { logger.testingView.warn( `Skipping command: numeric field "${fieldKey}" has no valid value`, ); @@ -101,7 +112,7 @@ export const useGlobalKeyBindings = () => { acc[fieldKey] = { value: numericValue, isEnabled: true, - type: field.type, + type: getFieldType(field), }; return acc; }, diff --git a/frontend/testing-view/src/features/workspace/components/rightSidebar/tabs/commands/CommandItem.tsx b/frontend/testing-view/src/features/workspace/components/rightSidebar/tabs/commands/CommandItem.tsx index 70518b8bd..f1032e320 100644 --- a/frontend/testing-view/src/features/workspace/components/rightSidebar/tabs/commands/CommandItem.tsx +++ b/frontend/testing-view/src/features/workspace/components/rightSidebar/tabs/commands/CommandItem.tsx @@ -8,7 +8,11 @@ import { import { ChevronDown, Play, Send } from "@hyperloopupv/frontend-kit/icons"; import { cn } from "@hyperloopupv/frontend-kit/lib"; import { useState } from "react"; -import { getDefaultParameterValues } from "../../../../../../lib/commandUtils"; +import { + getDefaultParameterValues, + getFieldType, + getParameterKind, +} from "../../../../../../lib/commandUtils"; import { useStore } from "../../../../../../store/store"; import type { CommandCatalogItem } from "../../../../../../types/data/commandCatalogItem"; import { CommandParameters } from "./CommandParameters"; @@ -27,16 +31,16 @@ export const CommandItem = ({ item: commandCatalogItem }: CommandItemProps) => { ); const [parameterValues, setParameterValues] = useState>( - () => getDefaultParameterValues(commandCatalogItem.fields), + () => getDefaultParameterValues(commandCatalogItem.measurements), ); - const paramCount = Object.keys(commandCatalogItem.fields).length; + const paramCount = commandCatalogItem.measurements.length; const hasParameters = paramCount > 0; - const hasInvalidNumeric = Object.entries(commandCatalogItem.fields).some( - ([key, field]) => - field.kind === "numeric" && - !Number.isFinite(parseFloat(parameterValues[key])), + const hasInvalidNumeric = commandCatalogItem.measurements.some( + (field) => + getParameterKind(field) === "numeric" && + !Number.isFinite(parseFloat(parameterValues[field.alias])), ); const handleRun = (e: React.MouseEvent) => { @@ -45,15 +49,16 @@ export const CommandItem = ({ item: commandCatalogItem }: CommandItemProps) => { const payload = { id: commandCatalogItem.id, - fields: Object.entries(commandCatalogItem.fields).reduce( - (acc, [key, field]) => { + fields: commandCatalogItem.measurements.reduce( + (acc, field) => { + const key = field.alias; acc[key] = { value: - field.kind === "numeric" + getParameterKind(field) === "numeric" ? parseFloat(parameterValues[key]) : parameterValues[key], isEnabled: true, // Set to true by default, could be implemented in the future, but does not really make any sense for me - type: field.type, + type: getFieldType(field), }; return acc; }, @@ -133,7 +138,7 @@ export const CommandItem = ({ item: commandCatalogItem }: CommandItemProps) => {
diff --git a/frontend/testing-view/src/features/workspace/components/rightSidebar/tabs/commands/CommandParameters.tsx b/frontend/testing-view/src/features/workspace/components/rightSidebar/tabs/commands/CommandParameters.tsx index e7b8e32f4..8e5950306 100644 --- a/frontend/testing-view/src/features/workspace/components/rightSidebar/tabs/commands/CommandParameters.tsx +++ b/frontend/testing-view/src/features/workspace/components/rightSidebar/tabs/commands/CommandParameters.tsx @@ -8,14 +8,16 @@ import { SelectTrigger, SelectValue, } from "@hyperloopupv/frontend-kit"; -import type { - CommandParameter, - EnumCommandParameter, - NumericCommandParameter, -} from "../../../../../../types/data/commandCatalogItem"; +import { + getEnumOptions, + getFieldType, + getParameterKind, +} from "../../../../../../lib/commandUtils"; +import { describeCondition } from "../../../../../../lib/utils"; +import type { CommandParameter } from "../../../../../../types/data/commandCatalogItem"; interface CommandParametersProps { - fields: Record; + fields: CommandParameter[]; values: Record; onChange: (fieldId: string, value: any) => void; } @@ -26,63 +28,58 @@ export const CommandParameters = ({ onChange, }: CommandParametersProps) => { const renderParameterInput = (field: CommandParameter) => { - if (field.kind === "numeric") { - const numField = field as NumericCommandParameter; - const minSafeRange = numField.safeRange[0]; - const maxSafeRange = numField.safeRange[1]; - const minWarningRange = numField.warningRange[0]; - const maxWarningRange = numField.warningRange[1]; + const kind = getParameterKind(field); + if (kind === "numeric") { return ( -
+
onChange(field.id, e.target.value)} + placeholder={getFieldType(field)} + value={values[field.alias] ?? ""} + onChange={(e) => onChange(field.alias, e.target.value)} onWheel={(e) => e.currentTarget.blur()} className="h-8 text-xs" /> - {minSafeRange !== null && maxSafeRange !== null && ( -

- Range: {minSafeRange} to {maxSafeRange} -

- )} - {minWarningRange !== null && maxWarningRange !== null && ( -

- Warning range: {minWarningRange} to {maxWarningRange} + {field.protections.map((protection) => ( +

+ {protection.severity === "fault" ? "Fault" : "Warning"} if{" "} + {describeCondition(protection.type)} + {protection.time && ` for ${protection.time}`}

- )} + ))}
); } - if (field.kind === "enum") { - const enumField = field as EnumCommandParameter; + if (kind === "enum") { return ( -
+