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

Remove remaining usages of BitSpinButton (#10249) #10254

Merged

Conversation

msynk
Copy link
Member

@msynk msynk commented Mar 14, 2025

closes #10249

Summary by CodeRabbit

  • Refactor
    • Updated numeric input controls across several pages, replacing the previous increment/decrement controls with more streamlined, direct number entry fields for a consistent user experience.
  • Chores
    • Removed outdated configuration and demonstration elements associated with the legacy numeric input control.

Copy link

coderabbitai bot commented Mar 14, 2025

Walkthrough

The changes remove references to the SpinButton component and update numeric input controls. In the BlazorUI demo, the "SpinButton" entry was removed from the _inputComponents list and its demo configuration was deleted. In the Websites Platform client, SpinButton components in several Butil pages and their code-behind files were replaced with NumberField components to update how numeric inputs are handled.

Changes

File(s) Changed Summary of Changes
src/BlazorUI/Demo/Client/.../DemoPage.razor.cs
src/BlazorUI/Demo/Client/.../compilerconfig.json
Removed the "SpinButton" item from the _inputComponents list and deleted the configuration for BitSpinButtonDemo from the build process.
src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/... Replaced BitSpinButton components with BitNumberField components in the Razor markup and code-behind files (Butil09, Butil11, Butil12) to modify numeric input handling.

Poem

Hopping through lines of code so bright,
I found a change that feels just right.
SpinButtons have hopped away,
NumberFields now lead the day.
With every tap and every key,
This bunny cheers in joyful glee!
🐇💻

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
  • @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.

Sorry, something went wrong.

Copy link

@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: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between bc33f38 and fafe40a.

📒 Files selected for processing (8)
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/DemoPage.razor.cs (1 hunks)
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/compilerconfig.json (0 hunks)
  • src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil09StoragePage.razor (1 hunks)
  • src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil09StoragePage.razor.cs (1 hunks)
  • src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil11HistoryPage.razor (1 hunks)
  • src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil11HistoryPage.razor.cs (1 hunks)
  • src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil12ElementPage.razor (3 hunks)
  • src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil12ElementPage.razor.cs (3 hunks)
💤 Files with no reviewable changes (1)
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/compilerconfig.json
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build and test
🔇 Additional comments (12)
src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil09StoragePage.razor.cs (1)

96-96: Component replaced correctly.

The BitSpinButton component has been correctly replaced with BitNumberField for the keyIndex input in the example code.

src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/DemoPage.razor.cs (1)

166-166: SpinButton component entry successfully removed.

The "SpinButton" entry has been properly removed from the _inputComponents list, which aligns with the PR's objective to remove remaining usages of BitSpinButton.

src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil11HistoryPage.razor.cs (1)

87-87:

✅ Verification successful

Component replaced but mode attribute may need updating.

The BitSpinButton has been replaced with BitNumberField, but the Mode="BitSpinButtonMode.Inline" attribute is still referencing the BitSpinButtonMode enum, which may be incorrect if this enum is specific to the removed component.


🏁 Script executed:

#!/bin/bash
# Check if BitSpinButtonMode is still used by BitNumberField
rg "BitNumberField.*Mode=\"BitSpinButtonMode" -A2 -B2
# Check for the definition of BitSpinButtonMode to see if it's shared
rg "enum BitSpinButtonMode" -A5 -B1

Length of output: 15307


Component mode attribute is valid and intentional.
The BitNumberField component consistently uses the BitSpinButtonMode enum—including its Inline option—as documented by similar usages across pages (e.g., Butil12ElementPage, Butil09StoragePage, etc.). The existing enum definition confirms that BitSpinButtonMode is still active and supports the Inline mode. No update is necessary in this case.

src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil12ElementPage.razor (5)

303-303: LGTM: BitSpinButton replaced with BitNumberField for scrollY.

The replacement of BitSpinButton with BitNumberField while maintaining the Mode property ensures consistent behavior.


305-305: LGTM: BitSpinButton replaced with BitNumberField for scrollX.

The replacement of BitSpinButton with BitNumberField while maintaining the Mode property ensures consistent behavior.


344-344: LGTM: BitSpinButton replaced with BitNumberField for scrollByY.

The replacement of BitSpinButton with BitNumberField while maintaining the Mode property ensures consistent behavior.


346-346: LGTM: BitSpinButton replaced with BitNumberField for scrollByX.

The replacement of BitSpinButton with BitNumberField while maintaining the Mode property ensures consistent behavior.


1205-1205: LGTM: BitSpinButton replaced with BitNumberField for newTabIndex.

The replacement of BitSpinButton with BitNumberField while maintaining the Mode property ensures consistent behavior.

src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil12ElementPage.razor.cs (3)

645-647: LGTM: Updated code example with BitNumberField for scrollY and scrollX.

The code examples have been correctly updated to use BitNumberField instead of BitSpinButton while maintaining the Mode property.


689-691: LGTM: Updated code example with BitNumberField for scrollByY and scrollByX.

The code examples have been correctly updated to use BitNumberField instead of BitSpinButton while maintaining the Mode property.


1461-1461: LGTM: Updated code example with BitNumberField for newTabIndex.

The code example has been correctly updated to use BitNumberField instead of BitSpinButton while maintaining the Mode property.

src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil09StoragePage.razor (1)

75-75: LGTM: BitSpinButton replaced with BitNumberField for keyIndex.

The replacement of BitSpinButton with BitNumberField while maintaining the Mode property ensures consistent behavior. The Min attribute has also been properly preserved.

@msynk msynk merged commit 0eef15e into bitfoundation:develop Mar 14, 2025
3 checks passed
@msynk msynk deleted the 10249-websites-platform-remove-spinbutton branch March 14, 2025 17: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.

The remaining usages of the removed BitSpinButton component should be updated
2 participants