Repository navigation
feat(layers): layer tree, annotation layers and saved default state (#377) - #775
Closed
oscar981-op wants to merge 1 commit into
Closed
oscar981-op wants to merge 1 commit into
oscar981-op wants to merge 1 commit into
Conversation
…oundation#377) - Layers panel follows the /OCProperties /D tree read from the file: layers nested under a layer (unlabelled /Order arrays), labels, /Locked layers (checkbox disabled, lock icon) and /RBGroups (radio semantics via the pdf.js config). Hidden-by-default layers stay hidden. - "Set as default" stores the toggled state; the next save writes it as /D /ON /OFF (BaseState kept), after which it is the file's start state and the view copy follows the new bytes. - Toggled state now also applies to raster export/print (pdf.js path) and the vector "save as PDF" print (same /D update as the view copy). - Properties panel "Layer" field: markup layers or document layers. A markup on a document layer gets /OC to that OCG on save, loads back on it, and hides/shows with the layer. Adopted OCGs keep their place in /OCGs, /Order, /Locked and /RBGroups and survive removal of the layer. - Translations for all locales; tests for tree parsing, default state, saving the default, annotation /OC round-trip and pixel checks via pdf.js, MuPDF and (optionally) the real pdfium-worker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
Collaborator
|
Thank you, @oscar981-op! This change is included in release 2026.44.1 through the release PR #841, as one squashed commit with you as the author, so this PR is closed rather than merged. During review we added the following on top, with regression tests: a drawing layer that a markup layer is placed on now keeps its place in /OCGs, /Order, /RBGroups and /Locked, its own /Name and its default state when the markup layer is deleted or renamed; toggling a layer only changes the view, and only "Set as default" changes the saved default. |
philip-tam
pushed a commit
to philip-tam/open-pdf-studio
that referenced
this pull request
Nov 1, 2026
…penAEC-Foundation#775) The Layers panel follows the /OCProperties /D tree from the file: nested layers, labels, /Locked layers (shown with a lock, checkbox disabled) and /RBGroups (radio behaviour). "Set as default" stores the toggled state, and the next save writes it as /D /ON /OFF. The toggled state also applies to raster export, printing and the vector "save as PDF" print. The properties panel gets a "Layer" field: a markup can be put on a markup layer or on a layer of the drawing, in which case it gets /OC to that OCG on save, loads back on it and hides and shows with it. Fixes OpenAEC-Foundation#377 Review fixes on top: - An adopted drawing layer whose markup layer was removed while other markup layers remained was dropped from /OCGs, /Order, /Locked, /RBGroups and /ON /OFF. Every adopted OCG known from the file now keeps its place; only the app's own keys are removed. - The drawing layer's /Name is no longer overwritten by the markup layer name (for example a " (2)" suffix or a rename in the panel). - Adopting a layer no longer turns the current view state into the file's default. Adopted layers keep their /D state; only "Set as default" changes it (laagstandZonderEigenLagen). - Regression tests for all three cases (save, reopen, check /OCGs, /Order, /RBGroups, /Locked, name and default state).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #377.
Already on main
/OCProperties /Dupdate (laagstand.js+ Rustset_layer_view)./OC.Added
/Ordertree, including the "children nested under a layer" form, labels,/Locked(checkbox disabled) and radio groups (js/pdf/lagen-boom.js)./OCpointing at the drawing's own OCG./D /ON /OFF, keeping BaseState and/ASand leaving out own markup OCGs.pdfjsLaagOpties./Dupdate./OCGs,/Order,/Lockedand/RBGroups. When removed they are detached, not deleted.Tests
/OChiding./OCround-trip.OPDS_PDFIUM_WORKER), which passed locally against the release worker.vite buildis clean.Not yet checked in the running app / limits
/Don every save./Usageprint states and/ASprint events are not applied.🤖 Generated with Claude Code