Commit 70c70ff
feat(web): replicate-first Use menu + send-button attention pulse (#4059)
* feat(web): lead the plugin detail Use menu with Replicate this content
The split-button menu only exists when the plugin ships an example
query, and reproducing the previewed result is what most users open it
for — so the replicate option now comes first and structure-only Use
drops to second.
* feat(web): pulse the send button after a plugin Use or example-prompt pick
Choosing Use / Use with query in the plugin detail modal, or clicking an
example-prompt card, seeds the composer and returns the user to it — but
nothing signals that sending is the next step. Flash the send button
twice (house ease-out, 0.25s delay so the scroll-back settles first,
none under prefers-reduced-motion) via a new HomeHeroHandle.pulseSend()
fired from routePluginUse and useExamplePlugin.
* feat(web): replicate-content as the primary detail CTA + sheen-style send pulse
- The detail modal's primary Use button now reads (and acts as)
'Replicate this content' when the plugin ships an example query;
structure-only Use moves behind the caret menu. Shared via
pluginUsePrimaryAction so all four detail variants agree.
- The send-button attention effect drops the ring+scale flash for a
soft light sweep crossing the button twice — same trigger points,
same reduced-motion opt-out.
- Plain structure-only Use now pulses only when the composer is
actually submittable (draft text or staged files); flashing a
disabled send button pointed at a dead end.
* feat(web): first-run guidance trail — prototype chip and first preset card sheen
Brand-new users (no projects, fresh storage) get a sheen pulse on the
Prototype type chip ~1s after Home settles; picking any type chip
advances a persisted stage and the first example-prompt card pulses
once when the chip's presets render, completing the trail (the existing
send-button pulse covers the final beat after a card pick). Users with
projects have the stage completed silently so the trail never shows.
The send-button sheen generalizes into a shared
.home-hero__attention-sheen class (accent-tinted glint on light chip /
card surfaces), still skipped under prefers-reduced-motion.
* fix(web): gate the first-run guide on project loading completing
firstRunGuide was true whenever projects was the initial empty array,
so the trail could arm for an existing user whose projects were still
loading. Make the prop tri-state (undefined while loading): the guide
neither arms the chip pulse nor silently completes the stage until the
projects answer is known.
* fix(web): close any in-flight guide stage for existing users + gate the card pulse
A chip pick during the projects-loading window can advance the guide
stage to 'card' before firstRunGuide resolves; if the user then turns
out to have projects, the stage lingered and the beat-2 effect (not
gated on firstRunGuide) could sheen the first preset card for a
non-new user. The firstRunGuide === false branch now completes ANY
unfinished stage, and the card-pulse effect requires
firstRunGuide === true.
* fix(web): pulse Send from the static prompt-example path too
The fallback prompt-example cards (rendered when a chip has no example
plugins) seed and focus the composer entirely inside HomeHero, so they
never reached the HomeView-routed pulseSend(). Extract a local
triggerSendAttention() shared by the imperative handle and
usePromptExample, with a focused spec clicking a
home-hero-prompt-example card.
* fix(test): null-guard the first prompt-example card lookup
tsc (noUncheckedIndexedAccess) rejects passing exampleCards[0] straight
to fireEvent.click; guard explicitly.
* fix(web): gate the Send pulse on the composer actually being submittable
usePlugin() now resolves a boolean: whether the bound plugin left the
composer submittable (inputs valid, apply not failed/superseded). All
three pulse call sites (use-with-query, plain Use, example preset pick)
consult it, so a plugin with required inputs and no defaults routes the
user to the inputs form without a misleading flash on the disabled Send
button. Spec: required-input plugin via detail-modal replicate → Send
stays disabled and unsheened.
* fix(web): carry the guide's beat 2 through the static prompt-example fallback
A chip with no plugin presets renders static prompt-example cards, but
the beat-2 effect only watched filteredExamplePlugins — a fresh user on
that path never got the card pulse and the persisted stage stuck at
'card'. Either card surface now satisfies beat 2, the first static
prompt-example button carries the sheen, and a regression spec covers
the presetless-chip path.
* test(e2e): route freeform Use through the Use-plugin-only menu option
The replicate-first menu change makes the detail modal's primary Use button
seed the example query for query-bearing starters, so the structure-only
freeform path now lives in the caret menu's 'Use plugin only' option. Update
the P0 critical 'keeps the prompt freeform' spec to open the caret menu and
click that option, matching the shipped behavior.
* test(e2e): route the remaining freeform Use cases through the menu option
The replicate-first primary CTA also seeds the prompt for query-bearing
starters rendered via PluginExampleDetail/PreviewModal, so the neighboring
[P1] 'Use plugin from the details modal' case (an html-preview fixture with an
example query) that clicked the primary button and asserted an empty composer
would fail once it runs outside the @critical gate. Route it through the caret
menu's 'Use plugin only' option like the P0 case, and correct the now-stale
'no pre-fill' comments on the chip-only and use-with-query cases.
---------
Co-authored-by: qiongyu1999 <2694684348@qq.com>
Co-authored-by: lefarcen <ontf116@gmail.com>1 parent 52a4d65 commit 70c70ff
13 files changed
Lines changed: 652 additions & 55 deletions
File tree
- apps/web
- src
- components
- home-hero
- plugin-details
- styles/home
- tests/components
- e2e/ui
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
96 | 100 | | |
97 | 101 | | |
98 | 102 | | |
| |||
103 | 107 | | |
104 | 108 | | |
105 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
106 | 115 | | |
107 | 116 | | |
108 | 117 | | |
| |||
224 | 233 | | |
225 | 234 | | |
226 | 235 | | |
| 236 | + | |
227 | 237 | | |
228 | 238 | | |
229 | 239 | | |
| |||
290 | 300 | | |
291 | 301 | | |
292 | 302 | | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
293 | 310 | | |
294 | 311 | | |
295 | 312 | | |
| |||
529 | 546 | | |
530 | 547 | | |
531 | 548 | | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
532 | 572 | | |
533 | 573 | | |
534 | 574 | | |
535 | 575 | | |
536 | 576 | | |
537 | 577 | | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
538 | 600 | | |
539 | 601 | | |
540 | 602 | | |
| |||
634 | 696 | | |
635 | 697 | | |
636 | 698 | | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
637 | 710 | | |
638 | 711 | | |
639 | 712 | | |
| |||
643 | 716 | | |
644 | 717 | | |
645 | 718 | | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
646 | 722 | | |
647 | 723 | | |
648 | 724 | | |
| |||
804 | 880 | | |
805 | 881 | | |
806 | 882 | | |
| 883 | + | |
807 | 884 | | |
808 | 885 | | |
809 | 886 | | |
| |||
836 | 913 | | |
837 | 914 | | |
838 | 915 | | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
839 | 922 | | |
840 | 923 | | |
841 | 924 | | |
| |||
1395 | 1478 | | |
1396 | 1479 | | |
1397 | 1480 | | |
1398 | | - | |
| 1481 | + | |
1399 | 1482 | | |
1400 | 1483 | | |
| 1484 | + | |
1401 | 1485 | | |
1402 | 1486 | | |
1403 | 1487 | | |
| |||
1452 | 1536 | | |
1453 | 1537 | | |
1454 | 1538 | | |
| 1539 | + | |
1455 | 1540 | | |
1456 | 1541 | | |
1457 | 1542 | | |
| |||
1505 | 1590 | | |
1506 | 1591 | | |
1507 | 1592 | | |
| 1593 | + | |
1508 | 1594 | | |
1509 | 1595 | | |
1510 | 1596 | | |
| |||
1515 | 1601 | | |
1516 | 1602 | | |
1517 | 1603 | | |
1518 | | - | |
| 1604 | + | |
1519 | 1605 | | |
1520 | 1606 | | |
1521 | 1607 | | |
1522 | | - | |
| 1608 | + | |
1523 | 1609 | | |
1524 | 1610 | | |
1525 | 1611 | | |
| |||
1575 | 1661 | | |
1576 | 1662 | | |
1577 | 1663 | | |
| 1664 | + | |
1578 | 1665 | | |
1579 | 1666 | | |
1580 | 1667 | | |
1581 | 1668 | | |
1582 | 1669 | | |
1583 | 1670 | | |
1584 | 1671 | | |
| 1672 | + | |
| 1673 | + | |
1585 | 1674 | | |
1586 | 1675 | | |
1587 | 1676 | | |
| |||
1593 | 1682 | | |
1594 | 1683 | | |
1595 | 1684 | | |
1596 | | - | |
| 1685 | + | |
1597 | 1686 | | |
1598 | 1687 | | |
1599 | 1688 | | |
| |||
1602 | 1691 | | |
1603 | 1692 | | |
1604 | 1693 | | |
| 1694 | + | |
1605 | 1695 | | |
1606 | 1696 | | |
1607 | 1697 | | |
| |||
1617 | 1707 | | |
1618 | 1708 | | |
1619 | 1709 | | |
| 1710 | + | |
1620 | 1711 | | |
1621 | 1712 | | |
1622 | 1713 | | |
| |||
1625 | 1716 | | |
1626 | 1717 | | |
1627 | 1718 | | |
| 1719 | + | |
1628 | 1720 | | |
1629 | 1721 | | |
1630 | 1722 | | |
| |||
1638 | 1730 | | |
1639 | 1731 | | |
1640 | 1732 | | |
1641 | | - | |
| 1733 | + | |
1642 | 1734 | | |
1643 | 1735 | | |
1644 | 1736 | | |
| |||
2438 | 2530 | | |
2439 | 2531 | | |
2440 | 2532 | | |
| 2533 | + | |
| 2534 | + | |
2441 | 2535 | | |
2442 | 2536 | | |
2443 | 2537 | | |
| |||
2449 | 2543 | | |
2450 | 2544 | | |
2451 | 2545 | | |
| 2546 | + | |
2452 | 2547 | | |
2453 | 2548 | | |
2454 | 2549 | | |
| |||
2474 | 2569 | | |
2475 | 2570 | | |
2476 | 2571 | | |
| 2572 | + | |
2477 | 2573 | | |
2478 | 2574 | | |
2479 | 2575 | | |
| |||
0 commit comments