feat(FR-1720): implement theme color reset functionality#4785
feat(FR-1720): implement theme color reset functionality#4785graphite-app[bot] merged 1 commit intomainfrom
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has required the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
bdbf13c to
9172c62
Compare
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🔴 | Statements | 4.36% | 516/11835 |
| 🔴 | Branches | 3.58% | 298/8319 |
| 🔴 | Functions | 2.62% | 95/3629 |
| 🔴 | Lines | 4.34% | 502/11577 |
Test suite run success
145 tests passing in 14 suites.
Report generated by 🧪jest coverage report action from 0695326
9172c62 to
ebcdf6a
Compare
There was a problem hiding this comment.
Pull request overview
This PR implements individual theme color reset functionality, allowing users to reset specific theme color tokens to their defaults. Key changes include adding functional update support to useBAISettingUserState to prevent race conditions during bulk resets, refactoring the settings component architecture to use onAfterChange instead of onChange, and introducing per-item reset buttons with confirmation modals.
- Added
resetThemeConfigfunction to reset individual theme colors back to default values from theme.json - Refactored setting items to use
checkboxProps/selectPropsinstead of top-leveldisabledprop for better type safety - Implemented functional update pattern in atom setter to support safe state updates
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| react/src/hooks/useBAISetting.tsx | Added functional update support (SetStateAction<T>) to useBAISettingUserState to enable safe state updates and prevent race conditions |
| react/src/components/BrandingSettingList.tsx | Implemented resetThemeConfig function to reset individual theme tokens using functional updates |
| react/src/components/SettingItem.tsx | Added individual reset button UI with dropdown menu, confirmation modal, and refactored to use checkboxProps/selectProps |
| react/src/components/SettingList.tsx | Updated resetSettingItems to support custom onReset handlers and refactored validation logic for new prop structure |
| react/src/pages/UserSettingsPage.tsx | Migrated from onChange to onAfterChange pattern and added showResetButton: false for non-resettable config buttons |
| react/src/components/ConfigurationsSettingList.tsx | Refactored disabled prop to use checkboxProps.disabled structure, removed global reset button |
| react/src/components/MaintenanceSettingList.tsx | Added showResetButton: false to maintenance action buttons |
| react/src/components/BrandingSettingItems/ThemeColorPicker.tsx | Exported ThemeConfigPath type for use in reset functionality |
ebcdf6a to
0755d8e
Compare
nowgnuesLee
left a comment
There was a problem hiding this comment.
Could you review the copilot's reviews?
0755d8e to
a9a7a71
Compare
a9a7a71 to
9bc0ecd
Compare
9bc0ecd to
a9a7a71
Compare
Merge activity
|
Resolves #4689 ([FR-1720](https://lablup.atlassian.net/browse/FR-1720)) ## Summary - Add `resetThemeConfig` function to reset individual theme color tokens back to their default values - Support functional updates in `useBAISettingUserState` to prevent race conditions during bulk resets - Fix theme color reset functionality to properly restore default theme.json values ## Test plan - [ ] Verify individual theme color reset works correctly for each color picker - [ ] Verify "Reset All" button properly resets all theme colors at once - [ ] Confirm reset values match the default theme.json configuration [FR-1720]: https://lablup.atlassian.net/browse/FR-1720?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
a9a7a71 to
0695326
Compare

Resolves #4689 (FR-1720)
Summary
resetThemeConfigfunction to reset individual theme color tokens back to their default valuesuseBAISettingUserStateto prevent race conditions during bulk resetsTest plan