Skip to content

feat(core): add export to PDF for service pages#2345

Open
boyney123 wants to merge 1 commit intomainfrom
feat/core-service-print-export
Open

feat(core): add export to PDF for service pages#2345
boyney123 wants to merge 1 commit intomainfrom
feat/core-service-print-export

Conversation

@boyney123
Copy link
Copy Markdown
Collaborator

What This PR Does

Adds PDF export functionality for service pages, building on the existing message PDF export. Services get two print artifacts: a Summary (quick overview) and a Documentation Pack (comprehensive multi-page document with health scorecard, visualization, per-message detail pages, and appendix).

Changes Overview

Key Changes

  • Summary artifact (service.astro): Single-page overview with service header, overview cards, sends/receives as styled message cards with type badges, version history, and optional documentation/specifications sections
  • Documentation artifact (service-docs.astro): Multi-page document with cover page, table of contents, service health scorecard, mermaid visualization, section dividers for sends/receives with message previews (fade after 8), per-message detail pages with schemas/examples/producers/consumers, and appendix
  • Two layout components: PrintServiceLayout.astro (summary) and PrintServiceDocsLayout.astro (docs) with sidebar navigation, artifact tab switching, settings panel for toggling sections, and print-optimized CSS
  • Shared utilities: Consolidated PRINT_DOT_COLORS and PRINT_BADGE_COLORS constants into utils.ts
  • Bug fix: Added z-50 to CopyPage dropdown menu to fix z-index rendering issue
  • Print fixes: Proper margin handling for print media, cover page sizing to prevent blank pages

How It Works

Service pages get a new "Export to PDF" option in the CopyPage dropdown. Clicking it opens a print-friendly page with two views selectable via left sidebar tabs:

  1. Summary: A concise single-page overview suitable for quick reference
  2. Documentation Pack: A comprehensive multi-page document with cover, health scorecard, visualization, per-message details, and appendix

Both views have a Settings panel (top-right) to toggle section visibility, and an Export PDF button that triggers the browser's print dialog.

Breaking Changes

None

Test plan

  • Verify PDF export link appears on service pages
  • Test Summary artifact renders correctly with sends/receives cards
  • Test Documentation Pack with cover page, health scorecard, visualization
  • Test section divider pages show message previews with fade effect
  • Test print/PDF output has no blank pages and proper margins
  • Test Settings toggles show/hide sections correctly
  • Test sidebar navigation and "All pages" button
  • Test CopyPage dropdown z-index is fixed

🤖 Generated with Claude Code

Add summary and documentation pack print views for services with:
- Summary artifact: overview cards, sends/receives with type badges, version history
- Documentation artifact: cover page, health scorecard, mermaid visualization,
  per-message detail pages with schemas/examples/producers/consumers
- Sidebar navigation with page TOC, section dividers with message previews
- Settings panel for toggling sections, print-optimized layouts
- Fix z-index on CopyPage dropdown menu
- Consolidate print color constants into shared utils

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 16, 2026

🦋 Changeset detected

Latest commit: f58b4d7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@eventcatalog/core Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
eventcatalog-playground Ignored Ignored Mar 16, 2026 3:35pm

Request Review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f58b4d703c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +264 to +265
document.querySelectorAll('[data-print-section="specifications"]').forEach((section) => {
section.style.display = 'none';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Allow specifications section to be re-enabled

The summary artifact script hides data-print-section="specifications" on load, but the settings panel only exposes a Documentation toggle and never re-shows specifications. For services that define specifications, this makes the entire Specifications section permanently invisible in the UI and exported PDF, so users cannot include spec files in the summary document.

Useful? React with 👍 / 👎.

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