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
2 changes: 1 addition & 1 deletion App/Features/AI/AIDocumentSheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct AIDocumentSheet: View {
/// populated without the host having to hold lists it does not otherwise need.
@State private var lists: [OwnedList] = []
/// Documents the user owns, offered when deriving from an article.
var documents: [Document] = []
var documents: [InterlinedDomain.Document] = []
/// Called after a drafted document is created, so the host can reload it.
var onCreated: (() async -> Void)?

Expand Down
2 changes: 1 addition & 1 deletion App/Features/Documents/ConflictBannerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import InterlinedDomain
struct ConflictBannerView: View {

let pending: ConflictBannerViewModel.Pending
let onOpenLocalCopy: (Document.ID) -> Void
let onOpenLocalCopy: (InterlinedDomain.Document.ID) -> Void
let onDismiss: () -> Void

var body: some View {
Expand Down
2 changes: 1 addition & 1 deletion App/Features/Documents/DocumentEditorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import Textual
struct DocumentEditorView: View {

let viewModel: DocumentEditorViewModel
let onOpenLocalCopy: (Document.ID) -> Void
let onOpenLocalCopy: (InterlinedDomain.Document.ID) -> Void

var body: some View {
VStack(spacing: 0) {
Expand Down
2 changes: 1 addition & 1 deletion App/Features/Documents/DocumentTemplatePickerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct DocumentTemplatePickerView: View {

/// Called with the created document on success so the caller (the root
/// view) can bind the editor to it. Not called on failure.
let onCreated: (Document) -> Void
let onCreated: (InterlinedDomain.Document) -> Void

/// The built-in catalog to present. Defaults to the bundled built-ins;
/// injectable so previews can substitute a list.
Expand Down
23 changes: 20 additions & 3 deletions App/Features/Documents/DocumentsListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,27 @@
import SwiftUI
import InterlinedDomain

// `Document` is written as `InterlinedDomain.Document` throughout the SwiftUI
// files in this feature, and that qualification is load-bearing.
//
// The macOS 27 SDK added a `Document` **protocol** to SwiftUI
// (`protocol Document: ReadableDocument, WritableDocument`), which collides with
// the domain's `Document` **struct** in any file importing both — which is every
// documents view. Before Xcode 27 the bare name resolved; after it, the same
// source stopped compiling with `'Document' is ambiguous for type lookup`
// (GitHub #98).
//
// The domain type is not renamed: `Document` is the right name for it, it is
// correct across Kit, Domain, Persistence and their tests, and renaming a core
// model to dodge a collision in one consumer is the tail wagging the dog. A
// `typealias` would shorten the use sites at the cost of giving one concept two
// names. Only the SwiftUI-importing files need this; the view models import
// Foundation and Observation, not SwiftUI, and are unaffected.

struct DocumentsListView: View {

let viewModel: DocumentsListViewModel
let onSelect: (Document.ID?) -> Void
let onSelect: (InterlinedDomain.Document.ID?) -> Void

/// Source of the **Move to folder** destinations. Optional so the column
/// still renders in isolation (previews, and any future host that has no
Expand All @@ -21,7 +38,7 @@ struct DocumentsListView: View {

/// Called with the document that was moved, so the host can rebind an open
/// editor to the server's relocated copy.
var onMoved: ((Document) -> Void)? = nil
var onMoved: ((InterlinedDomain.Document) -> Void)? = nil

var body: some View {
List(selection: Binding(
Expand Down Expand Up @@ -103,7 +120,7 @@ struct DocumentsListView: View {
// MARK: - DocumentRowView

private struct DocumentRowView: View {
let document: Document
let document: InterlinedDomain.Document

var body: some View {
VStack(alignment: .leading, spacing: 2) {
Expand Down
4 changes: 2 additions & 2 deletions App/Features/Documents/DocumentsRootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ struct DocumentsRootView: View {
/// was started from the editor, so there is exactly one optimistic-rollback
/// implementation rather than two that can disagree.
private func handleMove(
documentID: Document.ID,
documentID: InterlinedDomain.Document.ID,
to destination: FolderNode.ID?,
folderTree: FolderTreeViewModel,
documentsList: DocumentsListViewModel,
Expand All @@ -449,7 +449,7 @@ struct DocumentsRootView: View {
}

private func handleOpenLocalCopy(
_ id: Document.ID,
_ id: InterlinedDomain.Document.ID,
documentsList: DocumentsListViewModel,
editor: DocumentEditorViewModel
) {
Expand Down
2 changes: 1 addition & 1 deletion App/Features/Documents/PublicUserDocumentsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ struct PublicUserDocumentsView: View {

private struct PublicDocumentRow: View {

let document: Document
let document: InterlinedDomain.Document

var body: some View {
VStack(alignment: .leading, spacing: 2) {
Expand Down
2 changes: 1 addition & 1 deletion App/Features/Search/SearchRootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ struct SearchRootView: View {
/// a relative "updated" stamp. Kept local to the Search feature because
/// the Documents feature's own row component is file-private.
private struct DocumentSearchRow: View {
let document: Document
let document: InterlinedDomain.Document

var body: some View {
VStack(alignment: .leading, spacing: 6) {
Expand Down