Skip to content

ui: provide edit support for display name in column side panel#25436

Merged
shrabantipaul-collate merged 9 commits intomainfrom
column-edit-displayname
Jan 28, 2026
Merged

ui: provide edit support for display name in column side panel#25436
shrabantipaul-collate merged 9 commits intomainfrom
column-edit-displayname

Conversation

@harsh-vador
Copy link
Copy Markdown
Contributor

@harsh-vador harsh-vador commented Jan 21, 2026

Describe your changes:

Provide support for edit of display name through column side panel.
Provide support for edit of display name for assets from explore page.
For explore page edit:
-Added edit icon beside asset name.
-On click of edit icon, a popup will open, showing the name, display name, save and cancel buttons.
-On updating the display name, a PATCH request will be called to update the value.

https://www.loom.com/share/a0de8cc64e3944318b20d13a1c8e7d49
https://www.loom.com/share/869ae0e394c241c194ed0f529b2e01af
Screenshot 2026-01-28 at 12 15 33 PM
Screenshot 2026-01-28 at 12 50 24 PM

Screen.Recording.2026-01-21.at.2.26.15.PM.mov
Screen.Recording.2026-01-21.at.2.27.06.PM.mov

Type of change:

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

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • 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.

Summary by Gitar

  • DisplayName edit feature:
    • Edit buttons with modal in ColumnDetailPanel, EntityTitleSection, and EntitySummaryPanel components
    • Restricted to Tables and Dashboard Data Models with EditDisplayName permission
  • New utility function:
    • updateFieldDisplayName in TableUtils.tsx recursively updates display names in column hierarchies
  • Bug fix:
    • Removed grey color styling from column names in SchemaTable when display name is set
  • Test coverage:
    • Added 590+ lines of unit tests across EntitySummaryPanel.test.tsx and EntityTitleSection.test.tsx
    • Added E2E Playwright tests in EntitySummaryPanel.spec.ts for display name editing on explore page

This will update automatically on new commits.


@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!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 24, 2026

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 65%
65.81% (55672/84598) 44.89% (28775/64095) 47.69% (8747/18341)

Comment thread openmetadata-ui/src/main/resources/ui/src/utils/ColumnUpdateUtils.ts Outdated
Comment thread openmetadata-ui/src/main/resources/ui/src/utils/ColumnUpdateUtils.ts Outdated
@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Jan 28, 2026

Code Review 👍 Approved with suggestions 1 resolved / 2 findings

Good feature implementation with comprehensive tests. The previously identified type safety issue with (activeColumn as any).displayName remains unaddressed - consider defining a proper type interface that includes the displayName property.

⚠️ Quality: Repeated use of `(activeColumn as any).displayName` bypasses type safety

📄 openmetadata-ui/src/main/resources/ui/src/components/Database/ColumnDetailPanel/ColumnDetailPanel.component.tsx:731 📄 openmetadata-ui/src/main/resources/ui/src/components/Database/ColumnDetailPanel/ColumnDetailPanel.component.tsx:758 📄 openmetadata-ui/src/main/resources/ui/src/components/Database/ColumnDetailPanel/ColumnDetailPanel.component.tsx:759 📄 openmetadata-ui/src/main/resources/ui/src/components/Database/ColumnDetailPanel/ColumnDetailPanel.component.tsx:924 📄 openmetadata-ui/src/main/resources/ui/src/components/Database/ColumnDetailPanel/ColumnDetailPanel.component.tsx:925

The code uses (activeColumn as any).displayName 5+ times to access the displayName property. This bypasses TypeScript's type checking and is error-prone.

Impact: Type safety is lost, making the code harder to maintain and more susceptible to runtime errors if the property name changes.

Suggested fix: Consider one of these approaches:

  1. Extend the ColumnOrTask type to include displayName if it's a valid property
  2. Use a type guard to narrow the type properly
  3. At minimum, create a helper function or computed variable at the top of the render logic:
const displayName = isColumn(activeColumn) ? activeColumn.displayName : undefined;

This ensures the type assertion is done once and the property is accessed safely throughout.

✅ 1 resolved
Edge Case: `updateFieldDisplayName` cannot clear displayName to empty string

📄 openmetadata-ui/src/main/resources/ui/src/utils/TableUtils.tsx:230
The updateFieldDisplayName function accepts displayName: string as a parameter. While this will correctly set a display name, users might want to "clear" the display name to revert to using just the column name.

Looking at the caller in ColumnUpdateUtils.ts, it checks if (update.displayName !== undefined) which allows empty strings to pass through. However, an empty string "" might not behave as expected in all scenarios (e.g., UI might show empty instead of falling back to name).

Impact: Minor - Users may not be able to properly clear a display name. The API behavior determines the actual impact.

Suggestion: Verify that:

  1. The backend API correctly handles empty string vs undefined for clearing display name
  2. The UI's fallback logic (activeColumn as any).displayName || activeColumn.name handles empty strings correctly (it does, since "" || name will use name)
Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud
Copy link
Copy Markdown

@shrabantipaul-collate shrabantipaul-collate merged commit 15542b9 into main Jan 28, 2026
26 checks passed
@shrabantipaul-collate shrabantipaul-collate deleted the column-edit-displayname branch January 28, 2026 10:29
shrabantipaul-collate pushed a commit that referenced this pull request Jan 28, 2026
* ui: provide edit support for display name in column side panel

* Edit displayname on explore page

* bug:changing display name changes color of name to grey

* Add playwright tests for display name edit on explore page

* Address review comments

* Address review comments-useTheme instead of direct values in styles

---------

Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com>
Co-authored-by: Shrabanti Paul <shrabantipaul@Shrabantis-MacBook-Pro.local>
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.

3 participants