Repository navigation
Visual Flow Editor: граф логики, debugger и production runtime - #403
Conversation
Inserted flow templates bind to the canvas screen so their rules are visible and editable right away, a screen with several graph rules gets a compact rule selector on the canvas, trigger elementId is editable in the node inspector with schema-safe id validation, consecutive new nodes cascade from the viewport center, and production timer intervals dispatch their own rule instead of the first matching timer rule.
| const condition: InteractionCondition = step?.condition ?? defaultCondition(); | ||
| const flat = condition.kind === 'all' || condition.kind === 'any' || condition.kind === 'not' || condition.kind === 'exists' ? undefined : condition; | ||
| const conditionPath = flat?.path ?? 'server.connected'; | ||
| const isBooleanPath = BOOLEAN_PATHS.has(conditionPath) || conditionPath.startsWith('variable.'); |
There was a problem hiding this comment.
Typed comparisons cannot be edited
Every variable.* condition gets a true/false editor, including number, string, and enum variables. Editing the string condition in restore-position writes a boolean and makes export fail with WRONG_VALUE_TYPE. Selecting a numeric operator also passes a boolean or string to the parser instead of a number. Choose the editor and starting value from the variable type and operator.
Prompt To Fix With AI
This is a comment left during a code review.
Path: editor/src/components/FlowNodeInspector.tsx
Line: 125
Comment:
**Typed comparisons cannot be edited**
Every `variable.*` condition gets a true/false editor, including number, string, and enum variables. Editing the string condition in `restore-position` writes a boolean and makes export fail with `WRONG_VALUE_TYPE`. Selecting a numeric operator also passes a boolean or string to the parser instead of a number. Choose the editor and starting value from the variable type and operator.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Исправлено в 1c23dde: редактор значения выбирается по FlowVariable.type и оператору. boolean, number, string и enum сохраняют правильные типы, numeric operators используют finite number. Добавлены tests для всех типов и restore-position string.
- map editor routes to phone MRoute (search to add) and reject unsupported destinations instead of pushing them - pick the condition value editor by variable type and operator and keep the path through exists - start dialog actions with valid title and message so the draft parse cannot fail - place new flow nodes at the viewport center for viewports offset from the page origin - treat queue.add as fire-and-forget so episode chains reach playback.nextEpisode - present restore-position as a configurable variables example, not a live restore - rewrite design/generated/flow.ts from the full merged document on scoped exports - run preview clicks through the shared interpreter with a mock typed dispatcher
- search opens the TV search screen (add) for navigate and openScreen - screens that exist on the TV keep their name - unsupported destinations return a documented error without touching the stack
- toInteractionTraces takes the flow document and re-attaches the matched legacy rule condition by rule id - graph trace entries never receive an invented condition - InteractionTrace.action and ExecutionTraceEntry.action use InteractionAction['type'] instead of string casts
- validate posted trace actions against the full InteractionAction union via INTERACTION_ACTION_TYPES - keep rejecting arbitrary strings and keep the 20 character action limit
- phone and TV screen maps returned shared route objects, so repeated visits to one screen aliased one stack entry - nav keys the covered scroll by route identity and the TV keys rendered screens by routeKey - clone the mapped route per navigation; queue.append identity semantics stay untouched
|
@greptile review |
Что изменено
FlowDocumentсоschemaVersion: 1, graph interpreter, validation и rebase по id без миграции старых документов.AGENTS.md.Проверено
npm run test:editor: 59 файлов, 781/781 тест.npx tsc --noEmit.npm run build,npm run build:mobile,npm run build:desktop,npm run build:editor.npm run editor:generate -- --check,git diff --check.Экспортироватьне нажималась.Скриншот
Ограничения
queue.addна phone возвращает документированную ошибку из-за отсутствия append-команды в player protocol.paused/finishedзависят от свежести bridge snapshot.download.failedне отличает удаление от потери.restore-positionявляется configurable example для variables/graph. Живой restore route/position/element не заявлен и требует отдельных typed adapters.npm testне запускался в Git Bash на Windows из-за требований Linux и Postgres 17. Стандартные CI jobs подтверждают полный набор на Linux.The route-copy fix looks safe, but the earlier condition-editor issue still needs a complete fix before merging.
Fix with agent prompt
Summary
Adds a visual flow editor with typed graphs, templates, a debugger, scoped export, and a shared production runtime.
Reviews (4) · Last reviewed commit: "fix: give every flow navigation its own ..." · Reviewed by Greptile