Skip to content
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

Show release notes after installing update #137

Merged
merged 5 commits into from
Feb 15, 2025
Merged

Conversation

justinshannon
Copy link
Contributor

@justinshannon justinshannon commented Feb 15, 2025

Summary by CodeRabbit

  • New Features
    • Release notes are now displayed after updates, triggered by a specific update flag.
    • Introduced an interactive release notes dialog with formatted Markdown content and a “CLOSE” button.
    • The client version text is now clickable, enabling users to open the release notes at any time.
    • Added a command to open release notes directly from the profile view.

Copy link
Contributor

coderabbitai bot commented Feb 15, 2025

Walkthrough

This pull request enhances the application’s update process by integrating a new release notes feature. On startup, the application checks for a “--isUpdated” flag and, if present, retrieves the current release notes via a locator, displaying them in a new dialog. The changes introduce additional dependency injection registrations, a factory method for creating the dialog, modifications to the profile view for interactivity, and an updated updater process. A new markdown rendering package is also added to support markdown display in the dialog.

Changes

File(s) Change Summary
vATIS.Desktop/App.axaml.cs Added new using directives and updated OnFrameworkInitializationCompleted to check for the --isUpdated flag, retrieve release notes via VelopackLocator, and display them in a dialog.
vATIS.Desktop/Container/Factory/WindowFactory.cs, vATIS.Desktop/Ui/IWindowFactory.cs, vATIS.Desktop/Container/ServiceProvider.cs Introduced a new method CreateReleaseNotesDialog in the factory and interface; added transient service registrations for ReleaseNotesDialog and ReleaseNotesDialogViewModel.
vATIS.Desktop/Ui/Dialogs/ReleaseNotesDialog.axaml, vATIS.Desktop/Ui/Dialogs/ReleaseNotesDialog.axaml.cs Added new dialog UI and corresponding reactive code-behind to display and manage release notes.
vATIS.Desktop/Ui/Profiles/ProfileListDialog.axaml, vATIS.Desktop/Ui/ViewModels/ProfileListViewModel.cs Modified the version TextBlock to be interactive by naming it and adding a click behavior; added OpenReleaseNotesCommand with its handling logic in the view model.
vATIS.Desktop/Ui/ViewModels/ReleaseNotesDialogViewModel.cs Added a new view model to bind release notes markdown content via a ReleaseNotes property.
vATIS.Desktop/Updates/ClientUpdater.cs Updated the WaitExitThenApplyUpdatesAsync call to include the restart argument "--isUpdated".
vATIS.Desktop/vATIS.Desktop.csproj Added a package reference for Markdown.Avalonia (version 11.0.3-a1) to enable markdown rendering.

Sequence Diagram(s)

sequenceDiagram
    participant ClientUpdater
    participant App
    participant WindowFactory
    participant Dialog as ReleaseNotesDialog
    participant VM as ReleaseNotesDialogViewModel
    participant User

    ClientUpdater->>App: Restart with "--isUpdated"
    App->>WindowFactory: CreateReleaseNotesDialog()
    WindowFactory->>Dialog: Instantiate with VM
    Dialog->>VM: Bind release notes (via VelopackLocator)
    Dialog->>User: Display release notes dialog
    User-->>Dialog: Close dialog event
Loading
sequenceDiagram
    participant User
    participant ProfileDialog as ProfileListDialog
    participant PLViewModel as ProfileListViewModel
    participant WindowFactory
    participant Dialog as ReleaseNotesDialog
    participant VM as ReleaseNotesDialogViewModel

    User->>ProfileDialog: Click version text
    ProfileDialog->>PLViewModel: Trigger OpenReleaseNotesCommand
    PLViewModel->>WindowFactory: CreateReleaseNotesDialog()
    WindowFactory->>Dialog: Instantiate with VM
    Dialog->>User: Display release notes dialog
    User-->>Dialog: Close dialog event
Loading

Possibly related PRs

Poem

I'm a bunny with a code embrace,
Hopping through changes at a rapid pace.
Release notes bloom with every update hop,
Bringing fresh details non-stop.
I nibble on bugs, watch features evolve,
In a whimsical dance of resolve.
Carrot-coded joy, in each commit I rove!


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (5)
vATIS.Desktop/Ui/ViewModels/ReleaseNotesDialogViewModel.cs (2)

1-1: Add file header with copyright information.

Add the standard copyright header to maintain consistency with other files in the codebase.

+// <copyright file="ReleaseNotesDialogViewModel.cs" company="Justin Shannon">
+// Copyright (c) Justin Shannon. All rights reserved.
+// Licensed under the GPLv3 license. See LICENSE file in the project root for full license information.
+// </copyright>
+
 using ReactiveUI;
🧰 Tools
🪛 GitHub Check: Analyze (cpp)

[warning] 1-1:
A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)


[warning] 1-1:
A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

🪛 GitHub Check: Analyze (csharp)

[warning] 1-1:
A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)


[warning] 1-1:
A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)


16-18: Consider initializing ReleaseNotes in constructor.

The empty constructor might benefit from initializing the ReleaseNotes property, especially if there's a default or placeholder text to show while loading.

vATIS.Desktop/Ui/Dialogs/ReleaseNotesDialog.axaml (1)

11-14: Consider making the window resizable.

The fixed window size (600x500) might not accommodate all release notes content effectively. Long release notes might be difficult to read in a fixed viewport.

-        Width="600" Height="500"
-        CanResize="False"
+        Width="600" Height="500"
+        MinWidth="400" MinHeight="300"
+        CanResize="True"
vATIS.Desktop/Updates/ClientUpdater.cs (1)

68-69: Extract "--isUpdated" flag as a constant.

Consider extracting the "--isUpdated" flag as a constant to maintain consistency and ease future updates.

+    private const string IsUpdatedFlag = "--isUpdated";
+
     public async Task<bool> Run()
     {
         // ... existing code ...
         await _updateManager.WaitExitThenApplyUpdatesAsync(_updateInfo, silent: true,
-            restartArgs: ["--isUpdated"]);
+            restartArgs: [IsUpdatedFlag]);
vATIS.Desktop/Ui/Profiles/ProfileListDialog.axaml (1)

75-81: Consider adding a tooltip for better UX.

The interactive version text block is well-implemented. Consider adding a tooltip to indicate that clicking will show release notes.

-<TextBlock Name="Version" Foreground="White" Text="{Binding ClientVersion, DataType=vm:ProfileListViewModel}" Margin="5,3" TextAlignment="Center" VerticalAlignment="Center" Cursor="Hand">
+<TextBlock Name="Version" Foreground="White" Text="{Binding ClientVersion, DataType=vm:ProfileListViewModel}" Margin="5,3" TextAlignment="Center" VerticalAlignment="Center" Cursor="Hand" ToolTip="Click to view release notes">
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4f201a6 and cc5bf77.

📒 Files selected for processing (11)
  • vATIS.Desktop/App.axaml.cs (3 hunks)
  • vATIS.Desktop/Container/Factory/WindowFactory.cs (1 hunks)
  • vATIS.Desktop/Container/ServiceProvider.cs (2 hunks)
  • vATIS.Desktop/Ui/Dialogs/ReleaseNotesDialog.axaml (1 hunks)
  • vATIS.Desktop/Ui/Dialogs/ReleaseNotesDialog.axaml.cs (1 hunks)
  • vATIS.Desktop/Ui/IWindowFactory.cs (1 hunks)
  • vATIS.Desktop/Ui/Profiles/ProfileListDialog.axaml (1 hunks)
  • vATIS.Desktop/Ui/ViewModels/ProfileListViewModel.cs (7 hunks)
  • vATIS.Desktop/Ui/ViewModels/ReleaseNotesDialogViewModel.cs (1 hunks)
  • vATIS.Desktop/Updates/ClientUpdater.cs (1 hunks)
  • vATIS.Desktop/vATIS.Desktop.csproj (1 hunks)
🧰 Additional context used
🪛 GitHub Check: Analyze (cpp)
vATIS.Desktop/Ui/ViewModels/ReleaseNotesDialogViewModel.cs

[warning] 1-1:
A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)


[warning] 1-1:
A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

🪛 GitHub Check: Analyze (csharp)
vATIS.Desktop/Ui/ViewModels/ReleaseNotesDialogViewModel.cs

[warning] 1-1:
A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)


[warning] 1-1:
A source file is missing a required header. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0073)

⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: build (macos-latest)
  • GitHub Check: build (windows-latest)
  • GitHub Check: Analyze (cpp)
  • GitHub Check: Analyze (csharp)
  • GitHub Check: build (ubuntu-latest)
🔇 Additional comments (13)
vATIS.Desktop/Ui/Dialogs/ReleaseNotesDialog.axaml.cs (1)

15-25: LGTM! Clean implementation of the release notes dialog.

The dialog implementation follows best practices with proper initialization and view model binding.

vATIS.Desktop/Ui/IWindowFactory.cs (1)

101-105: LGTM!

The new method follows the established pattern and is well-documented.

vATIS.Desktop/Container/ServiceProvider.cs (1)

75-75: LGTM!

The new services are correctly registered as transient and follow the established pattern.

Also applies to: 100-100

vATIS.Desktop/Container/Factory/WindowFactory.cs (1)

200-208: LGTM!

The implementation follows the established factory pattern and correctly initializes the dialog with its view model.

vATIS.Desktop/App.axaml.cs (2)

21-21: LGTM!

The new using directives are correctly added to support the release notes functionality.

Also applies to: 33-33, 39-39


21-21: LGTM!

The new using directives are correctly added for the required functionality.

Also applies to: 33-33

vATIS.Desktop/Ui/ViewModels/ProfileListViewModel.cs (5)

22-22: LGTM!

The new using directives are correctly added to support the release notes functionality.

Also applies to: 32-32


142-145: LGTM!

The command property is well-documented and properly exposed.


220-220: LGTM!

The new command is properly disposed.


22-22: LGTM!

The new using directives are correctly added for the required functionality.

Also applies to: 32-32


142-145: LGTM!

The command is properly documented and follows the established pattern.

vATIS.Desktop/vATIS.Desktop.csproj (2)

64-64:

❓ Verification inconclusive

Verify the stability of the alpha version package.

The package reference uses an alpha version (11.0.3-a1). Please verify if this version is stable enough for production use or if a stable version is available.


🌐 Web query:

What is the latest stable version of Markdown.Avalonia?

💡 Result:

The latest stable version of Markdown.Avalonia is 11.0.2, released on September 3, 2023[2][4]. This version supports .NET frameworks including .NETCoreApp 2.0, .NETFramework 4.6.1, .NETStandard 2.0, and net6.0[2][4].

While newer prerelease versions like 11.0.3-a1 exist (released March 17, 2024)[5][7], these are marked as development builds and not considered stable releases[2][4][7]. The compatibility table shows that version 11.0.x aligns with Avalonia UI 11.x series[1], which itself follows a quarterly release cycle[6].

Citations:


Stability of Markdown.Avalonia Package

  • The project currently references the alpha release version 11.0.3-a1.
  • A web query confirms that the latest stable version is 11.0.2 (released September 3, 2023).
  • Please verify if the alpha release is intentionally used for testing new features or if production stability is paramount. If stability is required, consider updating the package reference in vATIS.Desktop/vATIS.Desktop.csproj (line 64) to version 11.0.2.

64-64:

❓ Verification inconclusive

Verify the stability of the alpha version package.

The package Markdown.Avalonia is using an alpha version (11.0.3-a1). While this version may work, it could have stability issues.


🌐 Web query:

What is the latest stable version of Markdown.Avalonia?

💡 Result:

The latest stable version of Markdown.Avalonia is 11.0.2, released on September 3, 2023[2][4]. This version remains the most recent non-prerelease package as of February 2025, with subsequent updates like 11.0.3-a1 (March 2024) being prerelease candidates[7].

Key details:

  • Compatible with .NET 6+ and Avalonia UI 11.x[1][4]

  • Available as two NuGet packages:

    Package Features Version
    Markdown.Avalonia Includes syntax highlighting via AvaloniaEdit 11.0.2[4]
    Markdown.Avalonia.Tight Lightweight version without syntax highlighting 11.0.2[2]

Developers should use these packages unless specifically needing experimental features from prerelease versions like 11.0.3-a1[7].

Citations:


Subject: Evaluate Markdown.Avalonia Package Version Stability

  • File: vATIS.Desktop/vATIS.Desktop.csproj (Line 64)
  • Current Reference:
    <PackageReference Include="Markdown.Avalonia" Version="11.0.3-a1" />
  • Context: The alpha version (11.0.3-a1) is currently in use, but the latest stable version available is 11.0.2 (released on September 3, 2023). Alpha releases may introduce instability.
  • Action: Please verify if any experimental features in the alpha version are necessary. If stable behavior is preferred, consider switching to 11.0.2 to ensure reliability.

vATIS.Desktop/App.axaml.cs Outdated Show resolved Hide resolved
vATIS.Desktop/Ui/ViewModels/ProfileListViewModel.cs Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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)
vATIS.Desktop/Ui/Profiles/ProfileListDialog.axaml (1)

75-81: LGTM! Consider enhancing keyboard accessibility.

The implementation follows UI/UX best practices with clear visual feedback (hand cursor) and user guidance (tooltip). The MVVM pattern is properly followed with the command binding.

Consider adding keyboard accessibility by:

  1. Making the TextBlock focusable
  2. Adding keyboard event handling
 <TextBlock Name="Version" 
            Foreground="White" 
            Text="{Binding ClientVersion, DataType=vm:ProfileListViewModel}" 
            Margin="5,3" 
            TextAlignment="Center" 
            VerticalAlignment="Center" 
            Cursor="Hand" 
+           Focusable="True"
+           KeyboardNavigation.TabIndex="0"
            ToolTip.Tip="Click to view release notes">
     <Interaction.Behaviors>
         <RoutedEventTriggerBehavior RoutedEvent="{x:Static InputElement.PointerPressedEvent}" SourceInteractive="Version">
             <InvokeCommandAction Command="{Binding OpenReleaseNotesCommand, DataType=vm:ProfileListViewModel}"/>
         </RoutedEventTriggerBehavior>
+        <RoutedEventTriggerBehavior RoutedEvent="{x:Static InputElement.KeyDownEvent}" SourceInteractive="Version">
+            <InvokeCommandAction Command="{Binding OpenReleaseNotesCommand, DataType=vm:ProfileListViewModel}">
+                <InvokeCommandAction.EventArgsConverter>
+                    <KeyEventArgsConverter Key="Enter,Space"/>
+                </InvokeCommandAction.EventArgsConverter>
+            </InvokeCommandAction>
+        </RoutedEventTriggerBehavior>
     </Interaction.Behaviors>
 </TextBlock>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cc5bf77 and f6a9d51.

📒 Files selected for processing (4)
  • vATIS.Desktop/App.axaml.cs (3 hunks)
  • vATIS.Desktop/Ui/Profiles/ProfileListDialog.axaml (1 hunks)
  • vATIS.Desktop/Ui/ViewModels/ProfileListViewModel.cs (7 hunks)
  • vATIS.Desktop/Ui/ViewModels/ReleaseNotesDialogViewModel.cs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • vATIS.Desktop/App.axaml.cs
  • vATIS.Desktop/Ui/ViewModels/ReleaseNotesDialogViewModel.cs
  • vATIS.Desktop/Ui/ViewModels/ProfileListViewModel.cs
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: build (macos-latest)
  • GitHub Check: build (windows-latest)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: Analyze (cpp)
  • GitHub Check: Analyze (csharp)
  • GitHub Check: Analyze (cpp)
  • GitHub Check: Analyze (csharp)

@justinshannon justinshannon added this pull request to the merge queue Feb 15, 2025
Merged via the queue into main with commit a041856 Feb 15, 2025
9 checks passed
@justinshannon justinshannon deleted the feat/release-notes branch February 15, 2025 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant