-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Adding notification for planning questionnaire #3028
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
c59f795
bb0acb0
71eb76b
cfa4a4f
2867f49
f470007
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| + "enableChatCompletionNotifications": true | ||
| + "enableChatEventNotifications": true |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,7 +10,7 @@ export function NotificationBanner() { | |||||||||
|
|
||||||||||
| const showBanner = | ||||||||||
| settings && | ||||||||||
| settings.enableChatCompletionNotifications !== true && | ||||||||||
| settings.enableChatEventNotifications !== true && | ||||||||||
| settings.skipNotificationBanner !== true; | ||||||||||
|
|
||||||||||
| const handleSkip = () => { | ||||||||||
|
|
@@ -22,7 +22,7 @@ export function NotificationBanner() { | |||||||||
| {showBanner && ( | ||||||||||
| <SkippableBanner | ||||||||||
| icon={Bell} | ||||||||||
| message="Get notified when chat responses finish." | ||||||||||
| message="Get notified about chat events." | ||||||||||
azizmejri1 marked this conversation as resolved.
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 MEDIUM | microcopy Banner message uses developer jargon "Get notified about chat events" uses internal terminology ("chat events") that won't resonate with users. The previous message "Get notified when chat responses finish" was more concrete and user-friendly. 💡 Suggestion: Use a message that describes the actual benefit, e.g.:
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 MEDIUM | microcopy "Chat events" is vague, user-unfriendly microcopy "Get notified about chat events." uses developer jargon — users don't think in terms of "chat events." The previous copy ("Get notified when chat responses finish.") was more specific and action-oriented. Since the feature now covers two cases, the banner should communicate both clearly. 💡 Suggestion:
Suggested change
|
||||||||||
| enableLabel="Enable" | ||||||||||
| onEnable={enable} | ||||||||||
| onSkip={handleSkip} | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -177,6 +177,19 @@ export function usePlanEvents() { | |||
| next.set(payload.chatId, payload); | ||||
| return next; | ||||
| }); | ||||
|
|
||||
| // Show native notification if enabled and window is not focused | ||||
| const notificationsEnabled = | ||||
| settingsRef.current?.enableChatEventNotifications === true; | ||||
| if ( | ||||
| notificationsEnabled && | ||||
| Notification.permission === "granted" && | ||||
| !document.hasFocus() | ||||
| ) { | ||||
| new Notification("Dyad", { | ||||
|
||||
| new Notification(appName, { |
azizmejri1 marked this conversation as resolved.
Show resolved
Hide resolved
azizmejri1 marked this conversation as resolved.
Show resolved
Hide resolved
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -331,7 +331,7 @@ const BaseUserSettingsFields = { | |
|
|
||
| enableAutoFixProblems: z.boolean().optional(), | ||
| autoExpandPreviewPanel: z.boolean().optional(), | ||
| enableChatCompletionNotifications: z.boolean().optional(), | ||
| enableChatEventNotifications: z.boolean().optional(), | ||
azizmejri1 marked this conversation as resolved.
Show resolved
Hide resolved
azizmejri1 marked this conversation as resolved.
Show resolved
Hide resolved
azizmejri1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| enableNativeGit: z.boolean().optional(), | ||
| enableMcpServersForBuildMode: z.boolean().optional(), | ||
| enableAutoUpdate: z.boolean(), | ||
|
|
@@ -365,6 +365,8 @@ export const StoredUserSettingsSchema = z | |
| // Use StoredChatModeSchema to allow deprecated "agent" value | ||
| selectedChatMode: StoredChatModeSchema.optional(), | ||
| defaultChatMode: StoredChatModeSchema.optional(), | ||
| // Deprecated: renamed to enableChatEventNotifications | ||
| enableChatCompletionNotifications: z.boolean().optional(), | ||
| }) | ||
| // Allow unknown properties to pass through (e.g. future settings | ||
| // that should be preserved if user downgrades to an older version) | ||
|
|
@@ -419,6 +421,9 @@ export function migrateStoredSettings( | |
| ...stored, | ||
| selectedChatMode: migrateStoredChatMode(stored.selectedChatMode), | ||
| defaultChatMode: migrateStoredChatMode(stored.defaultChatMode), | ||
| enableChatEventNotifications: | ||
| stored.enableChatEventNotifications ?? | ||
| stored.enableChatCompletionNotifications, | ||
azizmejri1 marked this conversation as resolved.
Show resolved
Hide resolved
Comment on lines
+424
to
+426
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This migration only fixes the upgrade path. Useful? React with 👍 / 👎. |
||
| }; | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.