Skip to content

feat(Drivejs): remove AutoDrive parameter#641

Merged
ArgoZhang merged 2 commits intomasterfrom
chore-drivejs
Oct 31, 2025
Merged

feat(Drivejs): remove AutoDrive parameter#641
ArgoZhang merged 2 commits intomasterfrom
chore-drivejs

Conversation

@ArgoZhang
Copy link
Copy Markdown
Member

@ArgoZhang ArgoZhang commented Oct 31, 2025

Link issues

fixes #640

Summary By Copilot

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

Summary by Sourcery

Remove the deprecated AutoDrive parameter from the DriverJs component, streamline the JavaScript start logic to always drive by index, and mark the C# AutoDrive property as obsolete.

Enhancements:

  • Remove the AutoDrive parameter from the DriverJs component and always invoke drive with the provided index
  • Mark the AutoDrive C# property as obsolete and exclude it from code coverage
  • Eliminate AutoDrive extraction in the JavaScript start function and simplify the drive call

Chores:

Copilot AI review requested due to automatic review settings October 31, 2025 05:25
@bb-auto bb-auto Bot added the enhancement New feature or request label Oct 31, 2025
@bb-auto bb-auto Bot added this to the v9.2.0 milestone Oct 31, 2025
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Oct 31, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Removed the deprecated AutoDrive parameter by simplifying the JS start logic to always call drive(index) and marking the C# AutoDrive property as obsolete while stripping it from the invocation payload.

Class diagram for updated DriverJs component (removal of AutoDrive)

classDiagram
    class DriverJs {
        +int? Index
        +Task Start(int? index = 0)
        -bool AutoDrive [Obsolete]
    }
Loading

File-Level Changes

Change Details Files
Streamline JavaScript start logic by removing AutoDrive support
  • Omit autoDrive from the config destructuring
  • Delete the conditional branch that checked autoDrive
  • Invoke driverObj.drive(index) unconditionally
src/components/BootstrapBlazor.DriverJs/Components/DriverJs.razor.js
Deprecate and remove AutoDrive parameter in C# component
  • Add [Obsolete] and [ExcludeFromCodeCoverage] to AutoDrive property
  • Remove AutoDrive field from the Start invocation arguments
src/components/BootstrapBlazor.DriverJs/Components/DriverJs.razor.cs

Assessment against linked issues

Issue Objective Addressed Explanation
#640 Remove the AutoDrive parameter from the Drivejs component codebase.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@ArgoZhang ArgoZhang merged commit 66ca3e2 into master Oct 31, 2025
6 of 7 checks passed
@ArgoZhang ArgoZhang deleted the chore-drivejs branch October 31, 2025 05:25
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a 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 and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown

Copilot AI left a 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 deprecates the AutoDrive parameter in the DriverJs component and removes its usage. The parameter is marked as obsolete instead of being removed entirely to maintain backward compatibility. Additionally, the project now supports both Visual Studio 17.0 (version 9.0.5) and Visual Studio 18.0 (version 10.0.0-rc.2.1.0) with conditional versioning.

  • Deprecated the AutoDrive parameter with an [Obsolete] attribute
  • Removed conditional auto-drive logic in JavaScript, making drive() always execute
  • Added Visual Studio version-based conditional compilation and versioning

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
DriverJs.razor.cs Marked AutoDrive parameter as obsolete with [Obsolete] and [ExcludeFromCodeCoverage] attributes; removed it from the config object sent to JavaScript
DriverJs.razor.js Removed autoDrive destructuring and conditional check, now always calls driverObj.drive(index)
BootstrapBlazor.DriverJs.csproj Added Visual Studio version-based conditional compilation with separate versioning for VS 17.0 and VS 18.0; removed unconditional Version property
Comments suppressed due to low confidence (1)

src/components/BootstrapBlazor.DriverJs/Components/DriverJs.razor.js:29

  • Avoid automated semicolon insertion (92% of all statements in the enclosing function have an explicit semicolon).
            }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


<PropertyGroup>
<Version>9.0.3</Version>
<RootNamespace>BootstrapBlazor.Components</RootNamespace>
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

The Version property has been removed from the unconditional <PropertyGroup> and only defined conditionally. If VisualStudioVersion is not '17.0' or '18.0', no version will be set, which could cause build issues. Consider adding a fallback version in the unconditional PropertyGroup or handle other VisualStudioVersion values.

Suggested change
<RootNamespace>BootstrapBlazor.Components</RootNamespace>
<RootNamespace>BootstrapBlazor.Components</RootNamespace>
<Version>10.0.0-rc.2.1.0</Version>

Copilot uses AI. Check for mistakes.

<ItemGroup>
<ItemGroup Condition="'$(VisualStudioVersion)' == '17.0'">
<PackageReference Include="BootstrapBlazor" Version="$(BBVersion)" />
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

The BootstrapBlazor package reference for Visual Studio 17.0 uses a variable $(BBVersion), while the Visual Studio 18.0 version uses a hardcoded value. This inconsistency makes maintenance harder. Consider either using $(BBVersion) for both versions or hardcoding both for consistency.

Suggested change
<PackageReference Include="BootstrapBlazor" Version="$(BBVersion)" />
<PackageReference Include="BootstrapBlazor" Version="10.0.0-rc.2.1.0" />

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(Drivejs): remove AutoDrive parameter

2 participants