chore(preview): add #Preview to RecordSheet + DebugAIRunner

之前 HomeView/MeView/TrendsView/ArchiveListView/RootView/SymptomStartSheet
都有 #Preview,只剩这两个。补完后所有主屏 View 都能在 Xcode Canvas 直接
预览,改 UI 不用 build & run。
This commit is contained in:
link2026
2026-05-25 23:37:55 +08:00
parent b80fae35c9
commit bb08243aa9
2 changed files with 31 additions and 0 deletions

View File

@@ -108,3 +108,26 @@ struct RecordSheet: View {
.presentationCornerRadius(Tj.Radius.xl)
}
}
#Preview("RecordSheet · 直接渲染") {
RecordSheet { kind in print("picked: \(kind)") }
.frame(width: 390, height: 560)
.background(Tj.Palette.sand)
}
#Preview("RecordSheet · sheet 模式") {
PreviewContainer()
}
private struct PreviewContainer: View {
@State private var show = true
var body: some View {
Text("点这里再开一次")
.onTapGesture { show = true }
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Tj.Palette.sand.ignoresSafeArea())
.sheet(isPresented: $show) {
RecordSheet { kind in print("picked: \(kind)"); show = false }
}
}
}