feat(PdfReader): add ShowToolbar parameter#741
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts PdfReader toolbar rendering so the toolbar container is always present while allowing it to be visually hidden via a new CSS variable when ShowToolbar is false, improving layout consistency and enabling external styling based on toolbar visibility. Class diagram for updated PdfReader toolbar and style handlingclassDiagram
class PdfReader {
bool ShowToolbar
bool EnableThumbnails
string ViewHeight
string StyleString
}
class CssBuilder {
CssBuilder Default()
CssBuilder AddClass(string value, bool when)
CssBuilder AddClassFromAttributes(object additionalAttributes)
string Build()
}
PdfReader ..> CssBuilder : builds StyleString
Flow diagram for PdfReader toolbar rendering and CSS variable logicflowchart TD
Start[Start render PdfReader] --> CheckShowToolbar{ShowToolbar?}
CheckShowToolbar -->|true| RenderToolbarContent[Render content inside div.bb-view-toolbar]
CheckShowToolbar -->|false| SkipToolbarContent[Render empty div.bb-view-toolbar]
Start --> BuildStyleString[Build StyleString with CssBuilder]
BuildStyleString --> CheckShowToolbarStyle{ShowToolbar?}
CheckShowToolbarStyle -->|true| NoToolbarHeightVar[Do not add --bb-pdf-toolbar-height]
CheckShowToolbarStyle -->|false| AddToolbarHeightVar[Add CSS variable --bb-pdf-toolbar-height: 0;]
RenderToolbarContent --> RenderMain[Render main PDF area]
SkipToolbarContent --> RenderMain
NoToolbarHeightVar --> RenderMain
AddToolbarHeightVar --> RenderMain
RenderMain --> End[Finish render PdfReader]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Pull request overview
This PR implements the ability to hide the toolbar in the PdfReader component by enhancing the existing ShowToolbar parameter. The feature allows users to toggle the visibility of the entire toolbar while maintaining proper layout calculations through CSS variables.
Key changes:
- Modified toolbar rendering to use CSS height control instead of conditional element rendering
- Set
--bb-pdf-toolbar-heightCSS variable to 0 when toolbar is hidden to adjust container height calculations - Bumped version to 10.0.4-beta02
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| PdfReader.razor | Restructured toolbar div to always render with conditional content, enabling CSS-based height control |
| PdfReader.razor.cs | Added CSS variable override to set toolbar height to 0 when ShowToolbar is false |
| BootstrapBlazor.PdfReader.csproj | Version bump from 10.0.4-beta01 to 10.0.4-beta02 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Link issues
fixes #740
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Adjust PdfReader toolbar rendering and styling when the toolbar is hidden.
Enhancements: