-
-
Notifications
You must be signed in to change notification settings - Fork 236
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
Improve offline web app support across projects (#10200) #10201
Conversation
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis pull request updates various project configurations and components. The workflow now omits SignalR and disables multilingual support during builds. Template exclusion patterns have been refined, and navigation handling in the MainLayout component has been refactored. The offline edit profile page no longer requires authorization and features updated namespace and styling paths. Additionally, a caching attribute is added to the About page, an imports file gains a new using directive, and a new offline support link along with its URL constant has been introduced on the Demos page. Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant ML as MainLayout
participant OEP as OfflineEditProfilePage
Note over ML: Dynamic initialization of navigation items
U->>ML: Open application
ML-->>U: Display navigation options
U->>ML: Click "Offline Edit Profile"
ML->>OEP: Load page (no authorization)
OEP-->>U: Render offline profile content
sequenceDiagram
participant U as User
participant DP as DemosPage
participant Browser as Browser Tab
U->>DP: Visit Demos page
DP-->>U: Show "Offline support web app" link
U->>Browser: Click link (opens new tab)
Browser->>U: Display Offline Support Web App via TodoOfflineWebApp URL
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/workflows/todo-sample.cd.yml (1)
211-211
: Remove trailing whitespace.There's a trailing whitespace at the end of this line that should be removed.
- run: dotnet build TodoSample/src/Client/TodoSample.Client.Core/TodoSample.Client.Core.csproj -t:BeforeBuildTasks -p:Version="${{ vars.APPLICATION_DISPLAY_VERSION}}" -p:MultilingualEnabled=false --no-restore -c Release + run: dotnet build TodoSample/src/Client/TodoSample.Client.Core/TodoSample.Client.Core.csproj -t:BeforeBuildTasks -p:Version="${{ vars.APPLICATION_DISPLAY_VERSION}}" -p:MultilingualEnabled=false --no-restore -c Release🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 211-211: trailing spaces
(trailing-spaces)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
.github/workflows/todo-sample.cd.yml
(2 hunks)src/Templates/Boilerplate/Bit.Boilerplate/.template.config/template.json
(1 hunks)src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Layout/MainLayout.razor.cs
(0 hunks)src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Layout/MainLayout.razor.items.cs
(2 hunks)src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/OfflineEditProfilePage.razor
(0 hunks)src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/OfflineEditProfilePage.razor.cs
(1 hunks)src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/compilerconfig.json
(1 hunks)src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/Components/Pages/AboutPage.razor
(1 hunks)src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/_Imports.razor
(1 hunks)src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/DemosPage.razor
(1 hunks)src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/Urls.cs
(1 hunks)
💤 Files with no reviewable changes (2)
- src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/OfflineEditProfilePage.razor
- src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Layout/MainLayout.razor.cs
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/todo-sample.cd.yml
[error] 211-211: trailing spaces
(trailing-spaces)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build and test
🔇 Additional comments (11)
src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/Urls.cs (1)
52-52
: New URL constant for offline web app support looks good.The addition of the
TodoOfflineWebApp
constant provides a clear reference to the offline edit profile feature. This supports the PR's goal of improving offline web app capabilities.src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/Components/Pages/AboutPage.razor (1)
3-3
:❓ Verification inconclusive
Appropriate caching strategy for static content.
Adding the
AppResponseCache
attribute with a 7-day shared cache and 5-minute individual cache is a good approach for this presumably static page. This will reduce server load and improve performance for returning visitors.
🏁 Script executed:
#!/bin/bash # Check if AppResponseCache is used consistently across other static pages rg -l "AppResponseCache" --type razorLength of output: 67
Below is a revised response that highlights the caching attribute’s proven benefit while noting the need for a manual check of its consistent application across Razor files. In your local environment, please verify using a command like the one provided below:
#!/bin/bash find . -type f -name "*.razor" -exec grep -l "AppResponseCache" {} \;Caching Strategy Verified – Please Manually Confirm Across Razor Pages
• The use ofAppResponseCache
with a 7-day shared cache and 5-minute individual cache is appropriate for static content, as it reduces server load and improves performance.
• Since the original search command using--type razor
failed, ensure that caching is applied consistently in other Razor pages by running the alternative command above.src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/_Imports.razor (1)
20-20
: Appropriate namespace import for attributes.The addition of
@using Boilerplate.Shared.Attributes
is necessary to support theAppResponseCache
attribute used in the AboutPage. This change is consistent with the PR's goal of enhancing offline capabilities.src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/DemosPage.razor (1)
129-129
: New offline support link integrates well with existing navigation options.Adding the "Offline support web app" button provides users with clear access to the offline functionality. The placement within the Todo section is appropriate, and the styling matches other secondary buttons.
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/OfflineEditProfilePage.razor.cs (1)
5-5
: Good change to the namespace structure.Moving the class from the
Authorized.Offline
namespace to the rootPages
namespace aligns with removing the authorization requirement, making the profile page accessible for both authenticated and unauthenticated users in offline mode.src/Templates/Boilerplate/Bit.Boilerplate/.template.config/template.json (1)
472-472
: Exclusion pattern correctly updated.The exclusion pattern now targets specific files with the
OfflineEditProfile
prefix rather than everything in theAuthorized/Offline
directory, which is consistent with the namespace changes and provides more precise control over excluded files.src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/compilerconfig.json (1)
201-202
: Path structure correctly updated.The SCSS/CSS file paths have been updated to reflect the new location of the OfflineEditProfilePage component, removing the
Authorized/Offline
subdirectory path segment to maintain consistency with the namespace changes..github/workflows/todo-sample.cd.yml (2)
192-192
: SignalR dependency removed for offline support.Removing the
--signalR
parameter from project creation is appropriate for enhancing offline support, as SignalR requires a persistent connection which isn't available in offline mode.
210-210
: Disabling multilingual support for offline scenarios.Adding
-p:MultilingualEnabled=false
to build and publish commands is a good optimization for offline applications, as it reduces bundle size and eliminates dependencies that may not work properly without network connectivity.Also applies to: 213-213
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Layout/MainLayout.razor.items.cs (2)
5-7
: Good restructuring of navigation items.Moving to separate lists for authenticated and unauthenticated items makes the code more maintainable and clarifies the navigation structure.
74-87
: Improved navigation accessibility for offline mode.Adding the offline edit profile page to both authenticated and unauthenticated navigation menus is consistent with removing the authorization requirement, ensuring all users can access this functionality when offline.
closes #10200
Summary by CodeRabbit
New Features
Refactor
Chores