Open linked files in Quick Look from the reader !440

merged merged by cmc on 2026-11-22 02:10 UTC · krz/orgstar:reader-open-files into main

2 files changed, +6 −2

Layout: unified · split

Sources/OrgstarMobile/ReaderScreen.swift +5 −1
@@ -4,6 +4,7 @@ import OrgCore
44import OrgDocument
55import OrgIndex
66import OrgPresentation
7import QuickLook
78import SwiftUI
89import UIKit
910
@@ -36,6 +37,8 @@ struct ReaderScreen: View {
3637 @State private var startup: StartupDisplay?
3738 @State private var showingOutline = false
3839 @State private var message: String?
40 /// A file a link opened, shown in Quick Look.
41 @State private var previewed: URL?
3942 /// The pane the reader shows its file in, closed with the reader.
4043 @State private var holder = PaneHolder()
4144 @Environment(\.openURL) private var openURL
@@ -109,6 +112,7 @@ struct ReaderScreen: View {
109112 }
110113 }
111114 }
115 .quickLookPreview($previewed)
112116 .sheet(isPresented: $showingOutline) { outlineSheet }
113117 .safeAreaInset(edge: .bottom) {
114118 if let message {
@@ -381,7 +385,7 @@ struct ReaderScreen: View {
381385 session.open(path, in: pane)
382386 model.openRequest = .offset(target, caret)
383387 }
384 case .openExternally(let target): openURL(target)
388 case .openExternally(let target): if target.isFileURL { previewed = target } else { openURL(target) }
385389 case .message(let text): message = text
386390 case .choose(let question, let paths): message = question + paths.map { ($0 as NSString).lastPathComponent }.joined(separator: ", ")
387391 case .elisp: message = "Open the file in the editor to run elisp links."
docs/manual/guide/14-ios.org +1 −1
@@ -39,7 +39,7 @@ Tap a file in Folders or Search, or Open in File in an agenda entry's sheet, to
3939- The file opens with the visibility its =#+STARTUP= line asks for, then each heading's =VISIBILITY= property when =#+STARTUP= sets a visibility. Drawers and blocks are folded as =org-cycle-hide-drawer-startup= and =org-cycle-hide-block-startup= say, or as the file's =#+STARTUP= says (=hidedrawers=, =nohideblocks= and the like). Tap a folded drawer's first line or its =…= to open it, and the first line again to fold it.
4040- Text is styled as in the editor, in the theme's colours, font, size, line spacing and heading sizes, on the theme's background: TODO keywords, priorities, tags, emphasis, code, timestamps, links, and the code in src blocks. Text can be selected and copied.
4141- The reader follows the editor's display settings (see Themes and display below): Show Markup, hidden emphasis markers, pretty entities, indentation, leading stars, inline images and truncated lines. Tables show at full width, without narrowed columns.
42- Tap a link to follow it. Links to headings and files in your folders open in the reader; web links open in the browser.
42- Tap a link to follow it. Links to headings and files in your folders open in the reader; links to other files, such as an attached PDF or image, open in Quick Look; web links open in the browser.
4343- The toolbar has Outline (a list of headings to jump to), Export, and Edit.
4444
4545* The editor