Repository navigation
Commit ec0db7a
fix(app): ask for one name when alerting a new saved search (#3563)
## Summary
Creating an alert from the search page asked for two names and never said which was which.
On an **unsaved** search the modal showed a bordered "Saved search name" input in its header *and* the alert's own "Name" field, whose placeholder read "Defaults to the saved search or dashboard tile name" — a name field explaining itself in terms of a name field four pixels above it. On a **saved** search the header already read "Alerts for **Checkout errors**" and the alert's Name field was pre-filled with "Checkout errors" again, which reads as a duplicate rather than an override.
This is a prototype of the simplification: **one name per screen.**
- **Unsaved search:** the search is named once, inline in the header, in the same `InlineNameInput` ("Untitled search") the saved search page uses for the same object. The alert's own name and tags row is gone — the create payload omits `displayName`/`tags`, which the server already derives from the saved search it is attached to, so the alert comes out named after the search either way. The tags button next to the name now tags the *search* (previously it tagged only the alert and the new search was silently saved untagged).
- **Saved search:** the alert's field is labelled "Alert name" and left empty with the inherited name as its placeholder, so it reads as an override rather than a copy. Tags show "Inherited".
- The unnamed-search error moved from a red toast to an inline message under the name, and now fires on the *first* submit alongside the other field errors rather than only after the webhook is valid.
- The single "New Alert" tab is hidden when there is no saved search (nothing to switch between), and the modal's buttons are sentence case.
No API change. Removing the client-side prefill relies on `deriveAlertDisplayFields`, which already clamps the name and tags to the alert caps — the same clamping the client was doing by hand with `clampAlertDisplayName`/`clampAlertTags`.
### Screenshots or video
Both captured on `yarn dev`, same viewport and theme.
**Alerting an unsaved search** — two name fields before, one after:
| Before | After |
| :----- | :---- |
| ![Before: Alerts for \[Saved search name\] input, plus a Name field placeholdered ](https://cursor.com/artifacts/c/art-5123c16b-2794-4aba-8292-b8d6db9efb3b) | ![After: Alerts for \[Untitled search\] inline name and a tags button, with the helper line ](https://cursor.com/artifacts/c/art-4a662cc7-157c-4310-ada3-489ccd29e4da) |
**Alerting a saved search** — pre-filled duplicate before, inherited placeholder after:
| Before | After |
| :----- | :---- |
|  |  |
Unnamed search on the first submit:

The alert created this way lands with the search's name and tags:

### How to reproduce
**Starting point:** `yarn dev` (the Alerts button is hidden in local mode, so the demo server and the Vercel preview can't reach this modal). Register, then open **Search** and pick any logs source.
**On `main`:**
1. Without saving the search, click **Alerts**.
2. Two name inputs: "Saved search name" beside "Alerts for" in the header, and "Name" directly below it. Nothing says which one names what, or that leaving the second empty inherits the first.
3. Click **Save**, name the search `Checkout errors`, then click **Alerts** again: the header says "Alerts for Checkout errors" and the Name field repeats `Checkout errors`.
**On this branch:**
1. Without saving the search, click **Alerts**. One name, inline after "Alerts for", placeholdered "Untitled search", with "Saving creates this search; the alert takes its name and tags." underneath.
2. Click **Save search and alert** with the name empty: "Name the search before saving it." appears inline, in the same pass as the webhook error.
3. Type `Payment failures`, add the tag `payments` with the button beside the name, pick a webhook, and save. You land on the new saved search, and **Alerts** lists an alert named `Payment failures` tagged `payments`.
4. On that saved search, click **Alerts** again: the field is now "Alert name", empty, placeholdered `Payment failures`, with tags reading "Inherited".
### How to test on Vercel preview
N/A — the Alerts button is not rendered in local mode (`IS_LOCAL_MODE`), so the preview build cannot reach this modal.
### References
- Linear Issue: HDX-5917
<div><a href="https://cursor.com/agents/bc-6733facc-b522-4d71-b388-4a42c5f6e389?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a href="https://cursor.com/background-agent?bcId=bc-6733facc-b522-4d71-b388-4a42c5f6e389&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a> </div>
Fixes HDX-5917
Co-authored-by: Cursor Agent <199161495+cursoragent@users.noreply.github.com>1 parent 5abf27e commit ec0db7a
5 files changed
Lines changed: 285 additions & 118 deletions
File tree
- .changeset
- packages/app
- src
- __tests__
- components
- tests/e2e/components
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
4 | 10 | | |
5 | 11 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
41 | | - | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| 53 | + | |
51 | 54 | | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
| |||
95 | 99 | | |
96 | 100 | | |
97 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
98 | 163 | | |
99 | 164 | | |
100 | 165 | | |
101 | 166 | | |
102 | 167 | | |
103 | 168 | | |
104 | 169 | | |
105 | | - | |
106 | 170 | | |
107 | 171 | | |
108 | 172 | | |
109 | 173 | | |
110 | 174 | | |
111 | 175 | | |
| 176 | + | |
112 | 177 | | |
113 | 178 | | |
114 | 179 | | |
| |||
117 | 182 | | |
118 | 183 | | |
119 | 184 | | |
120 | | - | |
121 | | - | |
122 | 185 | | |
123 | 186 | | |
124 | 187 | | |
125 | 188 | | |
126 | 189 | | |
127 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
128 | 197 | | |
129 | 198 | | |
130 | 199 | | |
| |||
154 | 223 | | |
155 | 224 | | |
156 | 225 | | |
157 | | - | |
158 | | - | |
159 | 226 | | |
160 | 227 | | |
161 | 228 | | |
| |||
183 | 250 | | |
184 | 251 | | |
185 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
186 | 274 | | |
187 | 275 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
209 | 280 | | |
210 | 281 | | |
211 | 282 | | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
219 | 295 | | |
220 | 296 | | |
221 | 297 | | |
| |||
422 | 498 | | |
423 | 499 | | |
424 | 500 | | |
425 | | - | |
| 501 | + | |
426 | 502 | | |
427 | 503 | | |
428 | 504 | | |
| |||
432 | 508 | | |
433 | 509 | | |
434 | 510 | | |
435 | | - | |
| 511 | + | |
436 | 512 | | |
437 | | - | |
438 | | - | |
| 513 | + | |
| 514 | + | |
439 | 515 | | |
440 | 516 | | |
441 | 517 | | |
| |||
480 | 556 | | |
481 | 557 | | |
482 | 558 | | |
483 | | - | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
484 | 565 | | |
485 | 566 | | |
486 | 567 | | |
487 | 568 | | |
488 | 569 | | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
| 570 | + | |
495 | 571 | | |
496 | 572 | | |
497 | 573 | | |
498 | | - | |
| 574 | + | |
499 | 575 | | |
500 | 576 | | |
501 | 577 | | |
502 | 578 | | |
503 | 579 | | |
504 | 580 | | |
505 | 581 | | |
506 | | - | |
| 582 | + | |
507 | 583 | | |
508 | 584 | | |
509 | 585 | | |
| |||
590 | 666 | | |
591 | 667 | | |
592 | 668 | | |
593 | | - | |
594 | | - | |
| 669 | + | |
| 670 | + | |
595 | 671 | | |
596 | 672 | | |
597 | 673 | | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
609 | 682 | | |
610 | 683 | | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | | - | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
619 | 702 | | |
620 | 703 | | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
630 | 707 | | |
631 | 708 | | |
632 | 709 | | |
633 | 710 | | |
634 | 711 | | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | 712 | | |
644 | 713 | | |
645 | 714 | | |
| |||
651 | 720 | | |
652 | 721 | | |
653 | 722 | | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
654 | 726 | | |
655 | 727 | | |
656 | 728 | | |
| |||
0 commit comments