Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ text (the transcript and your notes), never audio. You can point Oatcake at a mo
your own, on your Mac or your network, instead.

The window has three columns: the sidebar (a recording in progress, Upcoming from your
calendar, Needs review, and your folders), the meetings in the selected folder, and the
meeting itself. Settings (⌘,) is its own window, in panes; changes apply as you make them.
calendar, Needs review, and your folders, then any meetings at the top level, listed by their
call's title), the meetings in the selected folder, and the meeting itself. A one-off call with
no folder of its own is saved at the top level; drag it onto a folder to file it. Settings (⌘,)
is its own window, in panes; changes apply as you make them.
⌘N starts a new recording, ⌥⌘F searches every meeting from the box above the meeting list (its
title, folder, summary, to-dos, notes and transcript; a meeting found by its text shows the line
with the words and opens there), and ⌘F finds words in the transcript you're reading. ⇧⌘N makes a
Expand Down
20 changes: 18 additions & 2 deletions Sources/Oatcake/SidebarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import SwiftUI
let dragPrefix = "oatcake-item:"

enum SidebarItem: Hashable {
case live, todos, job(String), folder(String)
case live, todos, job(String), folder(String), meeting(String)
}

/// A section's header runs closer to the sidebar's edge than its rows do. This brings a button at the
Expand Down Expand Up @@ -36,7 +36,10 @@ struct SidebarView: View {
FolderRow(node: item.node, depth: item.depth, open: $open, renaming: $renaming, draft: $draft,
newFolderIn: $newFolderIn, dropTarget: $dropTarget)
}
if tree.subfolders.isEmpty { Text("No folders yet.").foregroundStyle(.secondary).font(.callout) }
// A one-off call with no folder of its own is saved at the top level. It's listed here
// under its call's title, after the folders, to open or to drag into one.
ForEach(tree.meetings, id: \.path) { m in topLevelRow(m).tag(SidebarItem.meeting(m.path)) }
if tree.children.isEmpty { Text("No folders yet.").foregroundStyle(.secondary).font(.callout) }
}
} header: {
HStack {
Expand Down Expand Up @@ -112,6 +115,7 @@ struct SidebarView: View {
case .live: .live
case .todos: .todos
case .job(let id): .job(id)
case .meeting(let path, _) where parentOf(path).isEmpty: .meeting(path)
case .meeting, .folder, nil: .folder(model.folder)
case .new: nil
}
Expand All @@ -121,6 +125,7 @@ struct SidebarView: View {
case .todos: model.selection = .todos
case .job(let id): model.selection = .job(id)
case .folder(let path): model.openFolder(path)
case .meeting(let path): model.openMeeting(path)
case nil: break
}
}
Expand Down Expand Up @@ -177,6 +182,17 @@ struct SidebarView: View {
}
}

private func topLevelRow(_ m: TreeNode) -> some View {
HStack(spacing: 4) {
// Where a folder's disclosure arrow is, so the names line up.
Color.clear.frame(width: 12, height: 16)
Label(meetingTitle(m), systemImage: "doc.text").lineLimit(1)
Spacer()
if let date = meetingDate(m) { Text("\(shortMonth(date)) \(gregorian.component(.day, from: date))").foregroundStyle(.secondary).monospacedDigit() }
}
.draggable(dragPrefix + m.path)
}

private var todosRow: some View {
let counts = model.library.todoCounts
return HStack {
Expand Down
Loading