Expand all sections on the view source screen by default. (#2203)

This commit is contained in:
Doug 2023-12-05 15:35:51 +00:00 committed by GitHub
parent b1371f7f47
commit a99aee7a9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 11 deletions

View File

@ -228,7 +228,7 @@ class RoomScreenInteractionHandler {
actionsSubject.send(.displayMessageForwarding(itemID: itemID))
case .viewSource:
let debugInfo = timelineController.debugInfo(for: eventTimelineItem.id)
MXLog.info(debugInfo)
MXLog.info("Showing debug info for \(eventTimelineItem.id)")
actionsSubject.send(.showDebugInfo(debugInfo))
case .retryDecryption(let sessionID):
Task {

View File

@ -25,7 +25,7 @@ struct TimelineItemDebugView: View {
NavigationStack {
ScrollView {
VStack(spacing: 8) {
TimelineItemInfoDisclosureGroup(title: "Model", text: info.model, isInitiallyExpanded: true)
TimelineItemInfoDisclosureGroup(title: "Model", text: info.model)
if let originalJSONInfo = info.originalJSON {
TimelineItemInfoDisclosureGroup(title: "Original JSON", text: originalJSONInfo)
@ -58,17 +58,11 @@ struct TimelineItemDebugView: View {
// MARK: - Private
private struct TimelineItemInfoDisclosureGroup: View {
@State private var isExpanded: Bool
@State private var isExpanded = true
let title: String
let text: String
init(title: String, text: String, isInitiallyExpanded: Bool = false) {
self.title = title
self.text = text
isExpanded = isInitiallyExpanded
}
var body: some View {
VStack(spacing: 0.0) {
DisclosureGroup(title, isExpanded: $isExpanded) {

Binary file not shown.