Repository navigation
Commit 9fd1aac
committed
feat(showcase): add the object-less (global) action specimen
#3913 and its follow-up (#4005) fixed object-less action dispatch and the
empty-object-segment route with no live specimen to exercise either. The
showcase is the "one specimen of everything" app, yet every action in it
declared an `objectName` — so the `global` engine key, and both object-less
URL shapes, had nothing in-app that actually ran through them. #4005 could
only verify routing end to end; a real dispatch was never observed.
`showcase_portfolio_snapshot` closes that. It declares no `objectName`, so
`ObjectQLPlugin.actionObjectKey` / AppPlugin's `action.object || 'global'`
key it at `global`, and it is reachable at both shapes. The body is
genuinely object-less — it counts across three objects, so there is no
single record or object it could sensibly hang off — and `locations` is
`global_nav` for the same reason.
Verified live against the running showcase; both URL shapes return
byte-identical single-wrapped results:
POST /api/v1/actions/global/showcase_portfolio_snapshot
POST /api/v1/actions//showcase_portfolio_snapshot
-> 200 {"success":true,"data":{"ok":true,"scope":"global",
"accounts":15,"projects":5,"invoices":13}}
That is the first live confirmation of all three fixes in this arc acting
together: the canonical `global` key (#3913), the empty-segment route
(#4005), and single-wrap success (#3962).
Two tests pin the specimen in `test/actions.test.ts`, next to the #2169
executability cases. The first is the one that matters: adding an
`objectName` to this action would still build, still pass coverage.test.ts,
and still work — while silently removing the app's only coverage of
object-less dispatch. It asserts the action declares neither `objectName`
nor `object`, and that it remains the only such action. Confirmed the guard
fails when an `objectName` is added.
Showcase build green (Actions 10 -> 11), 60 tests pass, typecheck and
eslint clean. Example package is private, so the changeset releases nothing.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011AvZj6cLX7APd7roh2eK4F1 parent 0c90ece commit 9fd1aac
4 files changed
Lines changed: 130 additions & 2 deletions
File tree
- .changeset
- examples/app-showcase
- src
- ui/actions
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 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 | + | |
| 325 | + | |
| 326 | + | |
278 | 327 | | |
279 | 328 | | |
280 | 329 | | |
| |||
286 | 335 | | |
287 | 336 | | |
288 | 337 | | |
| 338 | + | |
289 | 339 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
84 | 84 | | |
85 | 85 | | |
86 | 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 | + | |
0 commit comments