From 9f79ba1c158ad2fac1c4b36fa6585ff41175643d Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Thu, 19 Nov 2026 16:41:17 +0100 Subject: [PATCH] Prototype slide jumps, windowed slide browser and mirrored display roles --- AGENT_DOCUMENTATION.md | 2 + Cargo.lock | 2 +- Cargo.toml | 2 +- docs/changelog.md | 11 +++++ docs/design/presenter-menu.html | 83 ++++++++++++++++++++++++++++----- docs/design/slide-browser.md | 39 ++++++++++++++++ docs/development/plan.md | 4 +- docs/development/tasks.md | 9 ++++ tests/browser/slide-browser.js | 32 +++++++++++++ 9 files changed, 168 insertions(+), 16 deletions(-) create mode 100644 docs/design/slide-browser.md create mode 100644 tests/browser/slide-browser.js diff --git a/AGENT_DOCUMENTATION.md b/AGENT_DOCUMENTATION.md index 3eff9c5..6cb1f41 100644 --- a/AGENT_DOCUMENTATION.md +++ b/AGENT_DOCUMENTATION.md @@ -17,3 +17,5 @@ - [Picture folders and notes requirements](docs/interfaces/picture-folders.md) (planned). - [Interactive presenter menu concept](docs/design/presenter-menu.html) (browser mockup, not native UI). + +- [Slide browser and mirrored display concept](docs/design/slide-browser.md). diff --git a/Cargo.lock b/Cargo.lock index 6f5968e..730b640 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -921,7 +921,7 @@ dependencies = [ [[package]] name = "pdf-presenter" -version = "0.1.9" +version = "0.1.10" dependencies = [ "font8x8", "softbuffer", diff --git a/Cargo.toml b/Cargo.toml index 27c6549..e0c208f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ default-members = ["crates/pdf-presenter"] resolver = "3" [workspace.package] -version = "0.1.9" +version = "0.1.10" edition = "2024" license = "MIT" repository = "https://proxy.dandaedre.com/gitea/idle-org/pdf-presenter" diff --git a/docs/changelog.md b/docs/changelog.md index c90e6bb..f41af32 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,6 +2,17 @@ ## Unreleased +### 0.1.10 + +- Add number + Enter slide jumps and a separate windowed thumbnail browser to the + HTML concept. Preview size is adjustable; clicks select without changing output + unless Change on click is enabled. Explicit Show selected changes the slide. +- Allow several simulated monitors per presenter/presentation role, with group swap + and missing-monitor fallback. The slide browser has a simulated monitor preference, + defaulting to presenter; actual monitor routing and native implementation are pending. + Validation: JavaScript syntax, real Firefox popup inspection, 24 navigation/popup/ + mirrored-display checks and 24 existing layout/persistence regression checks. + ### 0.1.9 - Allow hiding the current-slide preview in the HTML concept and saved layouts. diff --git a/docs/design/presenter-menu.html b/docs/design/presenter-menu.html index b789b7d..1ab57aa 100644 --- a/docs/design/presenter-menu.html +++ b/docs/design/presenter-menu.html @@ -12,15 +12,16 @@ main{display:flex;flex-direction:column;min-height:430px;max-width:none}.preview .slide-stage{flex:1;min-height:0;display:grid;place-items:center;container-type:size;background:#121c1f;border-radius:10px}.previews .slide-stage .slide{flex:none;width:min(100cqw,calc(100cqh * 16 / 9));height:auto;aspect-ratio:16/9;padding:7%;container-type:inline-size}.slide-stage .slide h1{font-size:clamp(12px,8cqw,64px)} .layout-save{position:sticky;bottom:-24px;background:#192528;padding:16px 0 24px;border-top:1px solid var(--line);margin-top:18px;display:grid;gap:8px}.layout-save button{font-size:12px}.layout-save p{margin:0;font-size:12px}.project-picker{display:flex;gap:8px;align-items:center}.project-picker select{max-width:180px} .no-previews .notes{flex:1 1 0!important;margin-top:0}footer #outputBadge{font-size:11px;color:var(--accent)} +.screen-roles{display:grid;gap:10px;margin:18px 0}.screen-role{display:flex;align-items:center;justify-content:space-between;gap:12px}.jump-indicator{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#243e39;color:#dffff5;border:1px solid #67e2cd;border-radius:12px;padding:18px 28px;z-index:20;box-shadow:0 12px 40px #0008}
INTERACTIVE CONCEPT · Mock slides and screens. No real display or system settings change.
-
P
Making room for ideasdemo.pdf · 12 slides
Elapsed00:00
Time00:00
+
P
Making room for ideasdemo.pdf · 12 slides
Elapsed00:00
Time00:00
PREVIOUS
LOOKING BACK

Start of presentation

CURRENT · 1 / 12
BEFFROI / FIELD NOTES

Making room
for ideas.

A clear view. A little space. A better presentation.

DESIGN SESSION · NOVEMBER 2026
NEXT2 / 12
THE STARTING POINT

Keep the
focus.

Your slides go to Screen 3 · Epson projector.
Menus and notes stay on the presenter screen.
PRESENTER NOTES · auto-fit

-
← → slides · B blank · Esc close menuPRESENTATION VISIBLEPresenter 1 · Presentation 3
+
-

Where should each view go?

Presenter = your controls and notes. Presentation = slides for viewers.
CONNECTED SCREENS · SIMULATED
Choose destinations, then Apply. Unused screens stay untouched.
Changes apply together.
+

Where should each view go?

Presenter = your controls and notes. Presentation = slides for viewers.
CONNECTED SCREENS · SIMULATED
Choose destinations, then Apply. Unused screens stay untouched.
Changes apply together.

Settings

Proposed app behavior · not operating-system settings
Remember your screens
Keep preferred screen identities, fullscreen choices and notes layout in a per-user configuration. Temporary fallback does not replace your preferred setup.
Configuration location
Linux: $XDG_CONFIG_HOME/pdf-presenter/settings.toml
Defaults to ~/.config/pdf-presenter/settings.toml
Windows: %APPDATA%\Beffroi\PdfPresenter\settings.toml
macOS: ~/Library/Application Support/Beffroi/PdfPresenter/settings.toml
Keep screens awake during presentation
Planned native feature. Includes paused and blanked output; this HTML does not inhibit sleep.
Saved layouts persist in this browser, with project overrides above the all-projects default. Screen assignments remain session-only. The native app's global configuration is not implemented yet.
+ + diff --git a/docs/design/slide-browser.md b/docs/design/slide-browser.md new file mode 100644 index 0000000..a79ca2f --- /dev/null +++ b/docs/design/slide-browser.md @@ -0,0 +1,39 @@ +# Slide navigation and mirrored displays concept + +Implemented for review in [the HTML mockup](presenter-menu.html), not the native app. + +- Type a 1-based slide number, then Enter to show it. The pending number is visible; + Backspace edits, Escape cancels, invalid numbers do not navigate. Text fields, + selectors, modifiers and input composition are excluded. Blanking is preserved. +- All slides opens one reusable, resizable popup, requesting 1000×700 and never + fullscreen. The browser may choose a tab instead or block the popup; report blocking. + The popup closes with its parent. It contains mock slide art, not the reference + image's copyrighted slides. Current and selected slides have separate markers. +- Clicking a thumbnail selects only by default. Show selected explicitly navigates. + Change on click enables immediate navigation; turning it on does not navigate + the existing selection. Every new popup starts with this option off. Number+Enter + remains an explicit navigation action in either window. Preview size is adjustable. +- The popup monitor preference defaults to the first assigned presenter monitor. + An unavailable selected monitor falls back to presenter without erasing preference. + The HTML selector is simulated; physical placement remains a native acceptance task. +- Displays assigns each connected screen one of Presenter, Presentation or Unused. + Multiple screens may share either role. At least one presenter is required; no + presentation screens is valid rehearsal. Swap exchanges entire role groups. + Apply commits together; Cancel leaves assignments untouched. Missing displays are + filtered while surviving assignments remain; fallback stays blanked for review. +- The mock retains browser size/monitor preferences and screen groups in memory only. + Layout-save buttons still save widget layout only. The native settings schema must + define stable monitor IDs, role arrays and browser preferences before persistence. + +Native requirements: synchronized navigation/blanking across outputs, shared prepared +frames with bounded per-output work, no duplicate PDF rendering for identical frames, +no output stalled by another screen, and controls/notes kept off presentation screens. +Thumbnail preparation must be asynchronous and virtualized for large decks. Test +window placement and hotplug with mirrored roles on Windows, macOS, X11 and Wayland. + +Validation harness: append `tests/browser/slide-browser.js` as a script to a temporary +copy of the HTML and run in an isolated Firefox profile allowing popups. Wait for the +PASS/FAIL report after popup open/close; a one-shot screenshot can capture too early. +The 24 checks cover buffered navigation, safe browsing, thumbnail sizing, role groups, +missing monitors and reopening. Run `tests/browser/layout-storage.js` separately for +24 existing layout/persistence checks. Neither test proves native monitor placement. diff --git a/docs/development/plan.md b/docs/development/plan.md index 54a6278..3f921ac 100644 --- a/docs/development/plan.md +++ b/docs/development/plan.md @@ -104,8 +104,8 @@ engineering gates; validate them against reference hardware and user testing. No ## Scope after the core requirements -Multiple audience outputs beyond the required pair of presenter/audience roles, -independent decks per display, remote control, annotations, embedded media and +Mirroring either role onto several monitors and a windowed slide browser are now +required presenter workflow (see the task list). Independent decks per display, remote control, annotations, embedded media and transitions are later scope. Native PPTX playback is not implied. No network service or presentation-switcher integration is required. Preserve source PDFs and never show a wrong or stale slide to achieve a lower latency measurement. diff --git a/docs/development/tasks.md b/docs/development/tasks.md index fcf178a..7f25db2 100644 --- a/docs/development/tasks.md +++ b/docs/development/tasks.md @@ -16,6 +16,9 @@ that an API was identified. Do not mark physical acceptance from unit tests. No PDF dependency on shell startup. Implement monitor enumeration/identification, explicit presenter and audience selection, swapping, fullscreen and emergency blank. Default both roles to fullscreen; retain explicit windowed rehearsal. + Support several monitors per role (e.g. presenter 1+2, presentation 3, or vice versa). + One role per monitor; shared slide/blank/navigation state across mirrored views. + Preserve surviving assignments and isolate each output's rendering/backpressure. - [ ] T03: Test both assignments on Windows and macOS, then Linux X11 and Wayland (GNOME/KDE). Add native adapters where required. Verify actual output placement; an unsupported placement call is a defect, not a completed task. @@ -95,6 +98,12 @@ Depends on usable PDF output and acknowledged displayed-slide state. default, with an action to remove the current project override. Keep complete notes fitted, and persist layout visibility/sizes in the global settings contract. Review the [interactive layout concept](../design/presenter-menu.html) before implementation. + Add digit-buffer + Enter direct slide navigation (1-based), with visible pending + number, Backspace editing, Escape cancellation and range checks; preserve blanking. + Add a separate windowed all-slides browser with adjustable thumbnail size and + Change on click disabled by default. Selection and live slide are separate; provide + explicit Show selected. Place it on a chosen monitor or presenter by default, + falling back to presenter if missing. Bound/virtualize thumbnail loading. - [ ] T17: Extract available notes asynchronously and support explicit notes-page interpretation/cropping. Load image sidecar `.txt` notes and global `notes.json` or `notes.toml`; test precedence, invalid files and missing notes. Always word-wrap and diff --git a/tests/browser/slide-browser.js b/tests/browser/slide-browser.js new file mode 100644 index 0000000..83d2c51 --- /dev/null +++ b/tests/browser/slide-browser.js @@ -0,0 +1,32 @@ +// Append to a temporary HTML concept copy. Use an isolated Firefox profile allowing popups. +window.addEventListener('load', () => { + const results = []; + const check = (value, label) => { if (!value) throw Error(label); results.push(label); }; + const key = (value, doc = document, target = doc.body, options = {}) => target.dispatchEvent(new KeyboardEvent('keydown', {key:value,bubbles:true,cancelable:true,...options})); + const role = (id, value) => { $('screenRole'+id).value=value; $('screenRole'+id).dispatchEvent(new Event('change')); }; + try { + key('1'); key('2'); check(page === 0, 'Typing does not navigate'); key('Enter'); check(page === 11, 'Number + Enter jumps to slide 12'); + key('9'); key('9'); key('Enter'); check(page === 11 && !$('jumpIndicator').hidden, 'Invalid number keeps current slide'); + key('Escape'); check($('jumpIndicator').hidden, 'Escape cancels pending jump'); + key('1'); key('2'); key('Backspace'); key('Enter'); check(page === 0, 'Backspace edits pending number'); + key('2',document,$('topology')); key('Enter'); check(page === 0, 'Input controls do not trigger jumps'); + key('2',document,document.body,{ctrlKey:true}); key('Enter'); check(page === 0, 'Modified keys do not trigger jumps'); + blank=true;key('3');key('Enter');check(page===2 && blank, 'Direct jump preserves blanking'); + openGallery(); check(galleryWindow && !galleryWindow.closed, 'Separate popup opens'); + const doc=galleryWindow.document; + check(doc.querySelectorAll('.thumbnail').length===12 && !doc.fullscreenElement, 'All thumbnails in a non-fullscreen popup'); + doc.querySelectorAll('.thumbnail')[7].click();check(gallery.selected===7 && page===2, 'Default click browses without navigation'); + doc.getElementById('changeOnClick').checked=true;doc.getElementById('changeOnClick').dispatchEvent(new Event('change'));check(page===2, 'Enabling click change does not activate selection'); + doc.querySelectorAll('.thumbnail')[8].click();check(page===8 && blank, 'Opt-in click changes slide and preserves blanking'); + doc.getElementById('changeOnClick').checked=false;doc.getElementById('changeOnClick').dispatchEvent(new Event('change'));doc.querySelectorAll('.thumbnail')[1].click();doc.getElementById('showSelected').click();check(page===1, 'Show selected explicitly navigates'); + key('1',doc);key('0',doc);key('Enter',doc);check(page===9, 'Number shortcut works in popup'); + doc.getElementById('thumbnailSize').value='350';doc.getElementById('thumbnailSize').dispatchEvent(new Event('input'));check(gallery.size===350 && doc.getElementById('galleryGrid').style.getPropertyValue('--thumb')==='350px', 'Thumbnail size adjustable'); + openDisplays();role(2,'presenter');$('apply').click();check(active.presenter.join(',')==='1,2' && active.presentation.join(',')==='3', 'Two presenter screens and one presentation'); + openDisplays();$('swap').click();$('apply').click();check(active.presenter.join(',')==='3' && active.presentation.join(',')==='1,2', 'Group swap mirrors presentation instead'); + openDisplays();role(3,'presentation');check($('apply').disabled, 'Cannot apply without a presenter');$('displayDialog').close();check(active.presenter.join(',')==='3', 'Cancel retains applied groups'); + gallery.monitor='3';$('topology').value='2';$('topology').dispatchEvent(new Event('change'));check(active.presenter.join(',')==='1' && active.presentation.join(',')==='2' && blank, 'Missing presenter falls back without role overlap');check(galleryTarget()===1 && gallery.monitor==='3', 'Missing browser monitor falls back without erasing preference'); + $('topology').value='3';$('topology').dispatchEvent(new Event('change'));check(active.presenter.join(',')==='3' && active.presentation.join(',')==='1,2', 'Preferred groups survive reconnect'); + galleryWindow.close();openGallery();check(!gallery.changeOnClick, 'Reopened browser defaults to safe browsing');galleryWindow.close(); + const report=document.createElement('pre');report.style='position:fixed;inset:0;background:#102820;color:white;padding:24px;z-index:100;font:16px monospace;overflow:auto';report.textContent=`PASS · ${results.length} browser checks\n\n${results.join('\n')}`;document.body.append(report); + } catch(error) { if(galleryWindow&&!galleryWindow.closed)galleryWindow.close();document.body.textContent='FAIL: '+error.message; } +});