-
-
Notifications
You must be signed in to change notification settings - Fork 370
feat(PdfReader): add ShowPrint parameter #7191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's GuideUpdates the PdfReaders sample component to demonstrate new configurable PdfReader toolbar options (ShowPrint, ShowDownload, ShowTwoPagesOneView) and wires them to the PdfReader control with sensible defaults and improved layout/styling. Sequence diagram for toggling PdfReader toolbar options at runtimesequenceDiagram
actor User
participant PdfReaders
participant PdfReader
User->>PdfReaders: Toggle Switch bound_to__showDownload
PdfReaders->>PdfReaders: Update _showDownload
PdfReaders->>PdfReader: Re_render with ShowDownload = _showDownload
User->>PdfReaders: Toggle Switch bound_to__showPrint
PdfReaders->>PdfReaders: Update _showPrint
PdfReaders->>PdfReader: Re_render with ShowPrint = _showPrint
User->>PdfReaders: Toggle Switch bound_to__showTwoPagesOneView
PdfReaders->>PdfReaders: Update _showTwoPagesOneView
PdfReaders->>PdfReader: Re_render with ShowTwoPagesOneView = _showTwoPagesOneView
Updated class diagram for PdfReaders sample and PdfReader parametersclassDiagram
class PdfReaders {
-PdfReader PdfReader
-bool _showTwoPagesOneView
-bool _showPrint
-bool _showDownload
-string _url
+Task OnDownloadAsync()
}
class PdfReader {
+string Url
+bool ShowTwoPagesOneView
+bool ShowDownload
+bool ShowPrint
+string ViewHeight
+Func Task OnDownloadAsync
}
PdfReaders --> PdfReader : uses
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
# Conflicts: # src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj # src/BootstrapBlazor.Server/Components/Samples/PdfReaders.razor # src/BootstrapBlazor.Server/Components/Samples/PdfReaders.razor.cs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- The new labels "ShowDownload", "ShowPrint", and "ShowTwoPagesOneView" are hard-coded; consider binding them through
Localizer[...]like the rest of the sample text so they participate in localization. - The inline style
style="--bb-input-group-label-width: 176px;"on the<section>could be moved into a CSS class to keep styling concerns out of the markup and make future adjustments easier.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new labels "ShowDownload", "ShowPrint", and "ShowTwoPagesOneView" are hard-coded; consider binding them through `Localizer[...]` like the rest of the sample text so they participate in localization.
- The inline style `style="--bb-input-group-label-width: 176px;"` on the `<section>` could be moved into a CSS class to keep styling concerns out of the markup and make future adjustments easier.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7191 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 745 745
Lines 32583 32583
Branches 4515 4515
=========================================
Hits 32583 32583
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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a ShowPrint parameter to the PdfReader component, allowing users to control the visibility of the print button. The demo page has been refactored to showcase individual parameter controls with switches.
- Refactored the demo to use individual boolean flags instead of a single options object
- Added ShowPrint, ShowDownload, and ShowTwoPagesOneView switches for user control
- Upgraded BootstrapBlazor.PdfReader package from 10.0.1-beta05 to 10.0.1-beta07
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/BootstrapBlazor.Server/Components/Samples/PdfReaders.razor.cs | Added dependency injections and download handler; replaced options object with individual boolean flags |
| src/BootstrapBlazor.Server/Components/Samples/PdfReaders.razor | Updated UI to show individual parameter switches and pass them directly to PdfReader component |
| src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj | Updated PdfReader package version to support new ShowPrint parameter |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <PdfReader Url="@_url" ShowTwoPagesOneView="_showTwoPagesOneView" | ||
| ShowDownload="_showDownload" ShowPrint="_showPrint" |
Copilot
AI
Nov 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter bindings should use the '@' prefix for C# expressions. The parameters ShowTwoPagesOneView, ShowDownload, and ShowPrint are bound with quotes but no '@' prefix, which will pass them as string literals rather than boolean values. Change to ShowTwoPagesOneView="@_showTwoPagesOneView", ShowDownload="@_showDownload", and ShowPrint="@_showPrint".
| <PdfReader Url="@_url" ShowTwoPagesOneView="_showTwoPagesOneView" | |
| ShowDownload="_showDownload" ShowPrint="_showPrint" | |
| <PdfReader Url="@_url" ShowTwoPagesOneView="@_showTwoPagesOneView" | |
| ShowDownload="@_showDownload" ShowPrint="@_showPrint" |
Link issues
fixes #7190
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Add configurable controls for PdfReader demo to toggle download, print, and two-page view options.
New Features:
Enhancements: