Files
hapi/ios/Packages/HapiKit/Sources/HapiUI/Chat/TranscriptRowRole.swift
T
weishu 10042f79c6 feat(ios): refine chat typography and reading layout
Use unified 16pt Dynamic Type body text, clearer Markdown spacing, and a shared reading column. Preserve transcript anchors across typography changes and bound tool command previews to two lines. Add layout and typography regression tests.
2026-09-10 16:22:36 +08:00

15 lines
519 B
Swift

import Foundation
/// Presentation-only rhythm; independent of protocol grouping and stable IDs.
public enum TranscriptRowRole {
case history, user, tool, content
public func spacing(after previous: TranscriptRowRole?) -> CGFloat {
guard let previous, previous != .history, self != .history else { return 12 }
if self == .user { return previous == .user ? 8 : 24 }
if previous == .user { return 16 }
if self == .tool && previous == .tool { return 8 }
return 12
}
}