Skip to content

fix(settings): refresh language row labels on live locale switch - #39

Merged
luoxuanzao merged 1 commit into
mainfrom
fix/settings-locale-refresh
Aug 25, 2026
Merged

fix(settings): refresh language row labels on live locale switch#39
luoxuanzao merged 1 commit into
mainfrom
fix/settings-locale-refresh

Conversation

@luoxuanzao

Copy link
Copy Markdown
Member

Summary

  • Fixes the stale language row on live locale switch (Obsidian 1.13+ declarative settings): Obsidian's declarative reconciler re-renders every settings row except the one whose control triggered the change, so after switching the display language the language row kept the previous locale's name/description until the settings tab was reopened.
  • After setControlValue('locale') persists and calls update(), the tab now also patches the language row's leaf text nodes directly with the new locale's strings. Any later full render produces the same strings, so this cannot conflict with the reconciler.
  • Legacy (<1.13) path unchanged; it already re-rendered via renderLegacySettings().
  • Adds querySelectorAll to the mocked PluginSettingTab.containerEl and a CHANGELOG entry; ignores the .verify-shots/ scratch dir.

Verification

  • npm run typecheck
  • npm run lint
  • npm run test (3411 tests)
  • npm run build
  • npm run release:check
  • Real-device E2E in test vault: zh-CN → English → zh-CN, the language row's own label/description refresh immediately on both switches (screenshots verified), no layout regression

Safety

  • No credentials, private vault content, internal URLs, or personal paths are included
  • User-visible change documented in CHANGELOG.md

Obsidian's declarative reconciler re-renders every settings row except
the one whose control triggered the change, so after switching the
display language the language row kept the previous locale's name and
description until the tab was reopened. Patch the row's leaf text nodes
directly after update(); any later full render produces the same
strings, so this cannot conflict with the reconciler.

Co-authored-by: QoderAI (Qwen 3.8 Max) <qoder_ai@qoder.com>
@luoxuanzao
luoxuanzao merged commit 5666578 into main Aug 25, 2026
10 checks passed
@luoxuanzao
luoxuanzao deleted the fix/settings-locale-refresh branch August 25, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant