Add calendar date badge to note list rows
Claude-Session: https://claude.ai/code/session_014esDWi42URLEC6Cj17hGQ3
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
**July 2026**
|
**July 2026**
|
||||||
|
|
||||||
|
Each note in the list now shows a calendar-style date badge, with the time of day in the details line
|
||||||
|
|
||||||
|
A refreshed app icon on iPhone, Mac, and Apple Watch
|
||||||
|
|
||||||
Transcripts now appear in their own section of a voice note, separate from your own text, with a button to insert them into it
|
Transcripts now appear in their own section of a voice note, separate from your own text, with a button to insert them into it
|
||||||
|
|
||||||
Re-transcribing a note in another language now works, and every previous transcript is kept
|
Re-transcribing a note in another language now works, and every previous transcript is kept
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
/// A torn-calendar-page date badge: month header over a day number and
|
||||||
|
/// weekday, used to give note rows an at-a-glance date.
|
||||||
|
struct CalendarBadge: View {
|
||||||
|
let date: Date
|
||||||
|
@Environment(\.colorScheme) private var colorScheme
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
VStack(spacing: 0) {
|
||||||
|
Text(month)
|
||||||
|
.font(.system(size: 8, weight: .semibold))
|
||||||
|
.foregroundColor(.white)
|
||||||
|
.frame(maxWidth: .infinity)
|
||||||
|
.padding(.top, 6)
|
||||||
|
.padding(.bottom, 2)
|
||||||
|
.background(Color.accentColor)
|
||||||
|
|
||||||
|
VStack(spacing: 1) {
|
||||||
|
Text(dayNumber)
|
||||||
|
.font(.system(size: 16, weight: .bold))
|
||||||
|
Text(dayOfWeek)
|
||||||
|
.font(.system(size: 7))
|
||||||
|
.foregroundColor(.secondary)
|
||||||
|
}
|
||||||
|
.frame(maxWidth: .infinity)
|
||||||
|
.padding(.top, 3)
|
||||||
|
.padding(.bottom, 5)
|
||||||
|
.background(.quaternary)
|
||||||
|
}
|
||||||
|
.frame(width: 36, height: 44)
|
||||||
|
.clipShape(RoundedRectangle(cornerRadius: 5))
|
||||||
|
.overlay(
|
||||||
|
RoundedRectangle(cornerRadius: 5)
|
||||||
|
.strokeBorder(
|
||||||
|
colorScheme == .dark ? Color.white.opacity(0.1) : Color.clear,
|
||||||
|
lineWidth: 0.5
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
private var month: String {
|
||||||
|
date.formatted(.dateTime.month(.abbreviated)).uppercased()
|
||||||
|
}
|
||||||
|
|
||||||
|
private var dayNumber: String {
|
||||||
|
date.formatted(.dateTime.day())
|
||||||
|
}
|
||||||
|
|
||||||
|
private var dayOfWeek: String {
|
||||||
|
date.formatted(.dateTime.weekday(.abbreviated)).uppercased()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,6 +4,9 @@ struct NoteRowView: View {
|
|||||||
let note: NoteEntity
|
let note: NoteEntity
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
HStack(alignment: .center, spacing: 10) {
|
||||||
|
CalendarBadge(date: note.createdAt)
|
||||||
|
|
||||||
VStack(alignment: .leading, spacing: 4) {
|
VStack(alignment: .leading, spacing: 4) {
|
||||||
Text(displayTitle)
|
Text(displayTitle)
|
||||||
.font(.body.weight(.medium))
|
.font(.body.weight(.medium))
|
||||||
@@ -15,7 +18,7 @@ struct NoteRowView: View {
|
|||||||
Text(AudioPlayerView.timeString(note.audioDuration ?? 0))
|
Text(AudioPlayerView.timeString(note.audioDuration ?? 0))
|
||||||
Text("·")
|
Text("·")
|
||||||
}
|
}
|
||||||
Text(note.createdAt, format: .dateTime.day().month().year())
|
Text(note.createdAt, format: .dateTime.hour().minute())
|
||||||
if let place = note.context.summary {
|
if let place = note.context.summary {
|
||||||
Text("·")
|
Text("·")
|
||||||
Text(place)
|
Text(place)
|
||||||
@@ -34,6 +37,7 @@ struct NoteRowView: View {
|
|||||||
.lineLimit(1)
|
.lineLimit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
.padding(.vertical, 2)
|
.padding(.vertical, 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user