Commit 49ebfef
authored
feat(health-bar): replace instance switcher Popover with Dialog (#142)
## Summary
- Replaces the `Popover` + `Command` combo with a proper `Dialog`
(native `<dialog showModal()>` via `shared/ui/Dialog`) that opens when
clicking the project name trigger
- `Command.Input` is always visible in the dialog — the placeholder
changes to *"No other instances running"* in the empty state so users
know what to do
- Extracts the instance list row into
`entities/instance/ui/InstanceItem.svelte` (FSD: entity layer owns its
own display primitive)
- Migrates switcher trigger CSS from `:global(.switcher-btn)` to scoped
selectors (it's now a plain `<button>`, not `Popover.Trigger`)
- Removes the `:global(.switcher-popover)` block; `Command.Input` gets a
box-style border instead of the previous bottom-border-only style
## Why
Previous Popover felt like a plain floating box with no backdrop or
modal affordance — especially noticeable in the no-instances empty
state. A Dialog gives a proper modal surface, keyboard dismiss (Escape),
backdrop click to close, and focus trap out of the box.
## Test plan
- [ ] Clicking the project name opens a modal dialog with "Switch
instance" title
- [ ] Escape or clicking the backdrop closes the dialog
- [ ] Empty state: Command.Input shows disabled placeholder, empty-state
copy is visible
- [ ] With other instances: search filters list, clicking an instance
triggers pre-flight check → navigate or toast error
- [ ] `data-test` attributes preserved: `instance-switcher-trigger`,
`instance-switcher`, `instance-switcher-empty`, `instance-item`,
`instance-status`, `instance-offline`
- [ ] `svelte-check`: 0 errors, 0 warnings (1072 files)
Refs: PRD-027
🤖 Generated with [Claude Code](https://claude.com/claude-code)4 files changed
Lines changed: 137 additions & 148 deletions
File tree
- template/src
- entities/instance
- ui
- widgets/health-bar/ui
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
104 | | - | |
| 105 | + | |
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
| |||
297 | 298 | | |
298 | 299 | | |
299 | 300 | | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
325 | 327 | | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
| 361 | + | |
391 | 362 | | |
392 | 363 | | |
393 | 364 | | |
394 | 365 | | |
395 | | - | |
396 | | - | |
397 | | - | |
| 366 | + | |
| 367 | + | |
398 | 368 | | |
399 | 369 | | |
400 | 370 | | |
| |||
540 | 510 | | |
541 | 511 | | |
542 | 512 | | |
543 | | - | |
| 513 | + | |
544 | 514 | | |
545 | 515 | | |
546 | 516 | | |
| |||
559 | 529 | | |
560 | 530 | | |
561 | 531 | | |
562 | | - | |
| 532 | + | |
563 | 533 | | |
564 | 534 | | |
565 | 535 | | |
566 | | - | |
| 536 | + | |
567 | 537 | | |
568 | 538 | | |
569 | 539 | | |
570 | | - | |
| 540 | + | |
571 | 541 | | |
572 | 542 | | |
573 | 543 | | |
574 | | - | |
| 544 | + | |
575 | 545 | | |
576 | 546 | | |
577 | 547 | | |
578 | 548 | | |
579 | | - | |
| 549 | + | |
580 | 550 | | |
581 | 551 | | |
582 | 552 | | |
| |||
588 | 558 | | |
589 | 559 | | |
590 | 560 | | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | 561 | | |
611 | 562 | | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
616 | 567 | | |
617 | 568 | | |
618 | 569 | | |
619 | 570 | | |
620 | | - | |
| 571 | + | |
| 572 | + | |
621 | 573 | | |
622 | 574 | | |
623 | 575 | | |
624 | 576 | | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
625 | 580 | | |
626 | 581 | | |
627 | 582 | | |
628 | 583 | | |
629 | 584 | | |
630 | | - | |
| 585 | + | |
631 | 586 | | |
632 | 587 | | |
633 | | - | |
| 588 | + | |
634 | 589 | | |
635 | 590 | | |
636 | 591 | | |
| |||
655 | 610 | | |
656 | 611 | | |
657 | 612 | | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
698 | | - | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | 613 | | |
708 | 614 | | |
709 | 615 | | |
| |||
0 commit comments