Persist DataTable column visibility using useLocalStorage#61280
Persist DataTable column visibility using useLocalStorage#61280sanchalitorpe13 wants to merge 1 commit into
Conversation
pierrejeambrun
left a comment
There was a problem hiding this comment.
Thanks for the PR.
Do you mind respecting the issue template, and not remove the 'did you use any AI tools' . That's part of our contributing policy and help reviewers review process.
<!--
If generative AI tooling has been used in the process of authoring this PR, please
change below checkbox to `[X]` followed by the name of the tool, uncomment the "Generated-by".
-->
- [ ] Yes (please specify the tool below)
Guidelines for using AI https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions
It's almost correct but needs adjustment to work.
Please make sure you test your changes before submitting the PR.
| * under the License. | ||
| */ | ||
|
|
||
| import { useLocalStorage } from 'src/utils/useLocalStorage'; |
There was a problem hiding this comment.
This doesn't exists. Import path is wrong.
There was a problem hiding this comment.
The correct one is
import { useLocalStorage } from "usehooks-ts";| initialState?.columnVisibility ?? {}, | ||
| ); | ||
| const [columnVisibility, setColumnVisibility] = useLocalStorage<VisibilityState>( | ||
| 'datatable:${modelName}:columnVisibility', |
There was a problem hiding this comment.
This can't work like this, you are not doing interpolation.
| 'datatable:${modelName}:columnVisibility', | |
| `dataTable:${modelName}:columnVisibility`, |
pierrejeambrun
left a comment
There was a problem hiding this comment.
Looks like this was AI generated and we have no response from the contributor. Closing in favor of #61858
This PR adds persistence for column visibility (show/hide) in all DataTable components in the Airflow UI. Users’ column preferences are now saved in browser localStorage, so when they revisit a table, their previous column selections are restored automatically.
Key points:
Testing
Related Issue
Closes: #61159