mirror of
https://github.com/wu736139669/hapi.git
synced 2026-10-08 19:19:42 +00:00
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.
15 lines
519 B
Swift
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
|
|
}
|
|
}
|