Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: switch to managing hiddenColumnKeys in TableColumnsSettingModal #2888

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

agatha197
Copy link
Contributor

@agatha197 agatha197 commented Nov 27, 2024

resolves #2809

Changes:
Refactored table column visibility management across multiple list components to use centralized user settings storage instead of individual localStorage entries. This change:

  • Replaces useLocalStorageState with useBAISettingUserState for storing hidden column preferences
  • Updates column visibility logic to use a hidden columns approach rather than displayed columns
  • Standardizes column setting modal behavior across components using useToggle
  • Implements consistent column visibility state management pattern across:
    • AgentList
    • AgentSummaryList
    • ContainerRegistryList
    • CustomizedImageList
    • ErrorLogList
    • ImageList
    • KeypairResourcePolicyList
    • ProjectResourcePolicyList
    • UserResourcePolicyList
    • EndpointListPage

Rationale:
This change provides a more maintainable and consistent approach to managing table column visibility preferences across the application, while ensuring user preferences persist across sessions through centralized storage.

Checklist:

  • Documentation
  • Test case(s) to demonstrate the difference of before/after

Review Requirements:

  • Verify column visibility settings persist correctly across page refreshes
  • Check column visibility toggles work as expected in all affected list components
  • Confirm existing user column preferences are preserved during migration

Copy link

graphite-app bot commented Nov 27, 2024

Your org requires the Graphite merge queue for merging into main

Add the label “flow:merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “flow:hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added the size:L 100~500 LoC label Nov 27, 2024
@agatha197 agatha197 added the type:fix Fix features that are not working label Nov 27, 2024 — with Graphite App
Copy link

github-actions bot commented Nov 27, 2024

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements
5.21% (-0% 🔻)
395/7583
🔴 Branches
4.55% (+0.02% 🔼)
237/5209
🔴 Functions
3.12% (-0% 🔻)
78/2503
🔴 Lines
5.13% (-0% 🔻)
380/7414
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🔴
... / useHiddenColumnKeysSetting.tsx
0% 100% 0% 0%

Test suite run success

124 tests passing in 14 suites.

Report generated by 🧪jest coverage report action from 9df5bac

react/src/hooks/useBAISetting.tsx Outdated Show resolved Hide resolved
@agatha197 agatha197 force-pushed the fix/switch-to-managing-hiddenColumnKeys-in-TableColumnsSettingModal branch from 8aa9a76 to 9df5bac Compare November 27, 2024 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L 100~500 LoC type:fix Fix features that are not working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch to managing hiddenColumnKeys in TableColumnsSettingModal
2 participants