feat(webui): add developer settings tools

Expose onboarding replay and page crash testing from a dedicated settings page.\n\nKeep replay actions isolated from persisted consent and password state.
This commit is contained in:
DrSmoothl committed 2026-08-01 00:40:44 +08:00
1 parent 8080104311
commit 958d17ecc0
11 files changed
+365 -29

No files matched your search

@@ -0,0 +1,19 @@
export const DEVELOPER_CRASH_MESSAGE = '开发者工具主动触发的 WebUI 崩溃测试';
/** Throws the deliberate render-time exception used to exercise ErrorPage. */
export function raiseDeveloperCrash(): never {
throw new Error(DEVELOPER_CRASH_MESSAGE);
}
export function developerCrashReducer(
_requested: boolean,
action: 'confirm',
): boolean {
if (action === 'confirm') return true;
throw new Error(`Unknown developer crash action: ${String(action)}`);
}
export function DeveloperCrashProbe({ requested }: { requested: boolean }): null {
if (requested) raiseDeveloperCrash();
return null;
}