Update alert subscription UX#2015
Conversation
|
Latest Claude code review:
|
|
Latest Claude code review: Code review summary
|
|
Greg and I discussed the scenario highlighted above on VC which breaks down as follows: Let's say an alert subscription exists for
This results in the creation of "superfluous" (or effectively duplicate) alert subscriptions for That said, this UX quirk was presented on Jul. 10th and approved of but it is likely something we would like to address quickly. Given the prioritization of this feature and the approval, I would push for this quirk to be addressed in a rapid fast-follow. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
The email field loses focus if you backspace to the end. also IIRC didn't we want to prevent editing the email of existing subscriptions? Screen.Recording.2026-07-16.at.10.19.39.PM.mov |
No, a user is free to "edit" the email of an existing subscription. Changing the email field input of an existing subscription results in the same server changes as removing the subscription in the client (i.e., clicking the X button in the top-right corner of subscriber summary) and adding a new one with the updated email. What I aimed to prevent was having more than one templated subscription in the client (i.e., a list item without a specified email).
This is a known issue in production. Happy to investigate the defect and patch it, however I would advocate that this production bug should not be blocking.
Makes sense to me. Will update. |
| if (!fetching && !alertTypeResponse.fetching) { | ||
| if (!fetching && !alertConfigResponse.fetching) { | ||
| setInitializationError(error); | ||
| setSubscriptionMetadata(data?.alertSubscriptions ?? []); |
There was a problem hiding this comment.
I don't quite understand why we're re-saving the urql cache to another store? couldn't we just interact with the query cache directly?
There was a problem hiding this comment.
Query data would be prop drilled considerably to reach the components dependent upon it, needlessly increasing the sensitivity of higher order components. Actions within the store are able to reference relevant query data without the need for their callers to pass the data and, thus, increasing their sensitivity to changes to the data.
Happy to chat through refactor opportunities but I would push for this feature to get out the door given the prioritization.
| useUnmount(() => { | ||
| resetSubscriptionState(); | ||
| }); |
There was a problem hiding this comment.
this feels like a postgrest vestige. why do we need a globally scoped state to begin with? urql cache + an edit buffer that lives and dies with the dialog should be sufficient and much simpler, no?
There was a problem hiding this comment.
In the Control Plane/UI Sync meeting on Monday, let's chat about how we would like to interact with GraphQL.
As for this PR, alert configs used to be fetched when the debounced prefix input changed yet still stored at that time. In light of the limitation of the alertConfigs endpoint that resulted in the need for the control-plane workaround, the timing of the call was adjusted but, yes, the data is still stored in a Zustand store. There are some benefits to that and, to my knowledge, the GraphQL query key issue is still present in the repo that would require the query data to be considerably prop drilled. I am not opposed to a refactor if you see a better approach to working with GraphQL data. However, given the urgency around this feature, I would like to land this ASAP and revisit at this point.
|
One thing that would be worth doing (and is hopefully a small change) is replacing the hand-written gql queries with the codegen types |

Issues
The issues directly below are advanced by this PR:
#1960
Changes
1960
Tests
Manually tested
Automated tests
Playwright tests ran locally
Screenshots
NOTE: Code that altered button label styling in the application was merged into this branch after screenshots were taken for this PR. The button labels in the Organization Notifications section of the Settings tab on the Admin page are in title case.
Table
Organization Notifications table
Dialogs
Configure Notification Methods dialog | Initialized
Configure Notification Methods dialog | Subscription summary expanded
Update Notification Methods dialog | Initialized
Update Notification Methods dialog | Subscription summary expanded
Recipients section | No recipients found
Alert Types List Item Interactions
Standard alert type | Deselected
Standard alert type | Deselected | Hovered
Standard alert type | Selected
Standard alert type | Selected | Hovered
System alert type
A list item corresponding to a system alert type does not have a hover state since it cannot be deselected.
Errors
Duplicate subscribed email detected | Subscriber summary expanded
Duplicate subscribed email detected | Subscriber summary collapsed
Multiple email input errors detected | Subscriber summary expanded
Multiple email input errors detected | Subscriber summary collapsed