feat: Improve notifications with templates, summarization, and more (#317)

* feat: Successfully added new notification settings to Zustand

* feat: Successfully implemented the Events subsection

* feat: Successfully wired new notification settings

* feat: Added notification template editor section to Notifications

* feat: Added server-side template resolution and summarize

* feat: Improve notifications with templates, summarization, and more

* fix: session not populated in messages

* fix notification template first-run defaults

---------

Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
This commit is contained in:
gsxdsm
2026-02-09 03:58:29 +02:00
committed by GitHub
co-authored by Bohdan Triapitsyn
parent 4194cd25d6
commit fbf0ec50ee
7 changed files with 1153 additions and 72 deletions
+53
View File
@@ -8,6 +8,19 @@ type AppearanceSlice = {
nativeNotificationsEnabled: boolean;
notificationMode: 'always' | 'hidden-only';
notifyOnSubtasks: boolean;
notifyOnCompletion: boolean;
notifyOnError: boolean;
notifyOnQuestion: boolean;
notificationTemplates: {
completion: { title: string; message: string };
error: { title: string; message: string };
question: { title: string; message: string };
subtask: { title: string; message: string };
};
summarizeLastMessage: boolean;
summaryThreshold: number;
summaryLength: number;
maxLastMessageLength: number;
autoDeleteEnabled: boolean;
autoDeleteAfterDays: number;
toolCallExpansion: 'collapsed' | 'activity' | 'detailed';
@@ -35,6 +48,14 @@ export const startAppearanceAutoSave = (): void => {
nativeNotificationsEnabled: useUIStore.getState().nativeNotificationsEnabled,
notificationMode: useUIStore.getState().notificationMode,
notifyOnSubtasks: useUIStore.getState().notifyOnSubtasks,
notifyOnCompletion: useUIStore.getState().notifyOnCompletion,
notifyOnError: useUIStore.getState().notifyOnError,
notifyOnQuestion: useUIStore.getState().notifyOnQuestion,
notificationTemplates: useUIStore.getState().notificationTemplates,
summarizeLastMessage: useUIStore.getState().summarizeLastMessage,
summaryThreshold: useUIStore.getState().summaryThreshold,
summaryLength: useUIStore.getState().summaryLength,
maxLastMessageLength: useUIStore.getState().maxLastMessageLength,
autoDeleteEnabled: useUIStore.getState().autoDeleteEnabled,
autoDeleteAfterDays: useUIStore.getState().autoDeleteAfterDays,
toolCallExpansion: useUIStore.getState().toolCallExpansion,
@@ -74,6 +95,14 @@ export const startAppearanceAutoSave = (): void => {
nativeNotificationsEnabled: state.nativeNotificationsEnabled,
notificationMode: state.notificationMode,
notifyOnSubtasks: state.notifyOnSubtasks,
notifyOnCompletion: state.notifyOnCompletion,
notifyOnError: state.notifyOnError,
notifyOnQuestion: state.notifyOnQuestion,
notificationTemplates: state.notificationTemplates,
summarizeLastMessage: state.summarizeLastMessage,
summaryThreshold: state.summaryThreshold,
summaryLength: state.summaryLength,
maxLastMessageLength: state.maxLastMessageLength,
autoDeleteEnabled: state.autoDeleteEnabled,
autoDeleteAfterDays: state.autoDeleteAfterDays,
toolCallExpansion: state.toolCallExpansion,
@@ -103,6 +132,30 @@ export const startAppearanceAutoSave = (): void => {
if (current.notifyOnSubtasks !== previous.notifyOnSubtasks) {
diff.notifyOnSubtasks = current.notifyOnSubtasks;
}
if (current.notifyOnCompletion !== previous.notifyOnCompletion) {
diff.notifyOnCompletion = current.notifyOnCompletion;
}
if (current.notifyOnError !== previous.notifyOnError) {
diff.notifyOnError = current.notifyOnError;
}
if (current.notifyOnQuestion !== previous.notifyOnQuestion) {
diff.notifyOnQuestion = current.notifyOnQuestion;
}
if (JSON.stringify(current.notificationTemplates) !== JSON.stringify(previous.notificationTemplates)) {
diff.notificationTemplates = current.notificationTemplates;
}
if (current.summarizeLastMessage !== previous.summarizeLastMessage) {
diff.summarizeLastMessage = current.summarizeLastMessage;
}
if (current.summaryThreshold !== previous.summaryThreshold) {
diff.summaryThreshold = current.summaryThreshold;
}
if (current.summaryLength !== previous.summaryLength) {
diff.summaryLength = current.summaryLength;
}
if (current.maxLastMessageLength !== previous.maxLastMessageLength) {
diff.maxLastMessageLength = current.maxLastMessageLength;
}
if (current.autoDeleteEnabled !== previous.autoDeleteEnabled) {
diff.autoDeleteEnabled = current.autoDeleteEnabled;
}