diff options
| author | Christian Cleberg <[email protected]> | 2026-04-13 09:57:23 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-04-13 09:57:23 -0500 |
| commit | 0e461a382257979037e8927e5f6b468635b0a7fe (patch) | |
| tree | 0aa3a19f6f8f966b0e90f4874ed54359a7898107 /Hutch/Views/Repositories/ReadmeView.swift | |
| parent | ee9f2904aa319231b7047fca3cb069f0c07019cd (diff) | |
| download | hutch-0e461a382257979037e8927e5f6b468635b0a7fe.tar.gz hutch-0e461a382257979037e8927e5f6b468635b0a7fe.tar.bz2 hutch-0e461a382257979037e8927e5f6b468635b0a7fe.zip | |
feat: add power user actions
Implements: https://todo.sr.ht/~ccleberg/hutch/52
Implements: https://todo.sr.ht/~ccleberg/hutch/53
Implements: https://todo.sr.ht/~ccleberg/hutch/54
Diffstat (limited to 'Hutch/Views/Repositories/ReadmeView.swift')
| -rw-r--r-- | Hutch/Views/Repositories/ReadmeView.swift | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Hutch/Views/Repositories/ReadmeView.swift b/Hutch/Views/Repositories/ReadmeView.swift index 5742811..f5c0c9f 100644 --- a/Hutch/Views/Repositories/ReadmeView.swift +++ b/Hutch/Views/Repositories/ReadmeView.swift @@ -2,6 +2,7 @@ import SwiftUI import WebKit struct ReadmeView: View { + @Environment(AppState.self) private var appState let viewModel: RepositoryDetailViewModel @Environment(\.colorScheme) private var colorScheme @@ -15,6 +16,9 @@ struct ReadmeView: View { repositoryDetailsSection latestChangeSection readmeSection + if appState.isDebugModeEnabled { + debugSection + } } .padding() } @@ -150,6 +154,25 @@ struct ReadmeView: View { .plainText(text) } } + + private var debugSection: some View { + DebugTextBlock( + title: "Debug", + content: """ + repositoryId: \(viewModel.repository.id) + rid: \(viewModel.repository.rid) + service: \(viewModel.repository.service.rawValue) + defaultBranch: \(viewModel.repository.defaultBranchName ?? "none") + webURL: \(SRHTWebURL.repository(viewModel.repository)?.absoluteString ?? "unavailable") + httpsClone: \(SRHTWebURL.httpsCloneURL(viewModel.repository) ?? "unavailable") + sshClone: \(SRHTWebURL.sshCloneURL(viewModel.repository)) + readmePath: \(viewModel.readmePath ?? "none") + commitsLoaded: \(viewModel.commits.count) + branchesLoaded: \(viewModel.branches.count) + tagsLoaded: \(viewModel.tags.count) + """ + ) + } } enum RenderedMarkupContent: Sendable { |
