Skip to content

Auto-categorize#665

Open
sheepzh wants to merge 2 commits into
mainfrom
auto_cate
Open

Auto-categorize#665
sheepzh wants to merge 2 commits into
mainfrom
auto_cate

Conversation

@sheepzh

@sheepzh sheepzh commented Jan 13, 2026

Copy link
Copy Markdown
Owner

No description provided.

@sheepzh

sheepzh commented Jan 13, 2026

Copy link
Copy Markdown
Owner Author

#422

Copilot AI review requested due to automatic review settings May 17, 2026 08:51
@codecov

codecov Bot commented May 17, 2026

Copy link
Copy Markdown

⚠️ JUnit XML file not found

The CLI was unable to find any JUnit XML files to upload.
For more help, visit our troubleshooting guide.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 autoRules to 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, but open() treats onClose as 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

  • ElDialog passes a done callback to beforeClose, but this forwards it to props.onClose, which open() 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 calls done() 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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants