mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-11-22 15:38:23 +00:00
* plan: mcp-agent-profile * plan: mcp-agent-profile, answers Q1 (b) and Q2 (b) * plan: mcp-agent-profile, lists render on GitHub * mcp: User has the peer type of a person * ui: show the peer type placeholder of members and contacts * plan: mcp-agent-profile, answers to the user's notes * ui: compare link icons with peerTypeIcon in the desktop test * ui: snapshot references of the peer type placeholders * android: peer type placeholder of a caller on the lock screen * ios: agent icon of a link in the compose context at text size * plan: mcp-agent-profile, review fixes * ios: snapshot references with the compose context line of a link * core: send a change of the peer type alone to groups * mcp: User's peer type reaches existing session groups * plan: mcp-agent-profile, Q1 (a) * mcp: mark the agent profile item delivered in the roadmap
70 lines
2.5 KiB
Swift
70 lines
2.5 KiB
Swift
import SwiftUI
|
|
import SimpleXChat
|
|
|
|
struct CIChatLinkHeader: View {
|
|
@EnvironmentObject var theme: AppTheme
|
|
@Environment(\.showTimestamp) var showTimestamp: Bool
|
|
@Environment(\.terminalLayout) private var terminal
|
|
var chatItem: ChatItem
|
|
var chatLink: MsgChatLink
|
|
var ownerSig: LinkOwnerSig?
|
|
var hasText: Bool
|
|
|
|
@AppStorage(DEFAULT_SHOW_SENT_VIA_RPOXY) private var showSentViaProxy = false
|
|
|
|
var body: some View {
|
|
VStack(alignment: .leading) {
|
|
linkProfileView()
|
|
.padding(.horizontal, 2)
|
|
.padding(.top, 8)
|
|
.padding(.bottom, 6)
|
|
.overlay(DetermineWidth())
|
|
Divider()
|
|
VStack(alignment: .leading, spacing: 2) {
|
|
if let descr = chatLink.shortDescription {
|
|
Text(descr)
|
|
.font(.footnote)
|
|
.foregroundColor(theme.colors.secondary)
|
|
.lineLimit(2)
|
|
.padding(.bottom, 2)
|
|
}
|
|
Text(chatLink.infoLine(signed: ownerSig != nil))
|
|
.font(.footnote)
|
|
.foregroundColor(theme.colors.secondary)
|
|
.padding(.bottom, 2)
|
|
let t = Text("Tap to open").foregroundColor(theme.colors.primary).font(.callout)
|
|
if hasText || terminal {
|
|
t
|
|
} else {
|
|
t
|
|
+ Text(verbatim: " ")
|
|
+ ciMetaText(chatItem.meta, chatTTL: nil, encrypted: nil, colorMode: .transparent, showStatus: false, showEdited: false, showViaProxy: showSentViaProxy, showTimesamp: showTimestamp)
|
|
}
|
|
}
|
|
.overlay(DetermineWidth())
|
|
}
|
|
.padding(.horizontal, 12)
|
|
.padding(.vertical, 6)
|
|
}
|
|
|
|
private func linkProfileView() -> some View {
|
|
HStack(alignment: .top) {
|
|
ProfileImage(
|
|
imageStr: chatLink.image,
|
|
icon: chatLink.icon,
|
|
size: 44,
|
|
color: Color(uiColor: .tertiaryLabel)
|
|
)
|
|
.padding(.trailing, 4)
|
|
VStack(alignment: .leading) {
|
|
Text(chatLink.displayName).font(.headline).lineLimit(2)
|
|
let fn = chatLink.fullName
|
|
if fn != "" && fn != chatLink.displayName {
|
|
Text(fn).font(.subheadline).lineLimit(2)
|
|
}
|
|
}
|
|
.frame(minHeight: 44)
|
|
}
|
|
}
|
|
}
|