Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6203 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 704 704
Lines 31100 31100
Branches 4394 4394
=========================================
Hits 31100 31100
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Reviewer's GuideRefactored the PrintButton component to modularize print logic, hide the modal during printing, and add full support for rendering and restoring canvas elements by moving them into placeholders before print and back after. Sequence Diagram for Enhanced Print Process with Canvas SupportsequenceDiagram
actor User
participant PrintScript as "PrintButton.razor.js"
participant DOM
participant BrowserPrint as "Browser Print Service"
User->>PrintScript: Clicks PrintButton, triggers print(el)
PrintScript->>DOM: Hide associated modal
PrintScript->>PrintScript: Call createPrintContent(modalBody)
activate PrintScript
PrintScript->>DOM: Get canvas elements from modalBody
loop For each canvas in modalBody
PrintScript->>DOM: Create placeholder for canvas (via createCanvasPlaceholder)
PrintScript->>DOM: Move canvas to print view (via moveCanvas)
end
PrintScript->>DOM: Create printContainer with content & modified canvases
deactivate PrintScript
PrintScript->>DOM: Append printContainer to document body
PrintScript->>BrowserPrint: window.print()
BrowserPrint-->>User: Show Print Dialog
User-->>BrowserPrint: Interact with Print Dialog (Confirm/Cancel)
PrintScript->>PrintScript: Call restoreCanvas(printContainer)
activate PrintScript
loop For each canvas in printContainer
PrintScript->>DOM: Move canvas back to original DOM placeholder (via moveCanvas)
PrintScript->>DOM: Remove original DOM placeholder
end
deactivate PrintScript
PrintScript->>DOM: Remove printContainer from document body
PrintScript->>DOM: Show associated modal
Updated Class Diagram for PrintButton.razor.js ModuleclassDiagram
class PrintButtonModule {
<<JavaScript Module: PrintButton.razor.js>>
+init(id): void
+print(el): void
+createPrintContent(content): HTMLDivElement
+createCanvasPlaceholder(canvas: HTMLCanvasElement): void
+moveCanvas(canvas: HTMLCanvasElement, target: HTMLElement): void
+restoreCanvas(printContentEl: HTMLDivElement): void
+dispose(id): void
}
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link issues
fixes #6202
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Enable the PrintButton component to correctly render and print canvas elements by moving them into a temporary print container and restoring the original canvases after printing.
New Features:
Bug Fixes:
Enhancements: