-
Notifications
You must be signed in to change notification settings - Fork 3.3k
feat(conversations): make widget ticket recovery text customizable #90802
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
base: master
Are you sure you want to change the base?
Changes from all commits
4264a07
7db63ff
26a1460
4cd1ebb
7c4d01d
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 |
|---|---|---|
|
|
@@ -138,6 +138,8 @@ export interface supportSettingsLogicValues { | |
| name: string | ||
| }[] | ||
| teamsTeamsLoading: boolean | ||
| ticketRecoveryLinkTextValue: string | null | ||
| ticketRecoveryTextValue: string | null | ||
| widgetEnabledLoading: boolean | ||
| } | ||
|
|
||
|
|
@@ -382,6 +384,12 @@ export interface supportSettingsLogicActions { | |
| saveSlackTicketEmoji: () => { | ||
| value: true | ||
| } | ||
| saveTicketRecoveryLinkText: () => { | ||
| value: true | ||
| } | ||
| saveTicketRecoveryText: () => { | ||
| value: true | ||
| } | ||
| sendTestEmail: (configId: string) => { | ||
| configId: string | ||
| } | ||
|
|
@@ -494,6 +502,12 @@ export interface supportSettingsLogicActions { | |
| status: 'error' | 'idle' | 'installed' | 'installing' | 'needs_org_catalog' | ||
| teamId: string | null | ||
| } | ||
| setTicketRecoveryLinkTextValue: (value: string | null) => { | ||
| value: string | null | ||
| } | ||
| setTicketRecoveryTextValue: (value: string | null) => { | ||
| value: string | null | ||
| } | ||
| setWidgetEnabledLoading: (loading: boolean) => { | ||
| loading: boolean | ||
| } | ||
|
|
@@ -600,6 +614,10 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([ | |
| saveIdentificationFormDescription: true, | ||
| setPlaceholderTextValue: (value: string | null) => ({ value }), | ||
| savePlaceholderText: true, | ||
| setTicketRecoveryTextValue: (value: string | null) => ({ value }), | ||
| saveTicketRecoveryText: true, | ||
| setTicketRecoveryLinkTextValue: (value: string | null) => ({ value }), | ||
| saveTicketRecoveryLinkText: true, | ||
| // Notification recipients | ||
| setNotificationRecipients: (users: UserBasicType[]) => ({ users }), | ||
| // Slack channel settings (SupportHog) | ||
|
|
@@ -738,6 +756,18 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([ | |
| setPlaceholderTextValue: (_, { value }) => value, | ||
| }, | ||
| ], | ||
| ticketRecoveryTextValue: [ | ||
| null as string | null, | ||
| { | ||
| setTicketRecoveryTextValue: (_, { value }) => value, | ||
| }, | ||
| ], | ||
| ticketRecoveryLinkTextValue: [ | ||
| null as string | null, | ||
| { | ||
| setTicketRecoveryLinkTextValue: (_, { value }) => value, | ||
| }, | ||
| ], | ||
| // Email multi-config state | ||
| emailConfigs: [ | ||
| [] as EmailConfigStatus[], | ||
|
|
@@ -1277,6 +1307,30 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([ | |
| }, | ||
| }) | ||
| }, | ||
| saveTicketRecoveryText: () => { | ||
| const trimmedValue = values.ticketRecoveryTextValue?.trim() | ||
| if (!trimmedValue) { | ||
| return | ||
| } | ||
| actions.updateCurrentTeam({ | ||
| conversations_settings: { | ||
| ...values.currentTeam?.conversations_settings, | ||
| widget_ticket_recovery_text: trimmedValue, | ||
| }, | ||
| }) | ||
| }, | ||
| saveTicketRecoveryLinkText: () => { | ||
| const trimmedValue = values.ticketRecoveryLinkTextValue?.trim() | ||
| if (!trimmedValue) { | ||
| return | ||
| } | ||
| actions.updateCurrentTeam({ | ||
| conversations_settings: { | ||
| ...values.currentTeam?.conversations_settings, | ||
| widget_ticket_recovery_link_text: trimmedValue, | ||
| }, | ||
| }) | ||
| }, | ||
| setNotificationRecipients: ({ users }) => { | ||
| actions.updateCurrentTeam({ | ||
| conversations_settings: { | ||
|
|
@@ -1647,6 +1701,8 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([ | |
| actions.setIdentificationFormTitleValue(null) | ||
| actions.setIdentificationFormDescriptionValue(null) | ||
|
Comment on lines
1701
to
1702
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.
When a user enters either recovery-text draft and then changes another widget setting such as color, position, enabled state, or required email, that setting's Prompt To Fix With AIThis is a comment left during a code review.
Path: products/conversations/frontend/scenes/settings/supportSettingsLogic.ts
Line: 1701-1702
Comment:
**Unrelated updates erase recovery drafts**
When a user enters either recovery-text draft and then changes another widget setting such as color, position, enabled state, or required email, that setting's `updateCurrentTeamSuccess` resets both draft values to `null`, causing the inputs to revert to their persisted text and silently discard the user's edits.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
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. Confirmed this is a real issue, and it predates this PR. The
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. Agreed. This is a real, pre-existing issue in the shared copy-field save flow, and fixing only the recovery fields would create inconsistent behavior with greeting, placeholder, identification, and Slack copy. Keeping it as a follow-up for a coordinated draft-reset redesign is the right scope decision; the recovery Save-button loading guard does not address resets triggered by unrelated immediate-save controls. |
||
| actions.setPlaceholderTextValue(null) | ||
| actions.setTicketRecoveryTextValue(null) | ||
| actions.setTicketRecoveryLinkTextValue(null) | ||
| actions.setSlackTicketEmojiValue(null) | ||
| actions.setSlackBotIconUrlValue(null) | ||
| actions.setSlackBotDisplayNameValue(null) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.