Files
grafana-zabbix/src
Copilot 984f065296 Fix column visibility toggles not working in problem panel (#2228)
## Fix column visibility in problem panel

- [x] Understand the issue: Column IDs in
`initialState.columnVisibility` don't match actual column accessor IDs
- [x] Fix the column ID mapping in Problems.tsx
- [x] Add tests to verify column visibility works correctly
- [x] Fix reactivity issue: Moved columnVisibility from initialState to
state with useMemo
- [x] Add datasource column definition and visibility mapping
- [x] Optimize datasource cell rendering
- [x] Suppress React Compiler warning for useReactTable
- [x] All tests passing (9/9)
- [x] Build successful
- [x] Lint warnings reduced from 65 to 64

## Summary

Fixed three issues with column visibility in the problem panel:

1. **Incorrect column ID mappings**: Fixed three column IDs to match
actual column accessor IDs.
2. **Non-reactive column visibility**: Moved `columnVisibility` from
`initialState` to `state` with `useMemo`.
3. **Missing datasource column**: Added datasource column definition and
visibility mapping.
4. **Lint warning**: Suppressed React Compiler warning for
`useReactTable` hook (known TanStack Table issue).

All column visibility controls now correctly show/hide their respective
columns without requiring a page refresh.

<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>Change column in problem panel not working on
6.1.1</issue_title>
> <issue_description>**Describe the bug**
> Since the upgrade from plugin 6.0.3 to 6.1.1, i notice that status
column appears (it was not the case before the upgrade) on existing
problem panels.
> I tried to disable it, and the button was on disable state. The
configuration is great, but not the display. Then i tried to disable or
enable all the colums and it doesn't work too.
> I tried on a new dashboard with a new problem panel and it is the same
issue.
> Font size doesn't work too. All other options seems to work.
> Grafana server has been restarted.
> 
> **Expected behavior**
> Enable or disable the column should change the display of the problem
panel.
> 
> **Screenshots**
> <img width="1916" height="833" alt="Image"
src="https://github.com/user-attachments/assets/1e725aff-fd2d-41cd-bd2b-855ac8c611d0"
/>
> 
> **Network data**
> If it's related to metric data visualization would be great to get the
raw query and response for the network request (check this in browser
dev tools network tab, there you can see metric requests, please include
the request body and request response)
> 
> **Software versions**
> 
> | Grafana | Zabbix | Grafana-Zabbix Plugin |
> | ------- | ------ | --------------------- |
> | 12.3.0   | 7.2.15  | 6.1.1                 |
> </issue_description>
> 
> <agent_instructions>Looks like the regression was introduced via
https://github.com/grafana/grafana-zabbix/pull/2131/changes#diff-85e7fa6e5295bf97f8bf82eabcb5807d695248b9fcd325acd58a8af02824cb70L207</agent_instructions>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> <comment_new><author>@yesoreyeram</author><body>
> I can reproduce this issue. Adding to the backlog for further
investigation.</body></comment_new>
> </comments>
> 


</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes grafana/grafana-zabbix#2213

<!-- START COPILOT CODING AGENT TIPS -->
---

 Let Copilot coding agent [set things up for
you](https://github.com/grafana/grafana-zabbix/issues/new?title=+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: yesoreyeram <153843+yesoreyeram@users.noreply.github.com>
Co-authored-by: Jocelyn Collado-Kuri <jcolladokuri@icloud.com>
Co-authored-by: jcolladokuri <20448042+jcolladokuri@users.noreply.github.com>
2026-01-26 15:58:40 +00:00
..
2020-05-21 11:55:18 +03:00
2025-12-10 19:25:04 +01:00