Files
Outpost/OutlineKit/Sources/OutlineKit/Models/OutlineView.swift
T
Puranjay Savar Mattas 86e7aa5800 feat(reader): document toolbar - viewers, share, edit, pin/subscribe, menu
Adds the full document reader toolbar: recent-viewer avatar stack
(views.list, polled every 20s, filtered to entries with a
lastViewedAt), Share button (shares.create/info/update), Edit/Done
toggle that switches the reader into an editable NativeTextViewWrapper
and saves via documents.update (last-write-wins REST editing, per
CLAUDE.md's Phase 1 scope - full realtime CRDT collaboration is a
separate, much larger effort, see the Collaboration/ skeleton in this
branch), New Document button, and an overflow menu with the same
action set as the sidebar's document context menu plus this session's
additions: Star/Unstar (shared StarStore), Pin/Unpin and
Subscribe/Unsubscribe (pins.*/subscriptions.* - not in the vendored
OpenAPI spec, reconstructed from Outline's actual API surface and
flagged as best-effort in code comments), Enable Viewer Insights,
Enable Embeds (speculative field on documents.update), and Full
Width (toggles + reads back Document.fullWidth, now added to the
model).

Also replaces the always-expanded .searchable contextual search field
with a plain icon that expands into a field on click.

OutlineKit: shares.*, pins.* (best-effort), subscriptions.*
(best-effort), views.list, with test coverage for the endpoints that
are in the vendored spec.
2026-08-14 02:53:54 +01:00

16 lines
609 B
Swift

import Foundation
/// A record of a user having viewed a document, backed by `views.list`.
/// This is historical/aggregated (`firstViewedAt`/`lastViewedAt`/`count`),
/// not live presence — there's no realtime "viewing right now" signal over
/// REST, only over the Hocuspocus collaboration socket's awareness protocol.
public struct OutlineView: Decodable, Identifiable, Sendable {
public let id: String
public let documentId: String
public let userId: String
public let user: OutlineUser
public let count: Int
public let firstViewedAt: Date?
public let lastViewedAt: Date?
}