-
-
Notifications
You must be signed in to change notification settings - Fork 536
Scheduler: Selection logic #6098
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
Conversation
The SchedulerSelectingTransaction might not be needed at all. For now I'm keeping it. |
# Conflicts: # Source/Extensions/Blazorise.Scheduler/Components/_SchedulerDayAllDayHeader.razor # Source/Extensions/Blazorise.Scheduler/Components/_SchedulerSlot.razor # Source/Extensions/Blazorise.Scheduler/Scheduler.razor
@tesar-tech Please review. The API is now
The enum The |
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.
It works. The only ui issue I saw was:
- Click and drag to create an event
- cancel even
- the clicked slot now has the "hover" bg (see north-west cell from the cursor)
Overall it builds upon the issues that Scheduler brought.
For example views overall should be solved differently - primarily using generic and just switching the implementation for SelectedView. Would save a lot of code when extending the functionality like in this pr. This is a pattern I see throughout the whole implementation, so I guess that's not something to be corrected and I will just go with it.
I will look into the pr one more time (and check the js for example). After this is resolved.
Source/Extensions/Blazorise.Scheduler/Extensions/DateTimeExtensions.cs
Outdated
Show resolved
Hide resolved
Source/Extensions/Blazorise.Scheduler/SchedulerSelectingTransaction.cs
Outdated
Show resolved
Hide resolved
Source/Extensions/Blazorise.Scheduler/Components/_SchedulerDayColumn.razor
Outdated
Show resolved
Hide resolved
Source/Extensions/Blazorise.Scheduler/Components/_SchedulerDayColumn.razor
Outdated
Show resolved
Hide resolved
Source/Extensions/Blazorise.Scheduler/Components/_SchedulerDayColumn.razor
Show resolved
Hide resolved
Source/Extensions/Blazorise.Scheduler/SchedulerSelectingTransaction.cs
Outdated
Show resolved
Hide resolved
Me neither. Probably fixed along with the But now it seems to me some "perf" issue is happening. When I click a slot the dialog appears smoothly, but when I drag it, the dialog is bit laggy. Screencast.From.2025-05-21.09-01-52.webmIt is just a bit slower, but noticeable and constant. Which could mean something is off under the hood. |
I have added a mouse event throttle that might need adjustments. For now, it is set to 150ms. |
I see, that might be it. The lag is also noticeable when you drag. What's the reason behind the throttle? I checked the js. The reason why we need it is the right time call for canceling the selection (mainly the I don't like how the
Screencast.From.2025-05-21.09-40-00.webmThe js Edit: It's not only when you mouseUp outside of the Scheduler, but outside of the current column. |
Mousemove events are called on each per-pixel move, which is too much and can lead to too many re-renderings. So I have throtled them to be executed less often.
The reason is that mouseup only work on element that has the event registered. So if we have the event on a slot element, and we release mouse anywhere else, it will not be registered. Leading to an invalid selection state until we click mouse again. Also, the problem you described in the video should be solved with the JS. I will look into it. |
I cannot reproduce the issue in the video. In any case I have slightly changed logic in |
Make sense, but the 150 jumps dont leave a good impression.
I might be too late, but what about:
No need for throttle, universal response for |
I tried that. The problem then was the synchronization between blazor and js. I still need to render selection element. So if go all-in with JS then I would have to provide it with the CSS classnames that are used by the currently running CSS provider. It worked, but it was more complex in the end. It was easier to go mostly with C#. |
Styling of the selection element would be through c# still, just the event "messaging" would originate in js mostly. The main idea here is the If you are ok with the 150ms "lag" I have no any other objection to solve. |
Optimization can always be done later. As long as the API is stable, I'm OK. |
An attempt to implement slot selection logic for creating new items-