Skip to content

Fixes #28735 Context Center Dashboard new UI#28652

Open
Rohit0301 wants to merge 16 commits into
mainfrom
context-center-dashboard-new
Open

Fixes #28735 Context Center Dashboard new UI#28652
Rohit0301 wants to merge 16 commits into
mainfrom
context-center-dashboard-new

Conversation

@Rohit0301
Copy link
Copy Markdown
Contributor

@Rohit0301 Rohit0301 commented Jun 2, 2026

Describe your changes:

Screen.Recording.2026-06-03.at.10.27.45.PM.mov

Fixes 28735

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 Components:
    • Added ContextKnowledgePillarCard, AiActivitySection, and NeedsAttentionSection to the ContextCenterDashboardPage for a revamped UI.
  • Data Fetching Updates:
    • Integrated listFolders and getListContextMemories to power new dashboard stats.
    • Updated listContextFiles to support custom sorting/filtering and restricted data fetch limits using RECENT_DASHBOARD_ARTICLES_LIMIT and RECENT_DASHBOARD_DOCUMENTS_LIMIT.
  • Localization:
    • Updated 19 language JSON files with new labels for AI activity, pillar stats, and status messaging.

This will update automatically on new commits.

@Rohit0301 Rohit0301 self-assigned this Jun 2, 2026
@Rohit0301 Rohit0301 requested a review from a team as a code owner June 2, 2026 18:42
@Rohit0301 Rohit0301 added the safe to test Add this label to run secure Github workflows on PRs label Jun 2, 2026
@Rohit0301 Rohit0301 marked this pull request as draft June 2, 2026 18:42
Comment thread openmetadata-ui/src/main/resources/ui/src/rest/assetAPI.ts Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.33% (67216/106129) 44.27% (36972/83510) 46.66% (11125/23842)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

🟡 Playwright Results — all passed (15 flaky)

✅ 4257 passed · ❌ 0 failed · 🟡 15 flaky · ⏭️ 88 skipped

Shard Passed Failed Flaky Skipped
✅ Shard 1 299 0 0 4
🟡 Shard 2 801 0 2 9
🟡 Shard 3 804 0 4 8
🟡 Shard 4 842 0 5 12
🟡 Shard 5 720 0 1 47
🟡 Shard 6 791 0 3 8
🟡 15 flaky test(s) (passed on retry)
  • Features/Glossary/GlossaryBulkOperations.spec.ts › should prevent dragging parent to its own child (shard 2, 1 retry)
  • Features/Glossary/GlossaryWorkflow.spec.ts › should display correct status badge color and icon (shard 2, 1 retry)
  • Features/KnowledgeCenterList.spec.ts › Knowledge Center List - Test bookmark functionality (shard 3, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Features/Tasks/TaskNavigation.spec.ts › navigating to /table/TASK-XXXXX should show 404 (invalid URL pattern) (shard 3, 1 retry)
  • Flow/ExploreAggregationCountsMatching.spec.ts › should verify left panel counts and tab search results for normal search (shard 3, 1 retry)
  • Flow/PersonaFlow.spec.ts › Set default persona for team should work properly (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Entity Reference (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Hyperlink (shard 4, 2 retries)
  • Pages/CustomProperties.spec.ts › Set enum custom property on column and verify in UI (shard 4, 2 retries)
  • Pages/DataContractsSemanticRules.spec.ts › Validate Description Rule Is_Set (shard 4, 1 retry)
  • Pages/EntityDataConsumer.spec.ts › Tier Add, Update and Remove (shard 5, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage service type filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/ServiceEntity.spec.ts › Inactive Announcement create & delete (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@Rohit0301 Rohit0301 marked this pull request as ready for review June 3, 2026 18:30
Comment on lines +71 to +76
return {
data: response.data.data ?? [],
paging: response.data.paging ?? {
total: (response.data.data ?? []).length,
},
};
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Paging should always be there, can you confirm if response.data.data is correct?
Usually we have response.data & response.paging

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Copy Markdown
Contributor Author

@Rohit0301 Rohit0301 Jun 5, 2026

Choose a reason for hiding this comment

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

this is correct response.data.data

Comment thread openmetadata-ui/src/main/resources/ui/src/rest/assetAPI.ts
@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Jun 5, 2026

Code Review ✅ Approved 6 resolved / 6 findings

Implements the Context Center Dashboard UI revamp with updated components and data-fetching logic. Addressed findings related to data capping, type safety, and redundant mapping operations.

✅ 6 resolved
Bug: Article/document stats show capped count instead of total

📄 openmetadata-ui/src/main/resources/ui/src/pages/ContextCenterPage/ContextCenterDashboardPage/ContextCenterDashboardPage.tsx:327 📄 openmetadata-ui/src/main/resources/ui/src/pages/ContextCenterPage/ContextCenterDashboardPage/ContextCenterDashboardPage.tsx:344
The stat prop for both the articles and documents pillar cards uses articles.length and documents.length respectively. Since RECENT_DASHBOARD_ARTICLES_LIMIT and RECENT_DASHBOARD_DOCUMENTS_LIMIT are both 3, the displayed count will always be at most "3" regardless of how many articles/documents actually exist.

The API (getListKnowledgePages) returns response.paging.total which gives the true total count. The same applies to listContextFiles. You should store and display the total from the paging response rather than the length of the fetched slice.

Quality: Use typed interface instead of object for listContextFiles params

📄 openmetadata-ui/src/main/resources/ui/src/rest/assetAPI.ts:54
The params parameter in listContextFiles is typed as object, which provides no type safety and allows passing arbitrary properties. Since the API accepts specific sort parameters, a typed interface would be more appropriate and consistent with the codebase patterns (e.g., ListAssetsByFqnParams already exists in the same file).

Quality: Redundant .map((page) => page) is a no-op

📄 openmetadata-ui/src/main/resources/ui/src/pages/ContextCenterPage/ContextCenterDashboardPage/ContextCenterDashboardPage.tsx:149
The expression response.data.map((page: KnowledgePage) => page) creates a new array where each element maps to itself, which is functionally identical to just using the array directly (or spreading it if immutability is the concern).

Quality: Hardcoded strings "0 this week", "0 processing", "0 cites today"

📄 openmetadata-ui/src/main/resources/ui/src/pages/ContextCenterPage/ContextCenterDashboardPage/ContextCenterDashboardPage.tsx:332 📄 openmetadata-ui/src/main/resources/ui/src/pages/ContextCenterPage/ContextCenterDashboardPage/ContextCenterDashboardPage.tsx:349 📄 openmetadata-ui/src/main/resources/ui/src/pages/ContextCenterPage/ContextCenterDashboardPage/ContextCenterDashboardPage.tsx:365
The trend prop values passed to ContextKnowledgePillarCard are hardcoded English strings ("0 this week", "0 processing", "0 cites today") rather than using the useTranslation hook. This violates the i18n requirement and will not be translated for other locales.

Edge Case: Removed null guard on listContextFiles data can crash .map

📄 openmetadata-ui/src/main/resources/ui/src/rest/assetAPI.ts:54-61 📄 openmetadata-ui/src/main/resources/ui/src/pages/ContextCenterPage/ContextCenterDashboardPage/ContextCenterDashboardPage.tsx:166-167
The old listContextFiles returned data: response.data.data ?? [], defensively defaulting to an empty array when the API omitted data. The refactored version returns response.data (a PagingResponse<ContextFile[]>) directly without any guard. Although the type declares data as required, at runtime an empty/204 or malformed response could leave data undefined, and the caller's response.data.map(contextFileToUploadedDocumentItem) (and response.data.length) at ContextCenterDashboardPage.tsx:166-167 would throw Cannot read properties of undefined. Consider defaulting data to [] either in the API helper or at the call site.

...and 1 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

sonarqubecloud Bot commented Jun 5, 2026

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.

Re-design context center dashboard page

2 participants