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
+7
View File
@@ -21,6 +21,11 @@ extension Store {
}
func openFile(_ taskId: String, _ path: String) {
if isPage(path) {
route("#/task/\(taskId)")
openPage(.file(taskId: taskId, path: path))
return
}
filePlaces[taskId] = path.hasSuffix("/") ? FilePlace(dir: String(path.dropLast())) : FilePlace(dir: parent(path), file: path)
route("#/task/\(taskId)/files")
}
@@ -266,6 +271,8 @@ private struct FilesBody: View {
EntryRow(label: e._type == .dir ? "\(e.name)/" : e.name, kind: e._type, ignored: e.ignored, meta: meta, symlink: e.symlink) {
if e._type == .dir {
model.go(FilePlace(dir: join(l.path, e.name)))
} else if e._type == .file && isPage(e.name), let taskId = store.selectedTaskId {
store.openPage(.file(taskId: taskId, path: join(l.path, e.name)))
} else if e._type == .file {
model.go(FilePlace(dir: l.path, file: join(l.path, e.name)))
}