Repository navigation
Run hide actions and widget trigger actions in the annotation layer - #683
Merged
Merged
Conversation
Decode /S /Hide actions, flatten /Next chains into an action sequence, and read widget /AA pointer and focus triggers along with each widget's partial field names. AnnotationOverlay::perform_action runs the action a trigger selects: hide steps commit one SetHidden Core edit that sets or clears the targets' hidden flag, optional content steps change visibility, and the remaining steps return to the host. It replaces set_optional_content_state. Entries list the triggers that have an action, and the web layer reports activation, pointer enter/exit, press/release, and focus/blur for them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
/S /Hideactions (/Tfield names or object references,/H), flatten/Nextchains intoAnnotationAction::Sequence, and read widget/AApointer and focus triggers (E X D U Fo Bl) plus each widget's partial field names. The new fields are#[serde(default)], so existing sidecars still load.SetHidden { hidden, shown }and the change eventChange::VisibilityUpdated. A Hide action sets or clears each target's/FHidden flag as one revision. Targets already in the requested state are skipped, so repeating an action commits nothing.AnnotationOverlay::perform_action(id, trigger)replacesset_optional_content_stateat every layer:SetOCGStatesteps change optional content visibility.ActionReceipt::host_actionsfor the host.triggersthat have an action. The web layer reports activation, pointer enter/exit, press/release and focus/blur for those triggers. A checkbox or radio also runs its/Aaction after its value is saved.Test plan
cargo clippy --workspace --all-targets -- -D warnings,cargo fmt --checkcargo testfor pdf-annotation-core, pdf-web, pdf-renderer, pdf-document, pdf-object-readercargo xtask annotation-types --check,cargo xtask web-canvas --profile debugtsccheck ofcrates/pdf-web/js🤖 Generated with Claude Code