feat: add monitoring settings tab, workbench view, and inspection alert improvements
Some checks failed
AI automation / Route event (push) Has been cancelled
AI automation / Hand reopened issue to maintainers (push) Has been cancelled
AI automation / Clean source issue state (push) Has been cancelled
AI automation / Reconcile handoffs (push) Has been cancelled
AI automation / Classify issue (push) Has been cancelled
AI automation / Claude Code smoke (push) Has been cancelled
AI automation / Review issue follow-up (push) Has been cancelled
AI automation / Publish issue follow-up (push) Has been cancelled
AI automation / Implement with Claude Code (push) Has been cancelled
AI automation / Publish implement PR (push) Has been cancelled
AI automation / Continue queued issue comments (push) Has been cancelled
AI automation / Codex review loop (push) Has been cancelled
AI automation / Publish Codex fix (push) Has been cancelled
AI automation / Clear Codex dispatch marker (push) Has been cancelled
AI automation / Own PR re-request Codex (push) Has been cancelled
AI automation / External PR re-request Codex (push) Has been cancelled
AI automation / Poll Codex reaction / retry (push) Has been cancelled

This commit is contained in:
2026-10-30 12:12:04 +08:00
committed by trae-solo-agent
parent 16dd04f746
commit 4a02370006
26 changed files with 2569 additions and 233 deletions

View File

@@ -159,13 +159,21 @@ export function useSettingsIpcSync({
setSftpTransferConcurrencyState,
setSshTransportIdleTtlMsState,
}: UseSettingsIpcSyncParams) {
// Listen for settings changes from other windows via IPC
// Listen for settings changes from other windows via IPC.
// Preload (preload.cjs) owns the single upstream IPC listener and dispatches
// a `netcatty-settings-batch` CustomEvent after bulk-updating localStorage.
// We listen to that CustomEvent here instead of registering a second IPC
// listener (which would double-fire settingsGetAll + localStorage writes).
useEffect(() => {
if (!enabled) return;
const bridge = netcattyBridge.get();
if (!bridge?.onSettingsChanged) return;
const unsubscribe = bridge.onSettingsChanged((payload) => {
const { key, value } = payload;
const handler = (e: Event) => {
const detail = (e as CustomEvent).detail;
if (!detail || typeof detail !== 'object') return;
// 新格式: { settings: {...}, changedKeys: [...], changedEntries: {...} }
// 从中提取逐 key 变化信息,保持原有的逐 key 同步逻辑
const { changedEntries } = detail as { changedEntries?: Record<string, unknown> };
if (!changedEntries) return;
for (const [key, value] of Object.entries(changedEntries)) {
if (
key === STORAGE_KEY_THEME ||
key === STORAGE_KEY_UI_THEME_LIGHT ||
@@ -174,7 +182,7 @@ export function useSettingsIpcSync({
key === STORAGE_KEY_COLOR
) {
syncAppearanceFromStorage({ key, value });
return;
continue; // 跳过当前 key 的后续检查,继续 for 循环
}
if (key === STORAGE_KEY_UI_LANGUAGE && typeof value === 'string') {
const next = resolveSupportedLocale(value);
@@ -333,14 +341,10 @@ export function useSettingsIpcSync({
if (key === STORAGE_KEY_SSH_TRANSPORT_IDLE_TTL_MS && typeof value === 'number') {
setSshTransportIdleTtlMsState((prev) => (prev === value ? prev : value));
}
});
return () => {
try {
unsubscribe?.();
} catch {
// ignore
}
} // end for (changedEntries)
};
window.addEventListener("netcatty-settings-batch", handler);
return () => window.removeEventListener("netcatty-settings-batch", handler);
}, [
enabled,
applyIncomingCustomKeyBindings,