diff --git a/Cargo.lock b/Cargo.lock index 730b640..34c1235 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -921,7 +921,7 @@ dependencies = [ [[package]] name = "pdf-presenter" -version = "0.1.10" +version = "0.1.11" dependencies = [ "font8x8", "softbuffer", diff --git a/Cargo.toml b/Cargo.toml index e0c208f..ab85d7a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ default-members = ["crates/pdf-presenter"] resolver = "3" [workspace.package] -version = "0.1.10" +version = "0.1.11" 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 f41af32..22ea01d 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,6 +2,16 @@ ## Unreleased +### 0.1.11 + +- Add independently hideable presenter header/footer to the HTML concept, with + edge-hover reveal and right-click controls to restore/pin either bar. Hidden bars + release space; transient reveals overlay the content and remain usable on hover. +- Save pinned bar visibility per project/globally. Older layouts default to both + visible; temporary reveals never change saved preferences. Native UI remains pending. + Validation: JavaScript syntax and 67 Firefox checks (19 bar-visibility/recovery, + 24 layout/persistence and 24 slide-browser/display-group regressions). + ### 0.1.10 - Add number + Enter slide jumps and a separate windowed thumbnail browser to the diff --git a/docs/design/presenter-menu.html b/docs/design/presenter-menu.html index 1ab57aa..49f1e97 100644 --- a/docs/design/presenter-menu.html +++ b/docs/design/presenter-menu.html @@ -13,30 +13,33 @@ main{display:flex;flex-direction:column;min-height:430px;max-width:none}.preview .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} +.chrome-menu{position:fixed;z-index:30;width:230px;padding:8px;background:#203033;border:1px solid #557177;border-radius:10px;box-shadow:0 12px 45px #0008}.chrome-menu button{display:block;width:100%;text-align:left;border:0;background:transparent}.chrome-menu button:hover{background:#35484c}#presenterHeader.peek{position:fixed;top:var(--concept-height,0px);left:0;right:0;z-index:8;background:#192528;box-shadow:0 12px 35px #0008}#presenterFooter.peek{position:fixed;bottom:0;left:0;right:0;margin:0;padding:14px 24px;z-index:8;background:#192528;box-shadow:0 -12px 35px #0008}.layout-open #presenterFooter.peek{right:330px}.menu{z-index:10}@media(max-width:850px){.layout-open #presenterFooter.peek{right:0}}
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

-
+

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/development/tasks.md b/docs/development/tasks.md index 7f25db2..a95a88b 100644 --- a/docs/development/tasks.md +++ b/docs/development/tasks.md @@ -94,6 +94,8 @@ Depends on usable PDF output and acknowledged displayed-slide state. requested/preparing/displayed slides and blank state; keep every dialog on presenter. Let the speaker independently show/hide and resize previous/current/next previews, notes, elapsed time and local HH:MM time. Hidden widgets reclaim space. + Header/footer can be hidden independently and recovered by edge hover or right-click; + persist pinned visibility with project/global layouts, not temporary reveals. Provide explicit project and all-project saves; project layouts override the global default, with an action to remove the current project override. Keep complete notes fitted, and persist layout visibility/sizes in the global settings contract. diff --git a/docs/interfaces/html-layout-storage.md b/docs/interfaces/html-layout-storage.md index 0b70538..c69b288 100644 --- a/docs/interfaces/html-layout-storage.md +++ b/docs/interfaces/html-layout-storage.md @@ -11,6 +11,12 @@ Each layout contains `previous`, `current`, `next`, `notes`, `elapsed` and `cloc Each widget has a boolean `show` and an integer `size`. Every widget, including current, can be hidden. Preview sizes are relative width weights: previous/next 30–160, current 60–200. Notes size is a height percentage 12–65; elapsed/clock sizes are CSS pixels 16–72. +Layouts also carry `chrome: {"header": true, "footer": true}` with boolean pinned +visibility. Old version-1 records omitting `chrome` load with both visible; explicit +invalid types are rejected. Temporary edge reveals are never saved. Hidden bars +reveal as overlays near the corresponding edge, and can be pinned from the right-click +menu or their own button. Hiding them releases layout space; clocks inside a hidden +header are hidden with it, without losing their individual visibility preferences. No document contents, notes, screen assignments or elapsed time are persisted. Load precedence: project override, global default, built-in balanced layout. @@ -24,7 +30,7 @@ it does not erase saved layouts. Example (a complete all-project default without overrides): ```json -{"version":1,"global":{"previous":{"show":true,"size":60},"current":{"show":true,"size":130},"next":{"show":true,"size":75},"notes":{"show":true,"size":28},"elapsed":{"show":true,"size":28},"clock":{"show":true,"size":28}},"projects":{}} +{"version":1,"global":{"previous":{"show":true,"size":60},"current":{"show":true,"size":130},"next":{"show":true,"size":75},"notes":{"show":true,"size":28},"elapsed":{"show":true,"size":28},"clock":{"show":true,"size":28},"chrome":{"header":true,"footer":true}},"projects":{}} ``` Reject unsupported versions, malformed envelopes, missing widgets, wrong types, @@ -49,3 +55,7 @@ It is not a native-application or physical-display acceptance test. Version 1 now accepts `current.show: false`; previously saved layouts remain valid. With all slide previews hidden, visible notes expand into the released space. + +`tests/browser/chrome-visibility.js` additionally checks saved bar visibility, legacy +record defaults, edge reveal, pointer/focus retention and right-click recovery. Append +it to a temporary HTML copy and wait for its asynchronous PASS/FAIL report. diff --git a/tests/browser/chrome-visibility.js b/tests/browser/chrome-visibility.js new file mode 100644 index 0000000..c7b1e18 --- /dev/null +++ b/tests/browser/chrome-visibility.js @@ -0,0 +1,35 @@ +// Append to a temporary copy of the concept. Wait for the asynchronous PASS/FAIL report. +window.addEventListener('load', async () => { + const results=[];const check=(value,label)=>{if(!value)throw Error(label);results.push(label);}; + const wait=()=>new Promise(resolve=>setTimeout(resolve,750)); + const pointer=(target,y)=>target.dispatchEvent(new PointerEvent('pointermove',{bubbles:true,clientX:300,clientY:y})); + const original=localStorage.getItem(layoutStorageKey); + try { + layout=structuredClone(layoutDefaults);applyLayout(); + const main=document.querySelector('main');const initial=main.clientHeight; + $('hideHeader').click();$('hideFooter').click(); + check($('presenterHeader').hidden&&$('presenterFooter').hidden,'Both bars can be hidden'); + check(main.clientHeight>initial,'Hidden header releases height'); + check(layout.elapsed.show&&layout.clock.show,'Clock preferences preserved while header hidden'); + pointer(document.body,2);check(!$('presenterHeader').hidden&&$('presenterHeader').classList.contains('peek'),'Top edge reveals header'); + check(main.clientHeight>initial,'Reveal overlays without taking layout space'); + check(!layout.chrome.header,'Transient reveal does not pin header'); + pointer($('presenterHeader'),80);await wait();check(!$('presenterHeader').hidden,'Header remains while pointer is on it'); + pointer(document.body,innerHeight/2);await wait();check($('presenterHeader').hidden,'Header hides after leaving'); + pointer(document.body,innerHeight-2);check(!$('presenterFooter').hidden,'Bottom edge reveals footer'); + $('next').focus();pointer(document.body,innerHeight/2);await wait();check(!$('presenterFooter').hidden,'Keyboard focus keeps revealed bar usable'); + $('next').blur();await wait();check($('presenterFooter').hidden,'Footer hides after focus leaves'); + document.body.dispatchEvent(new MouseEvent('contextmenu',{bubbles:true,cancelable:true,clientX:innerWidth-2,clientY:innerHeight-2})); + check(!$('chromeMenu').hidden&&$('contextHeader').textContent==='Show header','Right-click offers recovery'); + const r=$('chromeMenu').getBoundingClientRect();check(r.right<=innerWidth&&r.bottom<=innerHeight,'Context menu stays inside viewport'); + $('contextBoth').click();check(!$('presenterHeader').hidden&&!$('presenterFooter').hidden&&layout.chrome.header&&layout.chrome.footer,'Context menu restores both bars'); + setChromePinned('header',false);setChromePinned('footer',false);saveLayout('project');layout=structuredClone(layoutDefaults);restoreLayout(); + check(!layout.chrome.header&&!layout.chrome.footer,'Hidden bars round-trip per project'); + saveLayout('global');check(!readLayouts().global.chrome.header,'Global save includes visibility'); + const old=structuredClone(layoutDefaults);delete old.chrome;check(validateLayout(old).chrome.header&&validateLayout(old).chrome.footer,'Older records migrate to visible bars'); + let rejected=false;try{validateLayout({...old,chrome:{header:'false',footer:true}});}catch{rejected=true;}check(rejected,'Malformed chrome rejected'); + pointer(document.body,2);$('hideHeader').click();check(layout.chrome.header&&!$('presenterHeader').classList.contains('peek'),'Revealed bar can be pinned'); + 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){document.body.textContent='FAIL: '+error.message;} + finally{if(original===null)localStorage.removeItem(layoutStorageKey);else localStorage.setItem(layoutStorageKey,original);} +});