feat: notification center toast coordination (PR-4)

- EventToastBridge checks notification_toast_level and notification_mute_categories
- toast-rules.ts: event-to-category/severity mapping functions
- Settings page: notification preferences section (toast level dropdown, mute checkboxes)
- Settings API types extended with notification preference fields
- 17 frontend tests (toast-rules + bridge)
- Preference hierarchy: mute categories → toast level → show/hide

Quality gates: vitest 17 passed, tsc clean, eslint clean
This commit is contained in:
2026-05-29 13:45:17 +02:00
parent ceaed9af66
commit 19242b4152
8 changed files with 808 additions and 281 deletions
+21 -15
View File
@@ -1,27 +1,33 @@
import { apiClient } from "./client";
export interface UserConfig {
default_editor: string | null;
theme: string;
git_user_name: string | null;
git_user_email: string | null;
last_session_id: string | null;
default_editor: string | null;
theme: string;
git_user_name: string | null;
git_user_email: string | null;
last_session_id: string | null;
notification_toast_level?: "all" | "errors" | "none";
notification_mute_categories?: string[];
}
export interface UserConfigUpdate {
default_editor?: string | null;
theme?: string | null;
git_user_name?: string | null;
git_user_email?: string | null;
last_session_id?: string | null;
default_editor?: string | null;
theme?: string | null;
git_user_name?: string | null;
git_user_email?: string | null;
last_session_id?: string | null;
notification_toast_level?: "all" | "errors" | "none";
notification_mute_categories?: string[];
}
export const getUserConfig = async (): Promise<UserConfig> => {
const response = await apiClient.get<UserConfig>("/users/me/config");
return response.data;
const response = await apiClient.get<UserConfig>("/users/me/config");
return response.data;
};
export const updateUserConfig = async (data: UserConfigUpdate): Promise<UserConfig> => {
const response = await apiClient.patch<UserConfig>("/users/me/config", data);
return response.data;
export const updateUserConfig = async (
data: UserConfigUpdate,
): Promise<UserConfig> => {
const response = await apiClient.patch<UserConfig>("/users/me/config", data);
return response.data;
};