Remove "history may be shared banner" (#4999)

* Revert "Do not show history visible banner when the user cannot send messages. (#4892)"

This reverts commit 2e09914cb7.

* Revert "Add a banner to encrypted rooms with visible history. (#4851)"

This reverts commit 6153480d90.
This commit is contained in:
Skye Elliot
2026-01-26 14:59:48 +00:00
committed by GitHub
parent cf79cb9b01
commit 2d5a86f161
9 changed files with 9 additions and 335 deletions
@@ -16,7 +16,7 @@ struct RoomScreenFooterView: View {
private var borderColor: Color {
switch details {
case .pinViolation, .historyVisible:
case .pinViolation:
.compound.borderInfoSubtle
case .verificationViolation:
.compound.borderCriticalSubtle
@@ -27,7 +27,7 @@ struct RoomScreenFooterView: View {
private var gradient: Gradient {
switch details {
case .pinViolation, .historyVisible:
case .pinViolation:
.compound.info
case .verificationViolation:
Gradient(colors: [.compound.bgCriticalSubtle, .clear])
@@ -54,8 +54,6 @@ struct RoomScreenFooterView: View {
pinViolation(member: member, learnMoreURL: learnMoreURL)
case .verificationViolation(member: let member, learnMoreURL: let learnMoreURL):
verificationViolation(member: member, learnMoreURL: learnMoreURL)
case .historyVisible(learnMoreURL: let learnMoreURL):
historyVisibleAlert(learnMoreURL: learnMoreURL)
}
}
@@ -153,43 +151,10 @@ struct RoomScreenFooterView: View {
return description
}
private func historyVisibleAlertDescriptionWithLearnMoreLink(learnMoreURL: URL) -> AttributedString {
let linkPlaceholder = "{link}"
var description = AttributedString(L10n.cryptoHistoryVisible(linkPlaceholder))
var linkString = AttributedString(L10n.actionLearnMore)
linkString.link = learnMoreURL
linkString.bold()
description.replace(linkPlaceholder, with: linkString)
return description
}
private func fallbackDisplayName(_ userID: String) -> String {
guard let localpart = userID.components(separatedBy: ":").first else { return userID }
return String(localpart.trimmingPrefix("@"))
}
private func historyVisibleAlert(learnMoreURL: URL) -> some View {
let description = historyVisibleAlertDescriptionWithLearnMoreLink(learnMoreURL: learnMoreURL)
return VStack(spacing: 16) {
HStack(spacing: 16) {
CompoundIcon(\.info).foregroundColor(.compound.iconInfoPrimary)
Text(description)
.font(.compound.bodyMD)
.foregroundColor(.compound.textInfoPrimary)
}
Button {
callback(.dismissHistoryVisibleAlert)
} label: {
Text(L10n.actionDismiss)
.frame(maxWidth: .infinity)
}
.buttonStyle(.compound(.primary, size: .medium))
}
.padding(.top, 16)
.padding(.horizontal, 16)
.padding(.bottom, 8)
}
}
struct RoomScreenFooterView_Previews: PreviewProvider, TestablePreview {
@@ -201,8 +166,6 @@ struct RoomScreenFooterView_Previews: PreviewProvider, TestablePreview {
static let verificationViolationDetails: RoomScreenFooterViewDetails = .verificationViolation(member: RoomMemberProxyMock.mockBob,
learnMoreURL: "https://element.io/")
static let historyVisibleDetails: RoomScreenFooterViewDetails = .historyVisible(learnMoreURL: "https://element.io")
static var previews: some View {
RoomScreenFooterView(details: bobDetails, mediaProvider: MediaProviderMock(configuration: .init())) { _ in }
.previewDisplayName("With displayname")
@@ -210,7 +173,5 @@ struct RoomScreenFooterView_Previews: PreviewProvider, TestablePreview {
.previewDisplayName("Without displayname")
RoomScreenFooterView(details: verificationViolationDetails, mediaProvider: MediaProviderMock(configuration: .init())) { _ in }
.previewDisplayName("Verification Violation")
RoomScreenFooterView(details: historyVisibleDetails, mediaProvider: MediaProviderMock(configuration: .init())) { _ in }
.previewDisplayName("History Visible")
}
}