fix(settings): persist font size changes in Appearance theme editor#1415
Conversation
|
Thank you for your contribution! Before we can merge this PR, you need to sign our Contributor License Agreement. To sign, please comment below with:
I have read the CLA Document and I hereby sign the CLA. zhaojianyong seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |
Signed-off-by: Ngô Quốc Đạt <datlechin@gmail.com>
|
Thanks @datlechin for the quick review and merge! Since this fixes a regression that makes the editor font feel too small and any adjustment in Appearance > Fonts gets silently reverted, it's a noticeable papercut for daily use. Would it be possible to include this in the next release? Happy to help verify a pre-release build if that's useful. Thanks again for maintaining TablePro. |
Fixes #1381.
Summary
Two-file fix for the font size bug:
ThemeEngine.saveUserThemenow upserts the saved theme intoavailableThemessynchronously before kicking offreloadAvailableThemes(). The previous code relied on the async reload completing before the SwiftUI binding setter ran, so the new(Custom)theme was missing from the list on the same tick and the picker silently reverted to the original built-in.ThemeEditorFontsSection.updateFontno longer callsengine.activateTheme(copy)directly. Activation goes through theonThemeDuplicatedcallback, which also writespreferredLightThemeId/preferredDarkThemeId. Without that, relaunch reconciliation reverted to the built-in theme and the font size change was lost.Together these fix all three symptoms in the issue: change applies immediately, persists across relaunch, and no orphan
(Custom)themes accumulate per adjustment.Test plan
(Custom)theme.(Custom)theme exists in~/Library/Application Support/TablePro/Themes/.Local build skipped (no Xcode locally), relying on CI.