Repository navigation
Commit 4704aa4
fix(form): a later submit outcome supersedes this form's earlier one (#7342)
A refused submit raised an error toast that nothing ever retired, so the
confirmation of a later, successful submit of the same form appeared beside
the refusal of the earlier one — a wizard's last step showing "Invalid project
status transition." and "Your new project is ready…" at the same time.
The two toasts are raised by two different modules, which is why neither could
supersede the other on its own. The refusal comes from the form renderer in
@object-ui/components: WizardForm hands it `onSubmit: handleStepSubmit`, that
handler rethrows a rejected write, and the renderer's own catch sets the
in-form banner AND toasts. The success toast is WizardForm's.
Every outcome toast a form raises now travels under one stable per-form id:
- the renderer publishes its three outcome toasts (the field-level rejection,
an `onAction` error and a rejected write) under that id, and retires the
previous attempt's toast in the same place it already cleared the previous
attempt's in-form banner — so by the time a host can confirm a success, this
form's last refusal is gone;
- the console's FormPage publishes its confirmation and its submit failure
under one id, closing the same asymmetry in a single function.
Measured, not assumed: the refusal toast is not sticky by configuration.
ConsoleToaster sets `duration: 4000` for every severity, @object-ui/components'
own Toaster sets none (sonner's default TOAST_LIFETIME is also 4000), and
`duration: Infinity` appears nowhere on any form path. Durations are therefore
untouched — the defect is supersession, and it reproduces inside any lifetime.
Deliberately excluded: the refused redirect DESTINATION keeps its own toast.
The write succeeded there and only the declared destination is out of contract,
so that refusal has to stay readable beside the confirmation it qualifies.
Claude-Session: https://claude.ai/code/session_01NRRumy89BYdW9ogbcdHTho
Co-authored-by: Claude <noreply@anthropic.com>1 parent 35d7688 commit 4704aa4
5 files changed
Lines changed: 483 additions & 6 deletions
File tree
- .changeset
- apps/console/src/components
- packages
- components/src/renderers/form
- plugin-form/src
| 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 | + | |
Lines changed: 180 additions & 0 deletions
| 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 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 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 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
1578 | 1578 | | |
1579 | 1579 | | |
1580 | 1580 | | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
1581 | 1598 | | |
1582 | 1599 | | |
1583 | 1600 | | |
| |||
1681 | 1698 | | |
1682 | 1699 | | |
1683 | 1700 | | |
1684 | | - | |
| 1701 | + | |
1685 | 1702 | | |
1686 | 1703 | | |
1687 | 1704 | | |
| |||
1766 | 1783 | | |
1767 | 1784 | | |
1768 | 1785 | | |
1769 | | - | |
| 1786 | + | |
1770 | 1787 | | |
1771 | 1788 | | |
1772 | 1789 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1130 | 1130 | | |
1131 | 1131 | | |
1132 | 1132 | | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
1133 | 1156 | | |
1134 | 1157 | | |
1135 | 1158 | | |
| |||
1912 | 1935 | | |
1913 | 1936 | | |
1914 | 1937 | | |
1915 | | - | |
| 1938 | + | |
1916 | 1939 | | |
1917 | 1940 | | |
1918 | 1941 | | |
| |||
1948 | 1971 | | |
1949 | 1972 | | |
1950 | 1973 | | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
1951 | 1978 | | |
1952 | 1979 | | |
1953 | 1980 | | |
| |||
1999 | 2026 | | |
2000 | 2027 | | |
2001 | 2028 | | |
2002 | | - | |
| 2029 | + | |
2003 | 2030 | | |
2004 | 2031 | | |
2005 | 2032 | | |
| |||
2069 | 2096 | | |
2070 | 2097 | | |
2071 | 2098 | | |
2072 | | - | |
| 2099 | + | |
2073 | 2100 | | |
2074 | 2101 | | |
2075 | 2102 | | |
| |||
0 commit comments