Files
Outpost/OutlineKit/Sources/OutlineKit/Requests/DocumentsListRequest.swift
T
Puranjay Savar Mattas c3083bf0c0 feat: Home page + universal New Document dialog
Home replaces "auto-select first collection" as the landing state -
new toolbar Home button, Home pill in the breadcrumb, and the sidebar
no longer picks a collection for you on launch.

Home page:
- Pinned docs as a card grid (pins.list -> per-document fetch, since
  the speculative pins.list response only carries pin records, not
  documents - N+1 is acceptable here since pins are a small curated
  set, unlike a full collection tree)
- Recently Viewed (documents.viewed), Recently Updated and Created by
  Me (documents.list with sort/direction/userId - new richer
  DocumentsListRequest alongside the existing simple listDocuments,
  left untouched for its callers), and Popular (best-effort sort:
  "viewCount" - no confirmed popularity key in the vendored spec,
  worth eyeballing against a real server)
- New Document button in Home's own toolbar

New Document is now one shared dialog (NewDocumentSheet, mirrors
MoveDocumentSheet's collection+parent picker) instead of three
separate call sites that silently created "Untitled" instantly:
sidebar collection's New Document, sidebar document's New Document,
and the reader's toolbar button + menu item all open it now,
pre-filled with whatever context they were opened from.

OutlineKit: documents.viewed, richer documents.list filtering, with
test coverage.
2026-08-14 16:03:17 +01:00

30 lines
874 B
Swift

import Foundation
/// Richer `documents.list` query than `OutlineAPIClient.listDocuments` covers
/// (that one's kept as-is for its existing simple callers) — adds the
/// sort/direction/userId filters the Home page's tabs need.
public struct DocumentsListRequest: Encodable, Sendable {
public let collectionId: String?
public let userId: String?
public let sort: String?
public let direction: String?
public let offset: Int
public let limit: Int
public init(
collectionId: String? = nil,
userId: String? = nil,
sort: String? = nil,
direction: String? = nil,
offset: Int = 0,
limit: Int = 25
) {
self.collectionId = collectionId
self.userId = userId
self.sort = sort
self.direction = direction
self.offset = offset
self.limit = limit
}
}