Commit 9624316
committed
fix(web): carry multi-skill compose list through Home auto-send (#6333 review)
PR #6333 added a multi-skill `@skill-a @skill-b` compose flow on the
Home page by introducing a `skillIds` array alongside the existing
primary `skillId` on the project-create payload. The array was
correctly forwarded to `POST /api/projects`, but the Home auto-send
hand-off persisted only prompt / attachments / context in
sessionStorage — when `ProjectView` later fired the first
`handleSend(...)`, the auto-send tail never supplied
`meta.skillIds`, so `streamViaDaemon` launched the first run with
only `project.skillId` and silently dropped the extra composed
skills (#5824 continued to bite the main user flow).
Changes:
- `apps/web/src/App.tsx`: stash the caller-supplied `input.skillIds`
in a dedicated `od:auto-send-skillIds:<projectId>` sessionStorage
key alongside the existing auto-send hand-off keys; cleared
symmetrically when the array is absent so a stale list from a
cancelled create can't leak into the next project.
- `apps/web/src/components/ProjectView.tsx`:
- new `autoSendSkillIdsKey` helper + `readAutoSendSkillIds` reader
(reuses the existing `isStoredStringArray` validator);
- new `autoSendSkillIdsRef` captured at the same mount-time read as
the other auto-send refs;
- the auto-send effect now puts the array back into
`meta.skillIds` on the first `handleSend(...)` call so the
daemon stream receives the full compose list;
- `clearAutoSendSession` also wipes the new key (reload after
run start never re- fires with a stale skill set).
- `apps/web/tests/components/ProjectView.run-cleanup.test.tsx`:
regression test asserting the Home-staged multi-skill list reaches
the first `streamViaDaemon` call as `skillIds: ['deck-builder',
'pdf-designer']` while the primary `skillId` stays on
`project.skillId`, and that the auto-send session flag clears
afterwards.
All 66 cases in `ProjectView.run-cleanup.test.tsx` and all 22 cases
in `ProjectView.pendingPrompt.test.tsx` pass.
Signed-off-by: xxiaoxiong <2482929840@qq.com>1 parent 1f1979c commit 9624316
3 files changed
Lines changed: 128 additions & 0 deletions
File tree
- apps/web
- src
- components
- tests/components
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1720 | 1720 | | |
1721 | 1721 | | |
1722 | 1722 | | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
1723 | 1740 | | |
1724 | 1741 | | |
1725 | 1742 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
817 | 817 | | |
818 | 818 | | |
819 | 819 | | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
820 | 832 | | |
821 | 833 | | |
822 | 834 | | |
| |||
852 | 864 | | |
853 | 865 | | |
854 | 866 | | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
855 | 880 | | |
856 | 881 | | |
857 | 882 | | |
858 | 883 | | |
859 | 884 | | |
860 | 885 | | |
861 | 886 | | |
| 887 | + | |
862 | 888 | | |
863 | 889 | | |
864 | 890 | | |
| |||
7741 | 7767 | | |
7742 | 7768 | | |
7743 | 7769 | | |
| 7770 | + | |
7744 | 7771 | | |
7745 | 7772 | | |
7746 | 7773 | | |
| |||
7761 | 7788 | | |
7762 | 7789 | | |
7763 | 7790 | | |
| 7791 | + | |
7764 | 7792 | | |
7765 | 7793 | | |
7766 | 7794 | | |
| |||
8410 | 8438 | | |
8411 | 8439 | | |
8412 | 8440 | | |
| 8441 | + | |
8413 | 8442 | | |
| 8443 | + | |
8414 | 8444 | | |
8415 | 8445 | | |
8416 | 8446 | | |
8417 | 8447 | | |
8418 | 8448 | | |
| 8449 | + | |
8419 | 8450 | | |
8420 | 8451 | | |
8421 | 8452 | | |
| |||
Lines changed: 80 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1399 | 1399 | | |
1400 | 1400 | | |
1401 | 1401 | | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
1402 | 1482 | | |
1403 | 1483 | | |
1404 | 1484 | | |
| |||
0 commit comments