fix(ui): fix windows tray reset order - #462
Open
Jack251970 wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The change is narrowly scoped, updates all identified call sites, and includes regression tests covering the swapped-field scenario.
Pull request overview
This PR fixes the Windows tray “reset” label ordering by making the tray summary explicitly track 5-hour vs 7-day reset windows (instead of “primary/secondary”), and by classifying reset windows based on their duration to tolerate swapped fields. It also adds targeted Rust unit tests to prevent regressions.
Changes:
- Update the service-side tray summary to classify reset windows by
window_minutesand expose them asfive_hour_*/seven_day_*. - Update the Tauri tray menu label wiring to use the new explicit summary fields so 5-hour and 7-day labels are no longer swapped.
- Add unit tests covering the swapped-field scenario and correct classification.
File summaries
| File | Description |
|---|---|
| crates/service/src/usage/usage_tray_summary.rs | Classifies usage reset windows by duration and exposes explicit 5-hour/7-day fields; adds regression tests. |
| apps/src-tauri/src/app_shell/tray.rs | Uses the explicit 5-hour/7-day summary fields to render correct tray reset labels; updates related test. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更摘要
改动范围
主要文件
验证
pnpm -C apps run testpnpm -C apps run buildpnpm -C apps run test:uicargo test --workspace已执行的实际验证:
未执行的验证与原因:
风险与影响面
备注