Repository navigation
feat(web): force auto-arrange before saving or publishing workflows - #1752
Merged
Merged
Conversation
Collaborator
CR + 部署实测:#1752 @ b49d0a2(保存/发布前强制自动排版)结论:可以合入,建议同时处理下面 2 处 P2(不影响本次通过)。 实测环境私有部署 main+本 PR 构建的 LoopForge(MariaDB 11.8 + native 沙箱,127.0.0.1:18600),未触碰 Tencent/LoopForge 的部署;用真实 Chromium 驱动画布拖拽、保存、发布和配置检查页。 验证结果
建议修改(P2,不阻塞)
另外核对了常见的几个疑点,均不成立: CI: |
Robert0622
approved these changes
Dec 3, 2026
Robert0622
left a comment
Collaborator
There was a problem hiding this comment.
部署实测通过(保存/发布前自动排版、保存失败保留画布、配置检查页保存、归档只读均正常),webtest/unit 全过、CI 17/17 绿。两处 P2 建议(保存后撤销回滚到未排版快照、canvas 隐藏时 fit 无重试)已在评论里说明,不阻塞合入。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What changed
When users drag or edit nodes in the LOOP flowchart designer (
web/app/flows.js), manually positioned nodes could remain misaligned or overlapping when saved or published.arrangeWorkflowNodes()/arrangeBeforeCommit()usingworkflowStages()to lay out nodes by dependency level (x: 80 + col * 320,y: 80 + row * 190) without adding no-op undo entries when already arranged.saveWorkflow()sendsPUT /api/workflowsand beforepublishWorkflow()checks whether a save is needed (so even clean unarranged drafts save their arranged positions before publishing).fitCanvasOrDefer()(deferring the fit cleanly until returning to Canvas when saved from the Configuration check view), while keepingdirty()and undo history intact if a save fails and leaving read-only workflows untouched.e2e/unit/flow-designer.test.mjsandwebtest/tests/flows-editor.test.mjs.Scope
Compatibility
Only touches frontend flowchart save/publish handling in
web/app/flows.jsand corresponding tests; workflow JSON schema and backend APIs remain unchanged.Validation
node --test e2e/unit/*.test.mjs(25/25 passed)node web/workflow_revision_sync_test.js web/orchestrate.js web/app/flows.js web/app/sops.js(passed)npm --prefix webtest run coverage(Node v22.23.2: 610/611 passed, 1 opt-in integration test skipped withoutLOOPFORGE_ROUTING_TEST_URL, line coverage 86.67%)GOCACHE=/tmp/agentflow-gocache go test ./web -count=1(passed, with localchatbotbuild)GOCACHE=/tmp/agentflow-gocache go vet ./...(passed)python3 scripts/check-public.py(passed)bash scripts/scan-secrets.sh(blocked locally on macOS arm64: pinned linux_x64 gitleaks binary cannot execute)e2e/ui/suite (not run; will run in CI)Safety