mirror of
https://github.com/wu736139669/hapi.git
synced 2026-12-04 06:57:55 +00:00
fix(ios): restore post-merge build and test behavior
- Reattach @MainActor @Observable to TranscriptContent; the keyboard-dismiss merge inserted SimultaneousGestureDelegate between the attribute and the class, so transcript environment updates stopped invalidating. - Disable code-block collapsing inside the tool inspector so its body lays out the complete command; the transcript keeps the height cap. - Add setGroup to the session-list test stores for the new protocol requirement. - Fix the session row status/spinner bindings and move ListIdentity to file scope after the session-list merge. via [HAPI](https://hapi.run) Co-Authored-By: HAPI <noreply@hapi.run> Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,10 @@ import SwiftUI
|
||||
public struct CodeBlockView: View {
|
||||
public let language: String?
|
||||
public let code: String
|
||||
/// Long blocks collapse to a height cap in the transcript; tool inspectors
|
||||
/// render the complete content instead (they already provide their own
|
||||
/// scroll and paging).
|
||||
public let collapsible: Bool
|
||||
|
||||
@Environment(\.hapiTheme) private var theme
|
||||
@Environment(\.hapiTypography) private var typography
|
||||
@@ -23,9 +27,10 @@ public struct CodeBlockView: View {
|
||||
@State private var wrapLines = false
|
||||
@State private var expanded = false
|
||||
|
||||
public init(language: String?, code: String) {
|
||||
public init(language: String?, code: String, collapsible: Bool = true) {
|
||||
self.language = language
|
||||
self.code = code
|
||||
self.collapsible = collapsible
|
||||
}
|
||||
|
||||
private var displayLanguage: String {
|
||||
@@ -42,7 +47,7 @@ public struct CodeBlockView: View {
|
||||
max(1, code.split(separator: "\n", omittingEmptySubsequences: false).count)
|
||||
}
|
||||
|
||||
private var isCollapsible: Bool { lineCount > 18 }
|
||||
private var isCollapsible: Bool { collapsible && lineCount > 18 }
|
||||
|
||||
private var isCollapsed: Bool { isCollapsible && !expanded && !wrapLines }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user