feat(documenteditor): add Pageless view toggle#119
Conversation
Assisted-by: ClaudeCode:claude-opus-4-8 Signed-off-by: Julius Knorr <jus@bitgrid.net>
chrip
left a comment
There was a problem hiding this comment.
🔴 Critical: pages:pagelesschanged handler is dead code (controller/ViewTab.js:111-115)
The pages:pagelesschanged callback is never reached. Two things prevent it from firing:
- No SDK callback:
SetPagelessModein the SDK (api.jsof sdkjs PR #53) does not fire anasc_onPagelessModecallback. The engine does not emit a pageless change event back to web-apps. - No
fireEventcall:onMultiplePages(controller/ViewTab.js:293) callsthis.view.fireEvent('pages:multiplechanged', [pressed]).onPagelessMode(controller/ViewTab.js:298-303) does not fire any event.
As a result, the callback at lines 111-115 is unreachable. api.SetPagelessMode, localStorage.setBool, and btnPageless.toggle inside it never execute, leaving the button state and persistence broken after any programmatic state change.
Fix: Follow the onMultiplePages pattern. Remove api.SetPagelessMode() and localStorage.setBool() from onPagelessMode itself, and replace them with this.view.fireEvent('pages:pagelesschanged', [pressed]). The callback handler already contains those calls and will now actually execute. Additionally, Statusbar.js needs a corresponding listener on ViewTab.pages:pagelesschanged to sync the statusbar button, mirroring what exists for pages:multiplechanged.
🟡 Missing zoomCustomMode() call (controller/ViewTab.js:298)
onMultiplePages calls this.api.zoomCustomMode() before SetMultipageViewMode. onPagelessMode omits this. If pageless mode should release fit-to-page/fit-to-width zoom constraints (which it almost certainly does as a continuous scroll view), this is a functional gap. Consider adding this.api.zoomCustomMode() before api.SetPagelessMode(pressed).
🟡 No mutual exclusion with Multiple Pages
Multiple Pages and Pageless can be active simultaneously. The engine (HtmlPage.js in sdkjs PR #53) sets isPagelessMode independently of multipage mode. Having both enabled is likely an invalid or confusing visual state. Consider wiring them as a mutually exclusive group, or explicitly disable one when the other activates.
🟡 Missing btnPageless.updateHint() in onAppReady (view/ViewTab.js:540-563)
All other buttons get their tooltips set in onAppReady (view/ViewTab.js:540-563), but btnPageless is skipped. Additionally, tipPageless is never defined in the text strings. Users will see no tooltip for the button.
Fix: Add tipPageless: 'Pageless mode' (or similar) to the text strings, and call this.btnPageless.updateHint(this.tipPageless) in onAppReady.
🟢 Minor: Placeholder icon (view/ViewTab.js:320)
Reuses toolbar__icon btn-multiple-pages for the pageless button. Two adjacent identical icons are confusing. Needs a dedicated icon, or at least a tracked follow-up issue to resolve the placeholder.
Assisted-by: OpenCode:Qwen3.6-27B
Pageless view for the document editor
Requires Euro-Office/sdkjs#53
Adds a Pageless toggle to the document editor's View tab. When enabled, the engine renders the document as one continuous sheet (no page gaps/outlines). Mirrors the existing Multiple Pages toggle end-to-end.
Changes
view/ViewTab.js: newbtnPagelesstoggle button, slot, click event, render, andtextPagelessstring.controller/ViewTab.js:onPagelessModehandler +pages:pagelesswiring; callsapi.SetPagelessMode(...)and persists tolocalStorage["de-pageless-mode"].controller/Main.js: restores the saved preference on editor load so it survives reload.locale/en.json:DE.Views.ViewTab.textPageless(English; other locales fall back).Notes
SetPagelessMode/GetPagelessMode(see the sdkjs PR).