-
-
Notifications
You must be signed in to change notification settings - Fork 323
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
feat(Memorial): add Memorial Mode #5584
Conversation
Reviewer's Guide by SourceryThis pull request introduces a new "Memorial Mode" feature, which adds a grayscale filter and adjusts colors to give the website a memorial theme. The implementation involves changes to the CSS, JavaScript, and Blazor components to toggle the mode on and off. Additionally, the pull request includes localization improvements and code documentation updates. Sequence diagram for toggling Memorial ModesequenceDiagram
participant User
participant Memorial.razor
participant JSModuleExtensions
participant utility.js
User->>Memorial.razor: Clicks Toggle Button
Memorial.razor->>JSModuleExtensions: LoadUtility()
activate JSModuleExtensions
JSModuleExtensions->>utility.js: Load module
activate utility.js
utility.js-->>JSModuleExtensions: Returns JSModule
deactivate utility.js
JSModuleExtensions-->>Memorial.razor: Returns JSModule
deactivate JSModuleExtensions
Memorial.razor->>JSModuleExtensions: SetMemorialModeAsync(isMemorial)
activate JSModuleExtensions
JSModuleExtensions->>utility.js: setMemorialMode(isMemorial)
activate utility.js
utility.js-->>JSModuleExtensions: void
deactivate utility.js
JSModuleExtensions-->>Memorial.razor: void
deactivate JSModuleExtensions
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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 @ArgoZhang - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding a configuration option to enable/disable memorial mode by default.
- The JS function
setMemorialMode
could be improved by checking if thedata-bs-original-theme
attribute already exists before setting it.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5584 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 649 649
Lines 29623 29625 +2
Branches 4170 4170
=========================================
+ Hits 29623 29625 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Link issues
fixes #5583
Summary By Copilot
This pull request introduces a new "Memorial Mode" feature and includes several localization improvements and code documentation updates. The most important changes are summarized below:
New Feature: Memorial Mode
src/BootstrapBlazor.Server/Components/Samples/Tutorials/Memorial.razor
: Added a new page for the Memorial Mode tutorial.src/BootstrapBlazor.Server/Components/Samples/Tutorials/Memorial.razor.cs
: Implemented the Memorial Mode functionality with a toggle button to switch the mode on and off.src/BootstrapBlazor/Extensions/JSModuleExtensions.cs
: Added a new methodSetMemorialModeAsync
to theJSModuleExtensions
class to handle the Memorial Mode setting in JavaScript.src/BootstrapBlazor/wwwroot/modules/utility.js
: Added a new functionsetMemorialMode
to manage the Memorial Mode in the frontend.src/BootstrapBlazor/wwwroot/scss/root.scss
: Added CSS rules for the Memorial Mode, including grayscale filter and color adjustments.Localization Improvements
src/BootstrapBlazor.Server/Locales/en-US.json
: Added the translation for "MemorialMode".src/BootstrapBlazor.Server/Locales/zh-CN.json
: Added the translation for "MemorialMode".Code Documentation Updates
src/BootstrapBlazor/Extensions/JSModuleExtensions.cs
: Updated method comments to improve clarity and consistency in English. [1] [2] [3]src/BootstrapBlazor/Options/BootstrapBlazorOptions.cs
: Updated property comments to improve clarity and consistency in English.Other Changes
src/BootstrapBlazor.Server/Components/Components/Header.razor
: Commented out the code for the Chinese-specific theme link.src/BootstrapBlazor.Server/Components/Layout/TutorialsNavMenu.razor.cs
: Added a new navigation item for the Memorial Mode tutorial.Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge