From e2e4b746c177e187f6cfa857da33a42c244de7be Mon Sep 17 00:00:00 2001 From: psavarmattas Date: Sat, 15 Aug 2026 01:33:54 +0100 Subject: [PATCH] fix(reader): pass a real per-document id to NativeTextViewWrapper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every document was using the library's literal "default" documentId — never our own viewModel.documentId — meaning undo stacks, content- divergence snapshots, scroll-offset memory, and pending inline replacements were all keyed to the same slot across every document instead of being scoped per-document. That's a real, unambiguous bug regardless of the click/cursor issue: opening a second document could replay or discard the wrong document's undo history. Investigated the click-does-nothing-in-edit-mode report by reading through the library's (vendored, external — swift-markdown-engine) own isEditable/isSelectable wiring in both makeNSView and updateNSView directly; both looked correctly applied on every pass, and a clean- relaunch test ruled out the settings/NavigationSplitView bug from earlier in this session as the cause. Couldn't confirm this documentId fix resolves the click issue without being able to run the app here — worth retesting either way. --- Outpost/Features/Collections/DocumentReaderView.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Outpost/Features/Collections/DocumentReaderView.swift b/Outpost/Features/Collections/DocumentReaderView.swift index a4a2dc7..6a5e56b 100644 --- a/Outpost/Features/Collections/DocumentReaderView.swift +++ b/Outpost/Features/Collections/DocumentReaderView.swift @@ -92,6 +92,7 @@ struct DocumentReaderView: View { NativeTextViewWrapper( text: $viewModel.text, configuration: .init(heightBehavior: .fitsContent), + documentId: viewModel.documentId, isEditable: viewModel.isEditing )