docs: annotate Foundry source and deployment lifecycle in Chinese [skip ci]

This commit is contained in:
2026-11-16 17:52:11 +08:00
parent 30829eeb86
commit 1090591503
123 changed files with 1279 additions and 3 deletions
@@ -1,3 +1,4 @@
// 旧 frameId 迁移纯算法回归:检查唯一所有权、边界端口和坐标转换,不创建真实数据库子素材。
package platform
import (
@@ -6,6 +7,8 @@ import (
"testing"
)
// legacyMigrationFixture 同时包含显式成员、空框、仅几何重叠的非成员、内部边和共享端点的边界边。
// viewport 刻意设为非零,用于发现错误地将屏幕变换应用到持久坐标。
const legacyMigrationFixture = `{"schema_version":1,"nodes":[
{"id":"f","type":"frame","position":{"x":100,"y":200},"width":640,"height":400,"data":{"kind":"frame","title":"Frame","text":"","labelMode":"fixed"}},
{"id":"empty","type":"frame","position":{"x":0,"y":0},"width":400,"height":300,"data":{"kind":"frame","title":"Empty","text":""}},
@@ -14,6 +17,8 @@ const legacyMigrationFixture = `{"schema_version":1,"nodes":[
{"id":"outside","type":"material","position":{"x":160,"y":270},"data":{"kind":"text","title":"Not a member","text":"overlaps frame"}}
],"edges":[{"id":"internal","source":"a","target":"b","sourceHandle":"right","targetHandle":"left"},{"id":"boundary","source":"b","target":"outside","sourceHandle":"right","targetHandle":"left"},{"id":"boundary-2","source":"b","target":"outside","sourceHandle":"right","targetHandle":"top"}],"viewport":{"x":2000,"y":3000,"zoom":2}}`
// TestLegacyMigrationOwnershipAndBoundary 检查空框也进入计划、只有显式成员迁入孩子、重复逻辑端点复用一个端口。
// 并验证计划随版本变化,迁移后的已关联框不会再次被计划迁移。
func TestLegacyMigrationOwnershipAndBoundary(t *testing.T) {
parent := canvasSnapshot{BoardID: "parent", Version: 5, Document: json.RawMessage(legacyMigrationFixture)}
plan := legacyPlan("p", "w", parent)
@@ -78,6 +83,7 @@ func TestLegacyMigrationOwnershipAndBoundary(t *testing.T) {
}
}
// TestMigrationPreservesBezierGeometry 对内部边检查 knot 平移到子局部坐标,而相对控制向量不平移。
func TestMigrationPreservesBezierGeometry(t *testing.T) {
var doc map[string]any
_ = json.Unmarshal([]byte(legacyMigrationFixture), &doc)