Skip to content

Context center UI#28056

Merged
Rohit0301 merged 59 commits into
mainfrom
context-center-ui
May 16, 2026
Merged

Context center UI#28056
Rohit0301 merged 59 commits into
mainfrom
context-center-ui

Conversation

@Rohit0301
Copy link
Copy Markdown
Contributor

@Rohit0301 Rohit0301 commented May 12, 2026

Describe your changes:

Fixes #

I worked on ... because ...

Screen.Recording.2026-05-14.at.3.56.21.PM.mov
Screenshot 2026-05-14 at 3 54 26 PM Screenshot 2026-05-14 at 3 55 17 PM Screenshot 2026-05-14 at 3 55 28 PM Screenshot 2026-05-14 at 3 55 36 PM Screenshot 2026-05-14 at 3 55 58 PM Screenshot 2026-05-14 at 3 56 12 PM

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

High-level design:

N/A — small change.

Tests:

Use cases covered

Unit tests

Backend integration tests

Ingestion integration tests

Playwright (UI) tests

Manual testing performed

UI screen recording / screenshots:

Not applicable.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.
  • For UI changes: I attached a screen recording and/or screenshots above.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

Summary by Gitar

  • Context Center UI:
    • Added ContextCenterRouter to handle internal routing and navigation.
    • Implemented ArticleDetailHeader for metadata display and entity interactions (voting, following).
    • Integrated UploadDocumentModal for document management with file progress tracking.
    • Added feedCount tracking to KnowledgePageDetailComponent and passed it through to ContextCenterArticlesPage.
    • Improved upload reliability in UploadDocumentModal by adding cancellation handling and unique ID generation for files.
  • UI/UX Enhancements:
    • Refactored KnowledgePageListComponent to support modular right-panel slots and improved permission handling.
    • Added ContextCenterArticlesPage as a central landing view with creation workflows.
    • Updated 19 internationalization locale files to include the base-knowledge translation key.
  • Infrastructure & Testing:
    • Created utility modules ContextCenterUtils and assetAPI for handling document assets and article logic.
    • Added comprehensive E2E test ContextCenter.spec.ts covering permissions, dashboard, and document workflows.
    • Updated ContextCenterUtils with robust blob handling for asset downloads.
  • Core Components:
    • Expanded FileUpload component with FileListItemProgressBar and FileListItemProgressFill for enhanced upload feedback.

This will update automatically on new commits.

@Rohit0301 Rohit0301 self-assigned this May 12, 2026
@Rohit0301 Rohit0301 requested review from a team, chirag-madlani and karanh37 as code owners May 12, 2026 06:42
@github-actions
Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@Rohit0301 Rohit0301 added the safe to test Add this label to run secure Github workflows on PRs label May 12, 2026
@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented May 16, 2026

Code Review ✅ Approved 21 resolved / 21 findings

Introduces the Context Center UI feature, including routing, article management, and file upload workflows. All identified issues regarding asset handling, internationalization, test coverage, and component consistency have been resolved.

✅ 21 resolved
Bug: Upload modal accumulates stale assets across multiple attach cycles

📄 openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/UploadDocumentModal/UploadDocumentModal.component.tsx:150-153 📄 openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/UploadDocumentModal/UploadDocumentModal.component.tsx:172-185
In UploadDocumentModal, uploadedAssetsRef accumulates assets across multiple "Attach" button clicks within the same modal session. On each handleAttach call, it appends new assets to uploadedAssetsRef.current, then calls onUploaded?.(uploadedAssetsRef.current) passing ALL previously uploaded assets (not just the new batch). This means the parent gets duplicate notifications about previously uploaded assets.

Additionally, the handleRetry function calls onUploaded?.([asset]) for individual retries, but handleAttach also delivers these same assets again via the accumulated ref, resulting in duplicate callbacks.

Quality: Duplicate getReadableSize utility already exported from core components

📄 openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/UploadDocumentModal/UploadDocumentModal.component.tsx:45-53
UploadDocumentModal defines its own getReadableSize helper (lines 45-53) that duplicates getReadableFileSize already exported from @openmetadata/ui-core-components (file-upload.tsx). This violates DRY and could drift out of sync.

Quality: ContextCenterArticlesPage uses AntD Button/Dropdown - should use core

📄 openmetadata-ui/src/main/resources/ui/src/pages/ContextCenterPage/ContextCenterArticlesPage/ContextCenterArticlesPage.tsx:14-16
The custom review instructions state: "Use openmetadata-ui-core-components. NEVER introduce new MUI/AntD dependencies unless specified by current migration." However, ContextCenterArticlesPage imports Button and Dropdown from antd and DownOutlined from @ant-design/icons (lines 14-16). Since this is new code, it should use the equivalent components from @openmetadata/ui-core-components.

Edge Case: getReadableSize crashes on very large files (index out of bounds)

📄 openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/UploadDocumentModal/UploadDocumentModal.component.tsx:50-53
The local getReadableSize function has only 4 suffixes ['B', 'KB', 'MB', 'GB']. If a file is >= 1 TB (unlikely but possible), Math.floor(Math.log(bytes) / Math.log(1024)) returns 4+, and suffixes[i] would be undefined, producing output like "1024 undefined". The core library version has more suffixes, which is another reason to use it.

Bug: Hardcoded strings in file-upload component instead of i18n

📄 openmetadata-ui-core-components/src/main/resources/ui/src/components/application/file-upload/file-upload.tsx:302-316 📄 openmetadata-ui-core-components/src/main/resources/ui/src/components/application/file-upload/file-upload.tsx:349-353 📄 openmetadata-ui-core-components/src/main/resources/ui/src/components/application/file-upload/file-upload.tsx:427-433 📄 openmetadata-ui-core-components/src/main/resources/ui/src/components/application/file-upload/file-upload.tsx:439-442
The FileListItemProgressBar and FileListItemProgressFill components use hardcoded English strings like "Complete", "Uploading...", "Failed", "Try again", and "Delete" instead of using the translation system (useTranslation). This breaks i18n for any locale that isn't English and violates the project rule that all labels must use useTranslation.

...and 16 more resolved from earlier reviews

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants