enhance(kb): streamline knowledge base management - #5540
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (4)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
|
✅ OpenCodeReview: Review skipped: no items were selected. |
| const selector = | ||
| mode === 'chooser' | ||
| ? '[data-cy="choose-kb-resource-website"]' | ||
| : mode === 'website' | ||
| ? '[data-cy="kb-url-title"]' | ||
| : '[data-cy="kb-file-dropzone"]' |
There was a problem hiding this comment.
Nested ternary is used to compute the focus selector, which conflicts with the codebase rule forbidding nested ternaries and hurts readability. Refactor to a lookup map or a helper, e.g. const FOCUS_SELECTORS: Record<AddResourceMode, string> = { chooser: '[data-cy="choose-kb-resource-website"]', website: '[data-cy="kb-url-title"]', document: '[data-cy="kb-file-dropzone"]' } and use FOCUS_SELECTORS[mode].
| title={ | ||
| isChooser | ||
| ? t('kb.addResourceTitle') | ||
| : mode === 'website' | ||
| ? t('kb.addWebsite') | ||
| : t('kb.addDocument') | ||
| } |
There was a problem hiding this comment.
The title prop uses a nested ternary (ternary inside a ternary), which is against the project rule prohibiting nested ternaries and hurts readability, especially as more resource modes are added. Extract a helper or map, e.g. const MODE_TITLES: Record<AddResourceMode, string> = { chooser: t('kb.addResourceTitle'), website: t('kb.addWebsite'), document: t('kb.addDocument') } and use title={MODE_TITLES[mode]}.
|



Summary
Add resourcemodal, preserving the existing website and document flows while showing Video as coming soon.Stack and scope
This is the second PR in the Knowledge Base stack:
feat/kb-graph-lifecycle->v3-airs/kb-management-ux->feat/kb-graph-lifecyclePublished #5540 head:
d9747b3e5aa3f284e58df8d5b827054f31697860.Published parent head:
1d57f4f11a65698b72916de7c6f14c66422f9293.Review this layer for desktop Knowledge Base management UX. Mobile Manage layout is explicitly outside this package and remains a separate shared-shell follow-up.
Verification
@klicker-uzh/kb-managementand@klicker-uzh/playwright.E2E_SKIP_INSTALL=1 bash util/run-host-e2e.sh --project=chromium tests/Y-kb-management-ux.spec.tspassed 1/1.https://manage.klicker.rs-kb-management-ux.localhost.Security and data handling
Review focus