Skip to content

fix(profiler): render column type icons dynamically based on column type - #935

Closed
De-pitcher wants to merge 2 commits into
libredb:mainfrom
De-pitcher:fix/data-profiler-column-type-icons
Closed

De-pitcher wants to merge 2 commits into
libredb:mainfrom
De-pitcher:fix/data-profiler-column-type-icons

Conversation

@De-pitcher

Copy link
Copy Markdown

Description

Fixes an issue where the Data Profiler rendered a hardcoded \Hash\ icon for every column regardless of type.

  • Implemented \getColumnIcon(type)\ helper to dynamically map column data types to appropriate Lucide icons (\Hash\ for numeric, \Type\ for string/text, \Calendar\ for date/time, \ToggleLeft\ for boolean, \Braces\ for json/xml).
  • Added unit tests in \ ests/components/DataProfiler.test.tsx\ verifying multi-type column icon rendering.

    Closes Data Profiler shows the numeric icon on every column regardless of type #880

@cevheri cevheri added the duplicate This issue or pull request already exists label Sep 17, 2026
@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@cevheri

cevheri commented Sep 17, 2026

Copy link
Copy Markdown
Member

Thank you for this, and I am sorry to be closing it.

The issue was already assigned when you picked it up, and I had asked you to wait for #888, so that is where it is being finished. The decision is about the assignment and not about your work. Measured against the payload a SQL engine really returns, both branches leave the icon unchanged, so this was never one patch beating the other.

Two things of yours are better than what I am taking forward, and I am not losing them. Your type map covers money, bit, enum and json where the other does not. And you are right that typeof an embedded document, an array or a Date is all "object", so your json branch can never fire while the value it was meant for renders as a number. Both go into the fix, and I will credit you.

The red check was not your code, it is the chart guard firing because the branch is behind main.

The good first issue list still has unassigned items. Tell me which one you want and I will assign it before you start.

@De-pitcher

Copy link
Copy Markdown
Author

Hi @cevheri, thank you so much for the kind feedback and for crediting the type map improvements! I would love to take on #856 (Admin health gauges use hardcoded white track that vanishes in light theme). Could you please assign it to me?

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

Labels

duplicate This issue or pull request already exists

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Data Profiler shows the numeric icon on every column regardless of type

2 participants