Skip to content

Comments

feat(FR-1720): implement theme color reset functionality#4785

Merged
graphite-app[bot] merged 1 commit intomainfrom
feat/FR-1720-theme-color-reset
Dec 18, 2025
Merged

feat(FR-1720): implement theme color reset functionality#4785
graphite-app[bot] merged 1 commit intomainfrom
feat/FR-1720-theme-color-reset

Conversation

@ironAiken2
Copy link
Contributor

@ironAiken2 ironAiken2 commented Dec 8, 2025

Resolves #4689 (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

@github-actions github-actions bot added the size:M 30~100 LoC label Dec 8, 2025
Copy link
Contributor Author

ironAiken2 commented Dec 8, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@ironAiken2 ironAiken2 force-pushed the feat/FR-1720-theme-color-reset branch from bdbf13c to 9172c62 Compare December 8, 2025 05:51
@github-actions github-actions bot added size:L 100~500 LoC and removed size:M 30~100 LoC labels Dec 8, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

Coverage report for ./react

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

@ironAiken2 ironAiken2 marked this pull request as ready for review December 8, 2025 05:57
@ironAiken2 ironAiken2 requested review from Copilot, nowgnuesLee and yomybaby and removed request for Copilot December 8, 2025 05:57
Copilot AI review requested due to automatic review settings December 8, 2025 10:33
@ironAiken2 ironAiken2 force-pushed the feat/FR-1720-theme-color-reset branch from 9172c62 to ebcdf6a Compare December 8, 2025 10:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 resetThemeConfig function to reset individual theme colors back to default values from theme.json
  • Refactored setting items to use checkboxProps/selectProps instead of top-level disabled prop 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

@ironAiken2 ironAiken2 force-pushed the feat/FR-1720-theme-color-reset branch from ebcdf6a to 0755d8e Compare December 8, 2025 10:40
Copy link
Contributor

@nowgnuesLee nowgnuesLee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you review the copilot's reviews?

@ironAiken2 ironAiken2 force-pushed the feat/FR-1720-theme-color-reset branch from 0755d8e to a9a7a71 Compare December 15, 2025 05:18
Copy link
Contributor

@nowgnuesLee nowgnuesLee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@graphite-app
Copy link

graphite-app bot commented Dec 18, 2025

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
@graphite-app graphite-app bot force-pushed the feat/FR-1720-theme-color-reset branch from a9a7a71 to 0695326 Compare December 18, 2025 02:53
@graphite-app graphite-app bot merged commit 0695326 into main Dec 18, 2025
11 checks passed
@graphite-app graphite-app bot deleted the feat/FR-1720-theme-color-reset branch December 18, 2025 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add individual initialization feature for setting items

2 participants