feat: expand onboarding to notification & AI tracks, add integration catalog entry#2163
feat: expand onboarding to notification & AI tracks, add integration catalog entry#2163710leo wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughThis PR adds an AI onboarding track with notification/LLM detection probes and a popover progress bar, introduces a landing page integration catalog with a "browse all" link, and adds an empty-state guide component to the notification rules list page, along with corresponding locale strings and stylesheet updates across five languages. ChangesOnboarding AI Track and Progress UI
Landing Integration Catalog Browse Link
Notification Rules Empty-State Guide
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Popover as OnboardingPopoverContent
participant Hook as useOnboardingProgress
participant NotifAPI as NotificationRulesAPI
participant LLMAPI as LLMConfigAPI
Popover->>Hook: request onboarding progress
Hook->>NotifAPI: probe notification rules
Hook->>LLMAPI: probe LLM configs
NotifAPI-->>Hook: notification done flag
LLMAPI-->>Hook: llm done flag
Hook-->>Popover: doneMap (incl. notification, llm)
Popover->>Popover: compute pct = doneCount/total
Popover-->>Popover: render progress bar width
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/pages/landing/locale/zh_CN.ts`:
- Line 9: The zh_CN translation for aiTrack is inconsistent with the other
locales and with aiAssistant in the same file. Update the aiTrack label in the
zh_CN locale object to match the “AI assistant” meaning used by the other
translations, using a consistent term such as “AI 助手” or “智能助手” so the Landing
locale strings stay aligned across the locale map.
In `@src/pages/notificationRules/pages/List.tsx`:
- Around line 133-153: Replace the non-navigable <a> element in List.tsx’s
EmptyGuide actions with the existing react-router-dom <Link> pattern used
elsewhere in this component, so the “Configure a channel first” action is
keyboard-accessible and consistent; update the click/navigation target to use
Link to /notification-channels while keeping the surrounding EmptyGuide and
Button behavior unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a247324e-0e15-451f-b04c-6c3735dc7cda
📒 Files selected for processing (18)
src/components/OnboardingProgress/PopoverContent.tsxsrc/components/OnboardingProgress/style.lesssrc/components/OnboardingProgress/tracks.tssrc/components/OnboardingProgress/useOnboardingProgress.tssrc/pages/landing/index.tsxsrc/pages/landing/landing.data.tssrc/pages/landing/locale/en_US.tssrc/pages/landing/locale/ja_JP.tssrc/pages/landing/locale/ru_RU.tssrc/pages/landing/locale/zh_CN.tssrc/pages/landing/locale/zh_HK.tssrc/pages/landing/style.lesssrc/pages/notificationRules/locale/en_US.tssrc/pages/notificationRules/locale/ja_JP.tssrc/pages/notificationRules/locale/ru_RU.tssrc/pages/notificationRules/locale/zh_CN.tssrc/pages/notificationRules/locale/zh_HK.tssrc/pages/notificationRules/pages/List.tsx
| progress: '已完成 {{done}}/{{total}}', | ||
| hostTrack: '主机监控线', | ||
| dataTrack: '数据接入线', | ||
| aiTrack: '智能化', |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
aiTrack translation inconsistent with other locales and zh_CN AI naming.
aiTrack: '智能化' translates to "intelligentization," while en_US/ja_JP/ru_RU all use "AI assistant" variants. The PR screenshot also shows "AI assistant" as the section title. Additionally, the zh_CN aiAssistant section (line 121) uses "AI 智能助手", making "智能化" inconsistent within the same file. Consider using "AI 助手" or "智能助手" for consistency.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/pages/landing/locale/zh_CN.ts` at line 9, The zh_CN translation for
aiTrack is inconsistent with the other locales and with aiAssistant in the same
file. Update the aiTrack label in the zh_CN locale object to match the “AI
assistant” meaning used by the other translations, using a consistent term such
as “AI 助手” or “智能助手” so the Landing locale strings stay aligned across the
locale map.
| // 仅在「确实一条规则都没有」时展示引导;搜索命中为空时回退到默认空态,避免误导 | ||
| locale={ | ||
| data.length === 0 | ||
| ? { | ||
| emptyText: ( | ||
| <EmptyGuide | ||
| title={t('empty_guide.title')} | ||
| description={t('empty_guide.desc')} | ||
| actions={ | ||
| <> | ||
| <Button type='primary' onClick={() => history.push(`/${NS}/add`)}> | ||
| {t('common:btn.add')} | ||
| </Button> | ||
| <a onClick={() => history.push('/notification-channels')}>{t('empty_guide.config_channel')}</a> | ||
| </> | ||
| } | ||
| /> | ||
| ), | ||
| } | ||
| : undefined | ||
| } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Use <Link> instead of <a> for the "Configure a channel first" action.
The <a> tag on line 146 has no href, making it non-focusable and inaccessible via keyboard. It's also inconsistent with line 123 which uses <Link> from react-router-dom. Using <Link> provides proper navigation, keyboard support, and consistency.
♿ Proposed fix for accessibility and consistency
actions={
<>
<Button type='primary' onClick={() => history.push(`/${NS}/add`)}>
{t('common:btn.add')}
</Button>
- <a onClick={() => history.push('/notification-channels')}>{t('empty_guide.config_channel')}</a>
+ <Link to='/notification-channels'>{t('empty_guide.config_channel')}</Link>
</>
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // 仅在「确实一条规则都没有」时展示引导;搜索命中为空时回退到默认空态,避免误导 | |
| locale={ | |
| data.length === 0 | |
| ? { | |
| emptyText: ( | |
| <EmptyGuide | |
| title={t('empty_guide.title')} | |
| description={t('empty_guide.desc')} | |
| actions={ | |
| <> | |
| <Button type='primary' onClick={() => history.push(`/${NS}/add`)}> | |
| {t('common:btn.add')} | |
| </Button> | |
| <a onClick={() => history.push('/notification-channels')}>{t('empty_guide.config_channel')}</a> | |
| </> | |
| } | |
| /> | |
| ), | |
| } | |
| : undefined | |
| } | |
| // 仅在「确实一条规则都没有」时展示引导;搜索命中为空时回退到默认空态,避免误导 | |
| locale={ | |
| data.length === 0 | |
| ? { | |
| emptyText: ( | |
| <EmptyGuide | |
| title={t('empty_guide.title')} | |
| description={t('empty_guide.desc')} | |
| actions={ | |
| <> | |
| <Button type='primary' onClick={() => history.push(`/${NS}/add`)}> | |
| {t('common:btn.add')} | |
| </Button> | |
| <Link to='/notification-channels'>{t('empty_guide.config_channel')}</Link> | |
| </> | |
| } | |
| /> | |
| ), | |
| } | |
| : undefined | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/pages/notificationRules/pages/List.tsx` around lines 133 - 153, Replace
the non-navigable <a> element in List.tsx’s EmptyGuide actions with the existing
react-router-dom <Link> pattern used elsewhere in this component, so the
“Configure a channel first” action is keyboard-accessible and consistent; update
the click/navigation target to use Link to /notification-channels while keeping
the surrounding EmptyGuide and Button behavior unchanged.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation