mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-03-14 09:45:42 +00:00
ios: fix scrolling with link previews, fix large terminal item detail view (#512)
This commit is contained in:
parent
84a77de53c
commit
150b4196ea
3 changed files with 14 additions and 10 deletions
|
@ -52,9 +52,7 @@ struct FramedItemView: View {
|
|||
.padding(.bottom, 2)
|
||||
} else {
|
||||
if case let .link(_, preview) = chatItem.content.msgContent {
|
||||
ChatItemLinkView(linkPreview: preview, width: msgWidth)
|
||||
.overlay(DetermineWidth())
|
||||
.frame(minWidth: msgWidth, alignment: .leading)
|
||||
ChatItemLinkView(linkPreview: preview)
|
||||
}
|
||||
MsgContentView(
|
||||
content: chatItem.content,
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -10,6 +10,8 @@ import SwiftUI
|
|||
|
||||
private let terminalFont = Font.custom("Menlo", size: 16)
|
||||
|
||||
private let maxItemSize: Int = 50000
|
||||
|
||||
struct TerminalView: View {
|
||||
@EnvironmentObject var chatModel: ChatModel
|
||||
@State var inProgress: Bool = false
|
||||
|
@ -24,11 +26,18 @@ struct TerminalView: View {
|
|||
LazyVStack {
|
||||
ForEach(chatModel.terminalItems) { item in
|
||||
NavigationLink {
|
||||
let s = item.details
|
||||
ScrollView {
|
||||
Text(item.details)
|
||||
.textSelection(.enabled)
|
||||
Text(s.prefix(maxItemSize))
|
||||
.padding()
|
||||
}
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .navigationBarTrailing) {
|
||||
Button { showShareSheet(items: [s]) } label: {
|
||||
Image(systemName: "square.and.arrow.up")
|
||||
}
|
||||
}
|
||||
}
|
||||
} label: {
|
||||
HStack {
|
||||
Text(item.id.formatted(date: .omitted, time: .standard))
|
||||
|
|
Loading…
Add table
Reference in a new issue