Every screen now speaks the paper vocabulary rather than only the bookmarks screen: Search, Sources, Podcasts and the player, Settings, Add/Edit, Smart Collections, Ask, Onboarding, the browser toolbar, the Siri snippets, and the share extension's save card. The change is mostly a design system rather than per-screen tweaks. LibraryKit gains: - Semantic colors — secondary/tertiary/faint text, `raised` surfaces, and accent/alarm/affirm, so screens stop reaching for .secondary, systemGray, .blue, .red and .green. The three status colors come out of the palette (the swatch blue, vermilion and forest) rather than from the system set, so the design keeps spending one set of inks. - PaperType — the two voices made explicit. Prose (titles, summaries, anything a person wrote) is serif; anything the machine contributes (domains, dates, counts, tags, labels, buttons) is monospaced. Keeping that split strict is what makes the design read as archival rather than as decoration. - paperSurface() / paperField() / paperCard() for grounds, inputs and raised blocks. - PaperEmptyState, because ContentUnavailableView can't be restyled — it draws its own bold system type and grey, which was the loudest remaining system voice once the screens moved onto the sheet. All nine usages are converted. The app also sets one accent for the system chrome it doesn't draw — tab bar, search fields, switches, swipe actions — which otherwise stayed system blue around paper screens. BookmarkRow is deleted. Once Search moved to the library row and TagBookmarksView was gone, nothing passed .classic, so the style fork in BookmarkListRow went with it. There is one bookmark row now. The share extension compiles LibraryKit directly, since its save card is a user-facing surface and should not be the one place still using system styling. Verified on device in both color schemes; screens toured with a temporary UI test harness (removed). Suite passes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JgLHztZGaEHvS3KNeGQmRM
77 lines
2.5 KiB
Swift
77 lines
2.5 KiB
Swift
import SwiftUI
|
|
|
|
/// Full-featured list row used by BookmarksView and SearchView. Owns podcast
|
|
/// and episode-picker sheet state; parent owns the BrowserView sheet.
|
|
struct BookmarkListRow: View {
|
|
let bookmark: Bookmark
|
|
let viewModel: BookmarksViewModel
|
|
var readingProgress: Double = 0
|
|
let onOpen: () -> Void
|
|
var onEdit: (() -> Void)? = nil
|
|
|
|
@Environment(\.openURL) private var openURL
|
|
@State private var showFullPlayer = false
|
|
@State private var episodePickerBookmark: Bookmark?
|
|
|
|
var body: some View {
|
|
LibraryListRow(
|
|
bookmark: bookmark,
|
|
readingProgress: readingProgress,
|
|
onPodcast: handlePodcast
|
|
)
|
|
.contentShape(Rectangle())
|
|
.onTapGesture { onOpen() }
|
|
.listRowInsets(EdgeInsets(top: 0, leading: 18, bottom: 0, trailing: 18))
|
|
.listRowSeparator(.visible)
|
|
.listRowSeparatorTint(Paper.rule.opacity(0.5))
|
|
.listRowBackground(Paper.sheet)
|
|
// Delete is destructive and not undoable — require an explicit tap on the
|
|
// revealed button rather than letting a single full swipe delete instantly.
|
|
.swipeActions(edge: .trailing, allowsFullSwipe: false) {
|
|
Button(role: .destructive) {
|
|
Task { await viewModel.delete(bookmark) }
|
|
} label: {
|
|
Label("Delete", systemImage: "trash")
|
|
}
|
|
}
|
|
.swipeActions(edge: .leading) {
|
|
Button {
|
|
Task { await viewModel.archive(bookmark) }
|
|
} label: {
|
|
Label("Archive", systemImage: "archivebox")
|
|
}
|
|
.tint(.orange)
|
|
if let onEdit {
|
|
Button { onEdit() } label: {
|
|
Label("Edit", systemImage: "pencil")
|
|
}
|
|
.tint(.blue)
|
|
}
|
|
}
|
|
.contextMenu {
|
|
bookmarkMenuItems(
|
|
bookmark: bookmark,
|
|
viewModel: viewModel,
|
|
openURL: openURL,
|
|
onOpen: onOpen,
|
|
onEdit: onEdit,
|
|
onPodcast: handlePodcast
|
|
)
|
|
}
|
|
.podcastSheets(
|
|
viewModel: viewModel,
|
|
showFullPlayer: $showFullPlayer,
|
|
episodePicker: $episodePickerBookmark
|
|
)
|
|
}
|
|
|
|
private func handlePodcast() {
|
|
launchPodcast(
|
|
for: bookmark,
|
|
viewModel: viewModel,
|
|
showFullPlayer: $showFullPlayer,
|
|
episodePicker: $episodePickerBookmark
|
|
)
|
|
}
|
|
}
|