Skip to content

Enhanced exporting and printing - #2903

Open
silverkszlo wants to merge 4 commits into
mainfrom
feat/enhanced-export
Open

silverkszlo wants to merge 4 commits into
mainfrom
feat/enhanced-export

Conversation

@silverkszlo

@silverkszlo silverkszlo commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

📝 Summary

"Export or print" now opens the print view with a list of all pages next to the preview. Selecting or unselecting a page shows or hides it in the preview right away, so you see exactly what will be exported or printed.

  • Printing: the browser's print dialog no longer opens automatically. It opens from the "Export or print" button at the top right of the print view, after the images on the selected pages have loaded.
  • URL: the selection is kept in the URL as ?pages= or ?exclude= (whichever is shorter, so the URL stays short in large collectives), so it survives a reload. If none of the requested pages exist, or no page is selected, the print view shows an empty state.
  • Public shares: the "Export or print" header action still opens the print view. Inside the print view it is hidden, as the view has its own button.
  • Page shares: the shared page and its subpages now get printed. The page tree now starts at the shared page's parent instead of 0.
  • Layout: page titles line up with the page text, and no blank sheets are printed.

🖼️ Screenshots

Screenshot from 2026-11-16 15-42-57

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests
  • Documentation (README or documentation) has been updated or is not required

🤖 AI

  • The content of this PR was partly or fully generated using AI tools
  • The AI-generated content was reviewed, comprehended and tested by a human

@blizzz blizzz added enhancement New feature or request 2. developing labels Nov 5, 2026
@silverkszlo
silverkszlo marked this pull request as draft November 5, 2026 10:09
@silverkszlo
silverkszlo marked this pull request as ready for review November 11, 2026 15:22
@silverkszlo

Copy link
Copy Markdown
Contributor Author

@marcoambrosini a design review would be much appreciated here :)

Signed-off-by: Silver <s.szmajduch@posteo.de>
Assisted-by: Claude Code:claude-opus-5-5
…ters

Also start at the root page's parent so page shares print their pages.

Signed-off-by: Silver <s.szmajduch@posteo.de>
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Silver <s.szmajduch@posteo.de>
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Silver <s.szmajduch@posteo.de>
Assisted-by: Claude Code:claude-opus-5-5

@mejo- mejo- left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall this looks really nice and is a great improvement in my opinion. I have some comments, none of them critical.

},
},

async mounted() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Deselected pages still hold up the first load (e.g. when opening an URL with exclude=... directly). It's a minor thing, but could easily be refactored to only wait for the pages that are selected to be loaded. This would speed up loading dramatically if load a large collective with only few pages selected.

</div>
<template #list>
<SkeletonLoading v-if="loadingPages" type="items" />
<CollectivePrintPageTree

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What do you think about passing a :disabled="printing" flag to the component that disables the checkboxes while printing is true, so one cannot change the selection while the printing is in process.

this.$imageTimeout()
async print() {
this.printing = true
await this.waitForImages()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe better to catch errors here:

async print() {
        this.printing = true
        try {
                await this.waitForImages()
        } finally {
                this.printing = false
        }
        await this.$nextTick()
        if (!this.canPrint) {
                return
        }
        document.title = this.documentTitle
        window.print()
},

* @param checked Whether to select the pages
*/
togglePage(node: PageTreeNode<PageInfo>, checked: boolean) {
const selectedIds = new Set(this.selectedIds)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Creating a new Set each time will result in the full page tree being reloaded each time. Better to change the Set in place, so selectedIds prop keeps its identity:

togglePage(node: PageTreeNode<PageInfo>, checked: boolean) {
        // Change the reactive set in place, so only the checkboxes of changed pages re-render
        for (const id of subtreePageIds(node)) {
                if (checked) {
                        this.selectedIds.add(id)
                } else {
                        this.selectedIds.delete(id)
                }
        }
        this.renderSelectedPages()
        this.updateRouteQuery()
},

/**
 * Render selected pages that were not rendered before
 */
renderSelectedPages() {
        for (const id of this.selectedIds) {
                if (!this.renderedIds.has(id)) {
                        this.renderedIds.add(id)
                        this.waitingFor.add(id)
                }
        }
},

this.selectedIds() would go away and mounted() would need to be updated accordingly.

*
* Waits 1 sec for each image (min 3 sec, max. 15 sec) and gives up afterwards.
*/
async waitForImages(): Promise<void> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

On error events (because an image did not get loaded), the function waits for the full timeout. Better to count error events as finished as well.

This branch has not been deployed

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

Labels

2. developing enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improved export/print dialog

3 participants