Show HTML pages in a task view beside the transcript

This commit is contained in:
Ian Gulliver
2026-10-21 17:52:04 -07:00
parent af9c750298
commit 585c8ba5f8
16 changed files with 600 additions and 102 deletions
+9 -6
View File
@@ -277,8 +277,8 @@ private struct TaskBar: View {
HStack(spacing: 12) {
Spacer(minLength: 0)
ForEach(previews, id: \.port) { p in
if let url = store.forwards.url(p.taskId, p.port) {
PreviewLink(preview: p, url: url)
if store.forwards.url(p.taskId, p.port) != nil {
PreviewLink(preview: p)
}
}
}
@@ -336,18 +336,21 @@ private struct TaskBar: View {
private struct PreviewLink: View {
let preview: Components.Schemas.Preview
let url: URL
@Environment(Store.self) private var store
@Environment(\.paneAccent) private var accent
@ViewState private var hover = false
var body: some View {
Link(destination: url) {
Text("\(preview.name) ↗")
Button {
store.openPage(.preview(taskId: preview.taskId, port: preview.port))
} label: {
Text(preview.name)
.foregroundStyle(accent)
.underline(hover)
.lineLimit(1)
}
.help("Open \(preview.name) (port \(preview.port)) in a new window")
.buttonStyle(.plain)
.help("Show \(preview.name) (port \(preview.port)) beside the transcript")
.onHover { hover = $0 }
}
}