← Back to Pull requests

M3: full screen loops after the last page, by preference (#379) #7875

Open
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Nov 19, 2026 19:58 UTC
Author

What this changes

This adds Acrobat's Loop after last page full-screen preference. It sits in Preferences ▸ Documents and view, next to "Esc leaves full screen", and is off by default. It's one of the presentation options tracked in #379 (claimed there).

With it on, in full screen:

  • Any step to the next page on the last page goes back to the first. In two-page view the same goes for the last spread, with or without a cover page. Space, Enter, →, Page Down, a click, the wheel and a NextPage action all go through DocView::step_page, so they all loop.

  • A page's display time (/Dur) on the last page also goes on to the first, so a timed document runs as a kiosk loop.

  • Going back from the first page stays put. A one-page or one-spread document also stays put, and it doesn't redraw every frame. Outside full screen nothing loops.
  • The preference is saved with the others (full_screen_loop). The UI control channel sets it like full-screen-fill and full-screen-escape: set key=full-screen-loop value=on|off. Changing it applies to open documents straight away, because Preferences can be opened while in full screen (PdfCraftApp::set_full_screen_loop).

    !Preferences, light
    !Preferences, dark

    How you verified it

    Commands, on macOS (Apple Silicon):

  • cargo test -p pdfcraft-ui-egui --lib: 1054 passed. This includes two new unit tests:

  • - canvas::tests::full_screen_loops_from_the_last_page_or_spread_to_the_first_only_when_asked covers single page, two-up, two-up with a cover, the preference off, outside full screen, back from the first page, one page and one spread.
    - canvas::tests::a_display_time_on_the_last_page_loops_to_the_first_when_asked checks that with loop off the page stays, with loop on it goes to page 1, and a one-page document doesn't ask for a frame after frame.
  • cargo test -p pdfcraft-ui-egui --test it -- full_screen: 46 passed, including the new view::full_screen_loops_after_the_last_page_when_the_preference_is_on. It checks that:

  • - the preference is off by default, so End then Space stays on the last page;
    - a bad value is refused;
    - turning it on during full screen takes effect at once, so Space now goes to page 1;
    - it survives persist/restore.
  • Red first.

  • - With the step_page and presenter changes reverted, all three new tests fail (left: 2, right: 0).
    - With set_full_screen_loop no longer updating open views, the integration test fails.
  • The whole --test it suite: 1934 passed and 10 failed. The failures are ocr:: ×8, comments::the_selection_bar_stays_inside_the_pages_area and editing::a_custom_property_whose_name_the_tools_refuse_is_listed_and_left_alone. The same 10 fail on a clean main (043ccbdf) on this machine: no OCR models, and font and layout differences. They aren't touched by this change.

  • cargo xtask parity: passes.

  • The screenshots above come from the headless kittest/wgpu renderer with PDFCRAFT_SYSTEM_FONTS=0.
  • cargo fmt --check

  • clippy with -D warnings on the crates I changed (cargo clippy -p pdfcraft-ui-egui --all-targets -- -D warnings)

  • tests pass on the crates I changed (apart from the 10 that also fail on main, see above)

  • cargo xtask layers and cargo xtask assets: N/A, no crate boundaries or assets touched
  • Not run locally: the wasm check and the rest of the workspace. CI runs both.

    Never-crash

  • No new unwrap/expect/panic!/unreachable!/todo! outside tests

  • No indexing or slicing with input-derived positions, and no new arithmetic on file data

  • No unsafe

  • Any crash this fixes has a small synthetic regression test: N/A, not a crash fix
  • Provenance

  • No asset from an Adobe product, and no Adobe icon recreated, traced or imitated

  • No font files committed here

  • No GPL/AGPL code copied in

  • Behaviour comes from public documentation (Adobe Acrobat Help, "Full Screen preferences", which this code already cites for the right-click and Esc preferences), not another implementation's source

  • Every new asset has an ATTRIBUTION.toml entry: N/A, no assets
  • Security

  • MCP and the UI control channel are unchanged apart from one more set key

  • No new outbound network access
  • Parity and reach

  • parity/acrobat-features.toml is updated:

  • - view.full-screen-presentation and misc.prefs-full-screen say loop is done and list what's still missing (advance every N seconds, a default transition, ignoring the document's transitions, a navigation bar, …). The new tests are added as evidence, and both entries stay partial.
    - view.full-screen no longer lists loop as missing.
  • Reachable without the GUI through the UI control channel, like the other full-screen preferences. Full screen itself has no engine or automation tool, so neither does this.

  • Docs: not changed, because docs/ui-parity.md doesn't list the full-screen preferences one by one.
  • Anything a reviewer should look at first

  • Going back from the first page doesn't wrap to the last. Acrobat's help describes the option only as returning to the first page after the last, so I kept it one-way. It's easy to extend if you'd rather it wrap both ways.

  • The new strings ("Loop after last page" and its hint) have no translations yet, so they show in English until craft-i18n has them.
  • <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    New Features
    Full-screen presentations can loop from the last page or spread back to the first, including during timed playback.
    Enable this with the “Loop after last page” preference. It’s off by default, saved between sessions, and applies to open documents.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: mansur-akhmadi Review duration: 17344m
    All Vouch review confidence checks passed
    Residual risk 0.28 = Change Risk (0.52) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #7875"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 27.7% · Safe to merge
    27.7%