Conversation
Owner
Author
f054494 to
dd76b76
Compare
28665aa to
10e92da
Compare
|
There was a problem hiding this comment.
Pull request overview
This PR adds support for category auto-categorization metadata across the timer category model, background storage/message APIs, and category selection UI.
Changes:
- Adds
autoRulesto category types, persistence, initialization, and i18n labels. - Updates category add/change messaging to pass full category payloads.
- Reworks the category selector UI and introduces a category dialog for editing names/rules.
Reviewed changes
Copilot reviewed 14 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
types/timer/site.d.ts |
Adds autoRules to category type. |
types/timer/message.d.ts |
Updates category add message payload type. |
src/pages/hooks/useMounted.ts |
Adds a shared mounted lifecycle helper. |
src/pages/hooks/index.ts |
Exports the new hook. |
src/pages/app/components/Report/Table/index.tsx |
Updates report category change handling locally. |
src/pages/app/components/common/filter/CategoryFilter.tsx |
Formatting-only export adjustment. |
src/pages/app/components/common/Category/Select/SelectFooter.tsx |
Sends new category payload shape. |
src/pages/app/components/common/Category/Select/OptionItem.tsx |
Simplifies option item rendering and delegates edit/delete actions. |
src/pages/app/components/common/Category/Select/index.tsx |
Replaces ElSelect with custom category dropdown behavior. |
src/pages/app/components/common/Category/Editable.tsx |
Adjusts category edit activation behavior. |
src/pages/app/components/common/Category/CategoryDialog.tsx |
Adds dialog UI for editing category name and auto-rules. |
src/pages/app/components/Analysis/components/AnalysisFilter/TargetSelect.tsx |
Updates synthetic “not set” category shape. |
src/i18n/message/app/site-manage.ts |
Adds typed i18n key for auto-rules. |
src/i18n/message/app/site-manage-resource.json |
Adds English auto-rules label. |
src/background/message-dispatcher.ts |
Routes category add/change payloads to database methods. |
src/background/install-handler/version/cate-initializer.ts |
Initializes demo categories with empty auto-rules. |
src/background/database/cate-database.ts |
Persists and returns category auto-rules. |
Comments suppressed due to low confidence (2)
src/pages/app/components/common/Category/CategoryDialog.tsx:38
- The cancel button is wired to
onClose, butopen()treatsonCloseas a successful resolution path. Clicking Cancel therefore resolves the promise with no category instead of rejecting/cancelling, causing the caller to proceed as if an edit was saved; wire Cancel (and dialog close) to a rejection/cancel callback and reserve the success callback for confirmed data.
<ElButton onClick={props.onClose}>{t(msg => msg.button.cancel)}</ElButton>
src/pages/app/components/common/Category/CategoryDialog.tsx:34
ElDialogpasses adonecallback tobeforeClose, but this forwards it toprops.onClose, whichopen()interprets as saved category data. Closing via the dialog X will resolve with a function and then attempt to update the category with invalid data; use a dedicated cancel handler that callsdone()and rejects the promise instead.
beforeClose={props.onClose}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+16
to
+18
| const handleConfirm = () => { | ||
|
|
||
| } |
Comment on lines
+6
to
+9
| onMounted(() => { | ||
| const cleanup = callback() | ||
| if (typeof cleanup === 'function') onUnmounted(() => cleanup()) | ||
| }) |
Comment on lines
+148
to
+152
| <div class={[ns.b(), props.size && ns.m(props.size)]} style={{ width: props.width || '100%' }}> | ||
| <ElTooltip | ||
| ref={tooltipRef} | ||
| visible={visible.value} | ||
| placement="bottom-start" |
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.
No description provided.