Files
DeepTutor/web/tests
Bingxi Zhao (Frank) 90f40c48f5 refactor(web): make AppShellContext the single source for code-block prefs
#648 kept code-block appearance state in three places — AppShellContext,
SettingsContext (a duplicate useState mirror + direct cross-context setters),
and the appearance page (its own useState + a storage/event listener) — kept
in sync via a custom event and belt-and-suspenders direct setters that a test
comment admitted papered over an effect-ordering worry.

Collapse to one owner. AppShellContext (already consumed by RichCodeBlock)
holds the state and hydrates it after the SSR-safe first render. SettingsContext
now reads the values from useAppShell and its update* setters delegate to the
AppShell setters (which normalize, persist to localStorage, and notify) before
mirroring to the backend; it keeps no local copy. The appearance page reads the
values from the settings context and drops its local mirror + event listener.

Behavior is unchanged (same values render, same persistence); there is just one
source of truth instead of three. Tests updated to assert the new wiring; full
web test suite green (211).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 23:04:47 +08:00
..
2026-01-15 02:49:17 +08:00
2026-07-19 16:56:34 +08:00
2026-06-19 20:05:19 +08:00
2026-06-11 20:03:34 +08:00
2026-04-30 23:41:58 +08:00
2026-05-12 02:20:30 +08:00