mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-06-29 04:39:53 +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)
|
.padding(.bottom, 2)
|
||||||
} else {
|
} else {
|
||||||
if case let .link(_, preview) = chatItem.content.msgContent {
|
if case let .link(_, preview) = chatItem.content.msgContent {
|
||||||
ChatItemLinkView(linkPreview: preview, width: msgWidth)
|
ChatItemLinkView(linkPreview: preview)
|
||||||
.overlay(DetermineWidth())
|
|
||||||
.frame(minWidth: msgWidth, alignment: .leading)
|
|
||||||
}
|
}
|
||||||
MsgContentView(
|
MsgContentView(
|
||||||
content: chatItem.content,
|
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 terminalFont = Font.custom("Menlo", size: 16)
|
||||||
|
|
||||||
|
private let maxItemSize: Int = 50000
|
||||||
|
|
||||||
struct TerminalView: View {
|
struct TerminalView: View {
|
||||||
@EnvironmentObject var chatModel: ChatModel
|
@EnvironmentObject var chatModel: ChatModel
|
||||||
@State var inProgress: Bool = false
|
@State var inProgress: Bool = false
|
||||||
|
@ -24,11 +26,18 @@ struct TerminalView: View {
|
||||||
LazyVStack {
|
LazyVStack {
|
||||||
ForEach(chatModel.terminalItems) { item in
|
ForEach(chatModel.terminalItems) { item in
|
||||||
NavigationLink {
|
NavigationLink {
|
||||||
|
let s = item.details
|
||||||
ScrollView {
|
ScrollView {
|
||||||
Text(item.details)
|
Text(s.prefix(maxItemSize))
|
||||||
.textSelection(.enabled)
|
|
||||||
.padding()
|
.padding()
|
||||||
}
|
}
|
||||||
|
.toolbar {
|
||||||
|
ToolbarItem(placement: .navigationBarTrailing) {
|
||||||
|
Button { showShareSheet(items: [s]) } label: {
|
||||||
|
Image(systemName: "square.and.arrow.up")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} label: {
|
} label: {
|
||||||
HStack {
|
HStack {
|
||||||
Text(item.id.formatted(date: .omitted, time: .standard))
|
Text(item.id.formatted(date: .omitted, time: .standard))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue