Skip to content

[BUGFIX] table: show cell settings text in column filter values - #868

Open
Yash121l wants to merge 1 commit into
perses:mainfrom
Yash121l:fix/table-filter-cell-text
Open

Yash121l wants to merge 1 commit into
perses:mainfrom
Yash121l:fix/table-filter-cell-text

Conversation

@Yash121l

Copy link
Copy Markdown
Contributor

Description

Fixes perses/perses#4551

When a Table column has a cell settings rule that maps a value to text (for example 1 to "true"), the cells show the text but the column filter dropdown still listed the raw values (0, 1).

The filter values in TablePanel only went through the column's number format. I moved the existing "global cell settings, then column cell settings override" lookup out of resolveGaugeFillColor into resolveCellConfig and use it for the filter labels too, so the dropdown shows the same text as the cells. Filtering still matches on the raw value, so selecting "true" keeps the rows whose value is 1. If two raw values map to the same text, each stays its own entry in the list.

A new test in TablePanel.test.tsx uses a global rule and a column rule. It checks that the dropdown shows the mapped text, that the column rule wins, and that selecting an entry filters to the right rows. It fails on main. Table tests, lint, type-check and format check pass.

Screenshots

No screenshot yet: I verified it through the component test rather than a running Perses instance. I can add one if you'd like.

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Pull request title follows the [<catalog_entry>] <commit message> naming convention using one of the
    following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
  • All commits have DCO signoffs.

UI Changes

  • Changes that impact the UI include screenshots and/or screencasts of the relevant changes.
  • Code follows the UI guidelines.

@Yash121l
Yash121l requested a review from a team as a code owner October 11, 2026 15:35
@Yash121l
Yash121l requested review from shahrokni and removed request for a team October 11, 2026 15:35
Signed-off-by: Yash Lunawat <yash.lunawat@rtp.vc>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is localized and covers the reported bug; the remaining feedback is an optional test for duplicate labels.

1 open finding
What changed in this PR

This PR updates the table filter dropdown to show the same cell-settings text as table cells while continuing to filter by raw value.

Changes:

  • Reuses cell-settings resolution for filter labels.
  • Adds a regression test for mapped labels, rule precedence, and raw-value filtering.
File Description
table/​src/​components/​TablePanel.tsx Applies cell-settings text to filter labels.
table/​src/​components/​TablePanel.test.tsx Tests mapped labels and filtering behavior.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

expect(screen.getByRole('cell', { name: 'true' })).toBeInTheDocument();
},
TEST_TIMEOUT,
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Table: Filtering a column doesn't use the column conditional formatting

2 participants