korbit-ai[bot] commented on code in PR #34300:
URL: https://github.com/apache/superset/pull/34300#discussion_r2228356702
##########
superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx:
##########
@@ -629,7 +629,7 @@ export default function TableChart<D extends DataRecord =
DataRecord>(
const startPosition = value[0];
const colSpan = value.length;
// Retrieve the originalLabel from the first column in this group
- const originalLabel = columnsMeta[value[0]]?.originalLabel || key;
+ const originalLabel = filteredColumnsMeta[value[0]]?.originalLabel ||
key;
Review Comment:
### Incorrect Group Header Labels with Filtered Columns <sub></sub>
<details>
<summary>Tell me more</summary>
###### What is the issue?
Using filteredColumnsMeta to retrieve the originalLabel could lead to
incorrect labels when columns are filtered out due to time comparison settings.
###### Why this matters
When time comparison is enabled and certain columns are hidden,
filteredColumnsMeta won't contain all columns, causing the index value[0] to
potentially reference the wrong column or return undefined, leading to
incorrect grouping header labels.
###### Suggested change ∙ *Feature Preview*
Use the full columnsMeta array to ensure correct label retrieval regardless
of filtering:
```typescript
const originalLabel = columnsMeta[value[0]]?.originalLabel || key;
```
###### Provide feedback to improve future suggestions
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/2cfa9398-eeaa-4f00-ad07-07b071e9b417/upvote)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/2cfa9398-eeaa-4f00-ad07-07b071e9b417?what_not_true=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/2cfa9398-eeaa-4f00-ad07-07b071e9b417?what_out_of_scope=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/2cfa9398-eeaa-4f00-ad07-07b071e9b417?what_not_in_standard=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/2cfa9398-eeaa-4f00-ad07-07b071e9b417)
</details>
<sub>
💬 Looking for more details? Reply to this comment to chat with Korbit.
</sub>
<!--- korbi internal id:7d17ea87-851e-4147-8c52-2e6b367eba40 -->
[](7d17ea87-851e-4147-8c52-2e6b367eba40)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]