Skip to content

List PDF attachments and read them without leaving the parent - #52

Open
pablopda wants to merge 6 commits into
Forward-Future:mainfrom
pablopda:feat/pdf-attachments
Open

pablopda wants to merge 6 commits into
Forward-Future:mainfrom
pablopda:feat/pdf-attachments

Conversation

@pablopda

@pablopda pablopda commented Nov 4, 2026 •

Copy link
Copy Markdown

Problem

PDFs can contain embedded documents that Folio offers no way to list or read. Users need to find and save those files and read attached PDFs without losing their place or edits in the parent.

Change

Add a Files sidebar panel with lazy discovery of document attachments and file-attachment annotations across all pages, individual file saving, and temporary read-only tabs for attached PDFs. Parent forms and edits remain mounted. Committed child tabs survive parent closure; child documents stay out of Recent, saved views, markup, and AI history.

Support embedded-stream and child-PDF passwords, cancellation/retry, invalid-file feedback, and global theme/night-mode synchronization. Refresh attachment sessions when a parent PDF is edited while preserving open child snapshots. Keep close errors visible with one tab or in focus mode, and restore the most recently selected eligible normal document at startup.

Updated to upstream main 5ef1503; no merge conflicts. No version or changelog changes relative to upstream main.

Issue or approval

Refs #53. The issue follows the feature-request template and asks for agreement on the idea and scope. No duplicate attachment issue or PR was found before submission.

This was implemented in my fork before being proposed upstream, so the prior-maintainer-approval requirement was not met. Maintainer scope approval is still pending and is not implied by this PR being ready for review. Scope feedback was requested in #52 (comment). The contributor has now requested implementation review as well.

How I checked it

  • TypeScript, production build, and 32 focused broker/adapter, session, and tab regressions pass.
  • Full Windows, macOS, and Linux CI passed on head 8519ac8 in the fork. This includes upstream editing smoke coverage and attachment listing, exact-byte saves, extensionless/invalid PDFs, parent form retention, read-only child forms, deduplication, parent closure/replay, password cancellation/retry, theme synchronization, and close-error feedback.
  • Added an integration regression for editing a parent with an attached PDF already open: normal-tab identity is retained, the attachment session refreshes, the open child remains usable, and the attachment can be read again from the edited parent.
  • Three independent audit rounds repaired two application defects and one CI failure-reporting defect. Audit ledger. This audit preceded the upstream integration, which has the separate CI validation above.

Before/after screenshot evidence is available as CI artifacts, outside the repository:

  • Before: upstream main Linux screenshots, smoke-linux.png, shows the existing Pages/Outline/Notes sidebar without Files.
  • After: Linux, Windows, macOS. See attachments-list-*.png, attachment-reader-*.png, and the narrow/dark, night-mode, and close-error screenshots. The before image uses Folio's sample; the attachment screenshots use a synthetic PDF fixture, so these are UI evidence rather than a same-document comparison.

Native visible window dragging and compatibility with the original user PDF remain unverified. Daybreak security review was skipped — model unavailable on this ChatGPT account; no substitute review was performed.

Implementation and review: OpenAI Codex with GPT-6.1 Sol and native subagents. Security-review attempt: designated Daybreak model (unavailable).

@pablopda

pablopda commented Nov 4, 2026

Copy link
Copy Markdown
Author

@mberman84 Could you take a look at the proposed scope when you have time? This adds a Files panel to list and save PDF attachments, plus read-only tabs for attached PDFs that preserve the parent document's place and edits.

I saw that CONTRIBUTING.md asks for an issue and maintainer agreement before implementing new features. This was developed in my fork before proposing it upstream, so I've kept this PR draft; I understand that it hasn't followed the issue-first process. Would attachment support in this scope be welcome, and would you prefer an issue to discuss the design before reviewing the implementation?

The branch is updated to main at 5ef1503, with no merge conflicts. The full Windows, macOS, and Linux checks pass in the fork, including a regression for editing a parent PDF while an attachment remains open: https://github.com/pablopda/folio/actions/runs/41764902176. Validation details and remaining limitations are in the PR description.

@pablopda
pablopda marked this pull request as ready for review November 4, 2026 03:12

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant