Skip to content

Refactor and UX: PDF rendering improvements#313

Merged
ptabor merged 2 commits into
mainfrom
feature/pdf-rendering-refactor-ux
Jun 11, 2026
Merged

Refactor and UX: PDF rendering improvements#313
ptabor merged 2 commits into
mainfrom
feature/pdf-rendering-refactor-ux

Conversation

@ptabor

@ptabor ptabor commented Jun 11, 2026

Copy link
Copy Markdown

Summary

This PR extracts the duplicated PDF rendering logic into a shared module and applies several UX improvements based on feedback.

Changes

  1. Refactoring:
    • Extracted the Cloud Run POST and polling logic into editor/pdf_renderer.js.
    • Updated index_generator.py to deploy this shared script to the root directory for the Songbook Editor to use.
    • Refactored both editors to use the shared renderPdfCloudRun function.
  2. UX Improvements:
    • Opens a blank tab immediately to prevent popup blockers from interfering during the long polling interval.
    • Brings 'Generuj Śpiewnik (PDF)' to the top-level actions in the Songbook Editor.
    • Hides 'Generuj kod YAML' and its buttons inside an 'Opcje dla zaawansowanych' toggle.
    • Displays an explicit 'Gotowe! Kliknij tutaj, aby pobrać i otworzyć PDF' download button directly in the UI upon successful generation.

ptabor added 2 commits June 11, 2026 20:03
- Creates `editor/pdf_renderer.js` containing the Cloud Run POST and polling logic.
- Updates `editor/index.html` to use the shared logic.
- Updates `songbook_edit.js` and `songbook_edit.html` to use the shared logic.
- Updates `src/html/index_generator.py` to deploy `pdf_renderer.js` for the Songbook Editor.
- Opens a blank tab immediately to avoid browser popup blockers
- Updates pdf_renderer.js to pass URLs back to callers
- Moves 'Generuj Śpiewnik (PDF)' to top level actions in Songbook Editor
- Hides 'Generuj kod YAML' inside an Advanced Options details tag
- Adds an explicit 'Pobierz PDF' download link button in the UI
@ptabor ptabor merged commit b2199be into main Jun 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant