Skip to content

Context center UI#28056

Open
Rohit0301 wants to merge 18 commits into
mainfrom
context-center-ui
Open

Context center UI#28056
Rohit0301 wants to merge 18 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 ...

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

  • UI Component Enhancements:
    • Updated ArticleDetailHeader to use Badge for contentChangeState and added EditorIcon to the editors list.
    • Improved ManageButton dropdown behavior by ensuring isDropdownOpen is set to false on various actions.
  • Dashboard & Utils Updates:
    • Increased RECENT_ARTICLES_LIMIT to 25 and corrected the URL generation logic in ContextCenterUtils.
    • Cleaned up ArticleCard styling by removing unused gap properties.
  • E2E Testing:
    • Added document upload logic to ContextCenter playwright tests and updated navigation checks to include CONTEXT_CENTER.

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
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

❌ UI Checkstyle Failed

❌ ESLint + Prettier + Organise Imports (src)

One or more source files have linting or formatting issues.

❌ I18n Sync

Translation locale files are out of sync with en-us.json.

Affected files
  • openmetadata-ui/src/main/resources/ui/src/locale/languages/ar-sa.json
    • openmetadata-ui/src/main/resources/ui/src/locale/languages/de-de.json
    • openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json
    • openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json
    • openmetadata-ui/src/main/resources/ui/src/locale/languages/gl-es.json
    • openmetadata-ui/src/main/resources/ui/src/locale/languages/he-he.json
    • openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json
    • openmetadata-ui/src/main/resources/ui/src/locale/languages/ko-kr.json
    • openmetadata-ui/src/main/resources/ui/src/locale/languages/mr-in.json
    • openmetadata-ui/src/main/resources/ui/src/locale/languages/nl-nl.json
    • openmetadata-ui/src/main/resources/ui/src/locale/languages/pr-pr.json
    • openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json
    • openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-pt.json
    • openmetadata-ui/src/main/resources/ui/src/locale/languages/ru-ru.json
    • openmetadata-ui/src/main/resources/ui/src/locale/languages/th-th.json
    • openmetadata-ui/src/main/resources/ui/src/locale/languages/tr-tr.json
    • openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json
    • openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-tw.json

❌ Playwright — ESLint + Prettier + Organise Imports

One or more Playwright test files have linting or formatting issues.

Affected files
  • openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/KnowledgeCenterRoleBasedAccess.spec.ts

❌ Core Components — ESLint + Prettier

One or more core-component files have linting or formatting issues.

Affected files
  • openmetadata-ui-core-components/src/main/resources/ui/src/components/application/file-upload/file-upload.tsx

Fix locally (fast — only checks files changed in this branch):

make ui-checkstyle-changed

Comment thread openmetadata-ui/src/main/resources/ui/src/utils/ContextCenterUtils.tsx Outdated
const ARTICLE_DESCRIPTION =
'Playwright article description for card detail check';
let QUICK_LINK_TITLE: string;
const QUICK_LINK_URL = 'https://docs.open-metadata.org';
@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented May 13, 2026

Code Review ✅ Approved 7 resolved / 7 findings

Implements the Context Center UI feature with component enhancements, updated dashboard utilities, and comprehensive Playwright E2E coverage. Addressed all previous findings, including file upload issues, utility duplication, and UI consistency.

✅ 7 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 2 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

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.

2 participants