-
-
Notifications
You must be signed in to change notification settings - Fork 254
Add AutoDismissTime parameter to BitMessage (#11426) #11428
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
Add AutoDismissTime parameter to BitMessage (#11426) #11428
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughAdds AutoDismissTime to BitMessage for timed dismissal via OnAfterRenderAsync and updates demos to showcase auto-dismiss behavior with state toggling and parameter documentation. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Page as Demo Page
participant Msg as BitMessage
participant Timer as Task.Delay
participant App as App/Parent (OnDismiss)
User->>Page: Navigate/Render demo
Page->>Msg: Render BitMessage(AutoDismissTime=5s)
activate Msg
Note right of Msg: firstRender: true
Msg->>Timer: await AutoDismissTime
Timer-->>Msg: delay elapsed
Msg->>App: OnDismiss.InvokeAsync()
App-->>Msg: Complete
Msg->>Msg: StateHasChanged()
deactivate Msg
Page-->>User: Message dismissed (UI updated)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. Comment |
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.
Actionable comments posted: 1
🧹 Nitpick comments (4)
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Notifications/Message/BitMessageDemo.razor.cs (1)
24-30: Doc: mention OnDismiss requirement and non-negative durationNice addition. Suggest clarifying that auto-dismiss only activates when OnDismiss has a delegate, and that non-positive values are ignored.
Apply this diff to tweak the description:
- Description = "Enables the auto-dismiss feature and sets the time to automatically call the OnDismiss callback.", + Description = "Enables auto-dismiss and sets the delay before calling OnDismiss. Requires OnDismiss to be set. Non-positive values disable auto-dismiss.",src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Notifications/Message/BitMessageDemo.razor (1)
155-166: Auto‑dismiss demo: works; minor a11y noteThe example behaves as intended. Consider mentioning in the demo text that the message auto-dismisses after 5 seconds so users aren’t surprised. Also be mindful that timed content can affect some users; keep delays reasonable and ensure important info isn’t lost.
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Notifications/Message/BitMessageDemo.razor.samples.cs (1)
109-120: Grammar nit: “alongside of” → “alongside”Tiny copy edit for the sample text.
Apply this diff:
- <BitMessage AutoDismissTime="TimeSpan.FromSeconds(5)" OnDismiss="() => isAutoDismissed = true"> - Auto-Dismiss option enabled by adding <strong>AutoDismissTime</strong> parameter alongside of OnDismiss. + <BitMessage AutoDismissTime="TimeSpan.FromSeconds(5)" OnDismiss="() => isAutoDismissed = true"> + Auto-Dismiss option enabled by adding <strong>AutoDismissTime</strong> parameter alongside OnDismiss.src/BlazorUI/Bit.BlazorUI/Components/Notifications/Message/BitMessage.razor.cs (1)
23-27: Clarify parameter contractConsider documenting that auto-dismiss triggers only once on first render, requires OnDismiss, and ignores non-positive durations to avoid exceptions from negative TimeSpan values.
Apply this doc tweak:
- /// Enables the auto-dismiss feature and sets the time to automatically call the OnDismiss callback. + /// Enables auto-dismiss and sets the delay before invoking OnDismiss. + /// Triggers once on first render. Requires <see cref="OnDismiss"/> to be set. + /// Non-positive values disable auto-dismiss.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
📒 Files selected for processing (4)
src/BlazorUI/Bit.BlazorUI/Components/Notifications/Message/BitMessage.razor.cs(2 hunks)src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Notifications/Message/BitMessageDemo.razor(1 hunks)src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Notifications/Message/BitMessageDemo.razor.cs(2 hunks)src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Notifications/Message/BitMessageDemo.razor.samples.cs(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build and test
🔇 Additional comments (2)
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Notifications/Message/BitMessageDemo.razor.cs (1)
484-485: State for demo behavior looks goodNew isAutoDismissed flag aligns with the demo changes.
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Notifications/Message/BitMessageDemo.razor.samples.cs (1)
122-123: Sample state addition LGTMFields mirror the demo and keep the snippet self-contained.
closes #11426
Summary by CodeRabbit