Skip to content

TimePicker: Added MinuteSelectionStep Parameter#7174

Merged
henon merged 1 commit intoMudBlazor:devfrom
Zingabopp:feature/timepicker-step
Aug 14, 2023
Merged

TimePicker: Added MinuteSelectionStep Parameter#7174
henon merged 1 commit intoMudBlazor:devfrom
Zingabopp:feature/timepicker-step

Conversation

@Zingabopp
Copy link
Contributor

@Zingabopp Zingabopp commented Jul 9, 2023

Description

This PR adds the option to limit the step interval for minutes using the MinuteSelectionStep parameter. The default behavior is the same.

How Has This Been Tested?

  • Visually - I tested all options using the Docs server.
  • Unit - Created new tests
    • Test to check clicks are correctly rounding to the nearest interval
    • Tests to check that invalid step values are ignored ( step < 1 )

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

@github-actions github-actions bot added enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library PR: needs review labels Jul 9, 2023
@codecov
Copy link

codecov bot commented Jul 9, 2023

Codecov Report

Patch coverage: 80.00% and project coverage change: -0.11% ⚠️

Comparison is base (8e9fcd5) 90.71% compared to head (2f3255e) 90.60%.
Report is 37 commits behind head on dev.

❗ Current head 2f3255e differs from pull request most recent head fdf1a6e. Consider uploading reports for the commit fdf1a6e to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #7174      +/-   ##
==========================================
- Coverage   90.71%   90.60%   -0.11%     
==========================================
  Files         426      427       +1     
  Lines       15098    15162      +64     
==========================================
+ Hits        13696    13738      +42     
- Misses       1402     1424      +22     
Files Changed Coverage Δ
...lazor/Components/TimePicker/MudTimePicker.razor.cs 98.36% <77.77%> (-1.64%) ⬇️
...udBlazor/Components/TimePicker/MudTimePicker.razor 100.00% <100.00%> (ø)

... and 24 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@henon
Copy link
Contributor

henon commented Jul 20, 2023

Hi there, we discussed this in the team and we can see the use-case of a selection step for minute selection especially for intervals of say 5 minutes. However, the inanimous opinion is that the visualization of the clock should not change, no matter what the step is. By not touching the visualization this opens up the possibility to do away with the enum which we also don't feel like a good design choice (I am sure if we add this feature at some point in time somebody will need a time step that is not in the enum). So in essence, we'd be willing to add this feature if you make the following changes:

  • Make the parameter of type int and call it MinuteSelectionStep with default value 1.
  • When the user selects, round to the next minute of MinuteSelectionStep % 60 (modulo), so no matter what value is set (i.e. 65 will result in an effective step of 5). This of course allows steps that make no sense (like 17) but that is up to the user.

What do you say?

@Zingabopp
Copy link
Contributor Author

Those changes sound good to me, I'll make the adjustments soon.

@Zingabopp Zingabopp force-pushed the feature/timepicker-step branch from 2f3255e to e6d6f27 Compare July 30, 2023 21:56
@Zingabopp Zingabopp changed the title TimePicker: Added Step Parameter For Minutes TimePicker: Added MinuteSelectionStep Parameter Jul 30, 2023
@Zingabopp
Copy link
Contributor Author

I have completed the requested changes, it should be ready to go.

@henon
Copy link
Contributor

henon commented Aug 10, 2023

Can you record a GIF using ScreenToGif and post here please? Thanks a lot

@Zingabopp
Copy link
Contributor Author

MinuteSelectionStep

Copy link
Contributor

@henon henon left a comment

Choose a reason for hiding this comment

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

Only minor changes, then this can be merged. Good job!

@henon henon requested a review from ScarletKuro August 12, 2023 07:39
Copy link
Member

@ScarletKuro ScarletKuro left a comment

Choose a reason for hiding this comment

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

LGTM, just need to fix some minor things that @henon mentioned.

@Zingabopp Zingabopp force-pushed the feature/timepicker-step branch 4 times, most recently from 9715daf to 52ebd87 Compare August 14, 2023 07:11
@Zingabopp Zingabopp force-pushed the feature/timepicker-step branch from 52ebd87 to fdf1a6e Compare August 14, 2023 07:14
@Zingabopp Zingabopp requested review from ScarletKuro and henon August 14, 2023 07:27
@mikes-gh
Copy link
Contributor

@ScarletKuro I see the testrunner crashed. There is an updated sdk that fixes some core dump issues I'll update it although I guess rerunning this PR will work

Copy link
Member

@ScarletKuro ScarletKuro left a comment

Choose a reason for hiding this comment

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

lgtm

@henon henon merged commit ac48425 into MudBlazor:dev Aug 14, 2023
@henon
Copy link
Contributor

henon commented Aug 14, 2023

Thank you @Zingabopp !

@Zingabopp Zingabopp deleted the feature/timepicker-step branch August 14, 2023 18:43
ilovepilav pushed a commit to ilovepilav/MudBlazor that referenced this pull request Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants