Skip to content

feat(documenteditor): add Pageless view toggle#119

Draft
juliusknorr wants to merge 1 commit into
mainfrom
worktree-pageless-view
Draft

feat(documenteditor): add Pageless view toggle#119
juliusknorr wants to merge 1 commit into
mainfrom
worktree-pageless-view

Conversation

@juliusknorr

@juliusknorr juliusknorr commented Jun 17, 2026

Copy link
Copy Markdown
Member

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: new btnPageless toggle button, slot, click event, render, and textPageless string.
  • controller/ViewTab.js: onPagelessMode handler + pages:pageless wiring; calls api.SetPagelessMode(...) and persists to localStorage["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

  • Requires the engine API SetPagelessMode/GetPagelessMode (see the sdkjs PR).
  • View preference only — per-user, does not modify the document or affect collaborators.
  • Icon currently reuses the multiple-pages glyph as a placeholder; a dedicated icon can follow.
Screenshot 2026-06-17 at 14 26 05

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: Julius Knorr <jus@bitgrid.net>
@juliusknorr juliusknorr added the enhancement New feature or request label Jun 17, 2026
@juliusknorr juliusknorr changed the title feat(documenteditor): add Pageless view toggle (#2553) feat(documenteditor): add Pageless view toggle Jun 17, 2026
@chrip chrip self-requested a review June 17, 2026 20:38

@chrip chrip left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 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:

  1. No SDK callback: SetPagelessMode in the SDK (api.js of sdkjs PR #53) does not fire an asc_onPagelessMode callback. The engine does not emit a pageless change event back to web-apps.
  2. No fireEvent call: onMultiplePages (controller/ViewTab.js:293) calls this.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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants