Skip to content

[#74366] Adapt PDF exports for semantic identifiers#23093

Open
judithroth wants to merge 4 commits intodevfrom
feature/74366-adapt-pdf-export-for-semantic-identifiers
Open

[#74366] Adapt PDF exports for semantic identifiers#23093
judithroth wants to merge 4 commits intodevfrom
feature/74366-adapt-pdf-export-for-semantic-identifiers

Conversation

@judithroth
Copy link
Copy Markdown
Contributor

@judithroth judithroth commented May 6, 2026

This was rushed a bit because I wanted to get this done before my vacation 😅
This adapts different exports and is probably best reviewed commit by commit.
If you don't see the need for changes and approve, also merge it please!

Ticket

https://community.openproject.org/wp/74366 / https://community.openproject.org/wp/74754

What are you trying to accomplish?

Use semantic IDs in PDF exports for

  • work package details
  • work package lists

This also improves the output of a work package with other linked work packages in the description for the "Contract" Template. Before, the links would not have been expanded (e.g. "##124" would be part of the PDF instead of the nicer expanded representation). This was solved with a shared module.

Out of scope (will be fully covered with https://community.openproject.org/wp/74755):

  • PDF export of meetings

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@judithroth judithroth changed the title WIP [#74366] Adapt PDF exports for semantic identifiers May 7, 2026
@judithroth judithroth force-pushed the feature/74366-adapt-pdf-export-for-semantic-identifiers branch 3 times, most recently from 1b4db6c to f1dd442 Compare May 7, 2026 13:55
@judithroth judithroth marked this pull request as ready for review May 7, 2026 14:19
Copilot AI review requested due to automatic review settings May 7, 2026 14:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adapts PDF export output to use semantic (formatted/display) work package identifiers instead of raw numeric IDs, and extends mention handling so work package mentions render with the correct identifier format.

Changes:

  • Replace numeric ID rendering in multiple PDF exports (titles, tables, Gantt labels) with display_id / formatted_id.
  • Centralize work package mention expansion into a shared module and reuse it across PDF markdown generators.
  • Add/adjust specs to validate classic vs semantic identifier output for filenames, Gantt strings, and markdown mention expansion.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
spec/models/work_packages/pdf_export/work_package_to_pdf_spec.rb Updates expectations to use formatted_id in headings.
spec/models/work_packages/pdf_export/work_package_list_to_pdf_spec.rb Updates list/detail expectations to use display_id.
spec/models/work_packages/pdf_export/work_package_list_to_pdf_gantt_spec.rb Uses formatted_id in Gantt labels; adds classic vs semantic assertions.
spec/models/work_package/pdf_export/document_generator_spec.rb Adds coverage for filename titles and WP mentions in descriptions.
spec/models/exports/pdf/common/markdown/md2_pdf_export_spec.rb New spec file covering mention expansion in classic vs semantic mode.
app/models/work_package/pdf_export/work_package_to_pdf.rb Uses formatted_id / display_id in heading and filename.
app/models/work_package/pdf_export/generator/generator.rb Adds WP mention rendering using shared mention expander.
app/models/work_package/pdf_export/document_generator.rb Uses display_id in filename generation.
app/models/exports/pdf/components/gantt/gantt_builder.rb Uses formatted_id in work package info line.
app/models/exports/pdf/common/work_package_mentions.rb New shared module to expand WP mentions consistently.
app/models/exports/pdf/common/markdown.rb Removes duplicated mention expansion/date helpers in favor of shared module.
app/models/exports/pdf/common/common.rb Changes ID column cell rendering to use display_id link caption.

Comment thread app/models/work_package/pdf_export/generator/generator.rb
Comment thread app/models/work_package/pdf_export/generator/generator.rb
Comment thread app/models/exports/pdf/common/common.rb
Comment thread spec/models/work_packages/pdf_export/work_package_list_to_pdf_gantt_spec.rb Outdated
Comment thread spec/models/exports/pdf/common/markdown/md2_pdf_export_spec.rb Outdated
@judithroth judithroth force-pushed the feature/74366-adapt-pdf-export-for-semantic-identifiers branch 2 times, most recently from b524896 to 81b1a53 Compare May 7, 2026 16:45
@judithroth judithroth force-pushed the feature/74366-adapt-pdf-export-for-semantic-identifiers branch from 81b1a53 to f8c29e8 Compare May 7, 2026 19:06
@judithroth judithroth requested review from a team and as-op May 7, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants