@stacksjs/defaults 0.75.489 → 0.75.490

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/ai/skills/stacks-actions/SKILL.md +1 -1
  2. package/ai/skills/stacks-dashboard/SKILL.md +20 -2
  3. package/ai/skills/stacks-native/CATALOG.md +9 -9
  4. package/ai/skills/stacks-search-engine/SKILL.md +14 -0
  5. package/app/Actions/Dashboard/Commerce/CommerceCategoriesAction.ts +7 -13
  6. package/app/Actions/Dashboard/Commerce/CommerceCustomerChoicesAction.ts +34 -0
  7. package/app/Actions/Dashboard/Commerce/CommerceDeliveryAction.ts +7 -16
  8. package/app/Actions/Dashboard/Commerce/CommerceGiftCardsAction.ts +21 -15
  9. package/app/Actions/Dashboard/Commerce/CommerceGiftCardsExportAction.ts +41 -0
  10. package/app/Actions/Dashboard/Commerce/CommerceOrderCustomersAction.ts +37 -0
  11. package/app/Actions/Dashboard/Commerce/CommerceOrdersAction.ts +26 -41
  12. package/app/Actions/Dashboard/Commerce/CommerceOrdersExportAction.ts +43 -0
  13. package/app/Actions/Dashboard/Commerce/CommercePaymentsAction.ts +24 -21
  14. package/app/Actions/Dashboard/Commerce/CommercePaymentsExportAction.ts +41 -0
  15. package/app/Actions/Dashboard/Commerce/CommercePosAction.ts +18 -48
  16. package/app/Actions/Dashboard/Commerce/CommercePosProductsAction.ts +39 -0
  17. package/app/Actions/Dashboard/Commerce/CommercePrintLogsAction.ts +14 -104
  18. package/app/Actions/Dashboard/Commerce/CommercePrintLogsExportAction.ts +41 -0
  19. package/app/Actions/Dashboard/Commerce/CommerceProductChoicesAction.ts +32 -0
  20. package/app/Actions/Dashboard/Commerce/CommerceProductsAction.ts +24 -43
  21. package/app/Actions/Dashboard/Commerce/CommerceProductsExportAction.ts +44 -0
  22. package/app/Actions/Dashboard/Commerce/CourierIndexAction.ts +3 -1
  23. package/app/Actions/Dashboard/Commerce/DeliveryRouteIndexAction.ts +23 -12
  24. package/app/Actions/Dashboard/Commerce/DigitalDeliveryIndexAction.ts +3 -1
  25. package/app/Actions/Dashboard/Commerce/LicenseKeyIndexAction.ts +24 -23
  26. package/app/Actions/Dashboard/Commerce/LicenseKeyOptionsAction.ts +35 -16
  27. package/app/Actions/Dashboard/Commerce/ProductWaitlistIndexAction.ts +22 -22
  28. package/app/Actions/Dashboard/Commerce/RestaurantWaitlistIndexAction.ts +22 -17
  29. package/app/Actions/Dashboard/Commerce/ReviewIndexAction.ts +22 -31
  30. package/app/Actions/Dashboard/Commerce/ShippingMethodIndexAction.ts +3 -1
  31. package/app/Actions/Dashboard/Commerce/ShippingRateIndexAction.ts +3 -1
  32. package/app/Actions/Dashboard/Commerce/ShippingZoneIndexAction.ts +3 -1
  33. package/app/Actions/Dashboard/Commerce/commerce-category-list.test.ts +100 -0
  34. package/app/Actions/Dashboard/Commerce/commerce-category-list.ts +26 -0
  35. package/app/Actions/Dashboard/Commerce/commerce-choice-records.ts +56 -0
  36. package/app/Actions/Dashboard/Commerce/commerce-choices.test.ts +88 -0
  37. package/app/Actions/Dashboard/Commerce/commerce-choices.ts +70 -0
  38. package/app/Actions/Dashboard/Commerce/commerce-delivery-overview.test.ts +151 -0
  39. package/app/Actions/Dashboard/Commerce/commerce-delivery-overview.ts +85 -0
  40. package/app/Actions/Dashboard/Commerce/commerce-delivery-route-list.test.ts +153 -0
  41. package/app/Actions/Dashboard/Commerce/commerce-delivery-route-list.ts +180 -0
  42. package/app/Actions/Dashboard/Commerce/commerce-delivery.ts +24 -9
  43. package/app/Actions/Dashboard/Commerce/commerce-gift-card-list.test.ts +221 -0
  44. package/app/Actions/Dashboard/Commerce/commerce-gift-card-list.ts +259 -0
  45. package/app/Actions/Dashboard/Commerce/commerce-license-key-list.test.ts +184 -0
  46. package/app/Actions/Dashboard/Commerce/commerce-license-key-list.ts +217 -0
  47. package/app/Actions/Dashboard/Commerce/commerce-order-list.test.ts +183 -0
  48. package/app/Actions/Dashboard/Commerce/commerce-order-list.ts +278 -0
  49. package/app/Actions/Dashboard/Commerce/commerce-order-records.test.ts +29 -0
  50. package/app/Actions/Dashboard/Commerce/commerce-payment-list.test.ts +180 -0
  51. package/app/Actions/Dashboard/Commerce/commerce-payment-list.ts +272 -0
  52. package/app/Actions/Dashboard/Commerce/commerce-pos-catalog.test.ts +171 -0
  53. package/app/Actions/Dashboard/Commerce/commerce-pos-catalog.ts +152 -0
  54. package/app/Actions/Dashboard/Commerce/commerce-pos.test.ts +1 -12
  55. package/app/Actions/Dashboard/Commerce/commerce-pos.ts +0 -26
  56. package/app/Actions/Dashboard/Commerce/commerce-print-log-list.test.ts +202 -0
  57. package/app/Actions/Dashboard/Commerce/commerce-print-log-list.ts +286 -0
  58. package/app/Actions/Dashboard/Commerce/commerce-product-list.test.ts +174 -0
  59. package/app/Actions/Dashboard/Commerce/commerce-product-list.ts +276 -0
  60. package/app/Actions/Dashboard/Commerce/commerce-product-waitlist-list.test.ts +183 -0
  61. package/app/Actions/Dashboard/Commerce/commerce-product-waitlist-list.ts +170 -0
  62. package/app/Actions/Dashboard/Commerce/commerce-record.ts +21 -0
  63. package/app/Actions/Dashboard/Commerce/commerce-restaurant-waitlist-list.test.ts +189 -0
  64. package/app/Actions/Dashboard/Commerce/commerce-restaurant-waitlist-list.ts +177 -0
  65. package/app/Actions/Dashboard/Commerce/commerce-review-list.test.ts +193 -0
  66. package/app/Actions/Dashboard/Commerce/commerce-review-list.ts +220 -0
  67. package/app/Actions/Dashboard/Commerce/commerce-sql.ts +57 -0
  68. package/app/Actions/Dashboard/Commerce/payment-records.test.ts +16 -0
  69. package/app/Actions/Dashboard/Commerce/product-waitlist-records.test.ts +6 -5
  70. package/app/Actions/Dashboard/Commerce/product-waitlist-records.ts +16 -45
  71. package/app/Actions/Dashboard/Commerce/restaurant-waitlist-records.ts +4 -24
  72. package/app/Actions/Dashboard/Content/content-list.ts +10 -0
  73. package/app/Actions/Dashboard/Content/file-listing-metadata.test.ts +46 -0
  74. package/app/Actions/Dashboard/Content/file-manager.ts +51 -10
  75. package/app/Actions/Dashboard/DashboardHomeAction.test.ts +13 -9
  76. package/app/Actions/Dashboard/DashboardHomeAction.ts +42 -21
  77. package/app/Actions/Dashboard/Jobs/JobStatsAction.ts +5 -2
  78. package/app/Actions/Dashboard/Kanban/UsersListAction.ts +13 -9
  79. package/app/Actions/Dashboard/Kanban/kanban-response.test.ts +40 -0
  80. package/app/Actions/Dashboard/Kanban/kanban-response.ts +53 -1
  81. package/app/Actions/Dashboard/Kanban/kanban-users.test.ts +114 -0
  82. package/app/Actions/Dashboard/Kanban/kanban-users.ts +32 -0
  83. package/app/Actions/Dashboard/Models/ModelShowAction.ts +8 -0
  84. package/app/Actions/Dashboard/Models/ModelsIndexAction.ts +16 -2
  85. package/app/Actions/Dashboard/Models/model-migration.test.ts +27 -0
  86. package/app/Actions/Dashboard/Models/model-migration.ts +23 -0
  87. package/app/Actions/Dashboard/Queue/QueueStatsAction.ts +5 -3
  88. package/app/Actions/Dashboard/Queue/QueueWorkersAction.ts +3 -2
  89. package/app/Actions/Dashboard/Queue/worker-snapshots.test.ts +31 -0
  90. package/app/Actions/Dashboard/Queue/worker-snapshots.ts +33 -0
  91. package/app/Actions/Dashboard/named-search.test.ts +36 -0
  92. package/app/Actions/Dashboard/named-search.ts +80 -0
  93. package/app/Models/Request.ts +4 -2
  94. package/functions/commerce/shippings/dashboard-resource.ts +12 -1
  95. package/functions/commerce/shippings/delivery-routes.ts +1 -0
  96. package/functions/commerce/shippings/license-keys.ts +1 -0
  97. package/functions/dashboard-list.test.ts +132 -1
  98. package/functions/dashboard-list.ts +198 -1
  99. package/functions/queue.ts +2 -0
  100. package/ide/vscode/package.json +1 -1
  101. package/package.json +2 -2
  102. package/resources/components/Dashboard/Commerce/CommerceGiftCardBreakdown.stx +38 -12
  103. package/resources/components/Dashboard/Commerce/CommerceGiftCardsDashboard.stx +122 -68
  104. package/resources/components/Dashboard/Commerce/CommerceGiftCardsTable.stx +29 -6
  105. package/resources/components/Dashboard/Commerce/CommerceOrderDialog.stx +59 -2
  106. package/resources/components/Dashboard/Commerce/CommerceOrdersDashboard.stx +126 -80
  107. package/resources/components/Dashboard/Commerce/CommerceOrdersTable.stx +28 -3
  108. package/resources/components/Dashboard/Commerce/CommercePaymentsBreakdown.stx +12 -29
  109. package/resources/components/Dashboard/Commerce/CommercePaymentsDashboard.stx +139 -60
  110. package/resources/components/Dashboard/Commerce/CommercePaymentsTable.stx +27 -2
  111. package/resources/components/Dashboard/Commerce/CommercePosCatalog.stx +17 -1
  112. package/resources/components/Dashboard/Commerce/CommercePosCheckoutDialog.stx +47 -3
  113. package/resources/components/Dashboard/Commerce/CommercePosDashboard.stx +59 -49
  114. package/resources/components/Dashboard/Commerce/CommerceProductsDashboard.stx +116 -82
  115. package/resources/components/Dashboard/Commerce/CommerceProductsTable.stx +28 -4
  116. package/resources/components/Dashboard/Commerce/CommerceReviewsDashboard.stx +120 -69
  117. package/resources/components/Dashboard/Commerce/CommerceReviewsTable.stx +29 -6
  118. package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesDashboard.stx +79 -52
  119. package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesTable.stx +31 -8
  120. package/resources/components/Dashboard/Commerce/Delivery/LicenseKeyDialog.stx +71 -13
  121. package/resources/components/Dashboard/Commerce/Delivery/LicenseKeysDashboard.stx +69 -81
  122. package/resources/components/Dashboard/Commerce/Delivery/LicenseKeysTable.stx +31 -8
  123. package/resources/components/Dashboard/Commerce/PrintLogBreakdown.stx +21 -17
  124. package/resources/components/Dashboard/Commerce/PrintLogsDashboard.stx +23 -22
  125. package/resources/components/Dashboard/Commerce/ProductWaitlistDashboard.stx +116 -20
  126. package/resources/components/Dashboard/Commerce/ProductWaitlistEntryDialog.stx +100 -12
  127. package/resources/components/Dashboard/Commerce/ProductWaitlistTable.stx +34 -16
  128. package/resources/components/Dashboard/Commerce/RestaurantWaitlistDashboard.stx +107 -19
  129. package/resources/components/Dashboard/Commerce/RestaurantWaitlistEntryDialog.stx +65 -6
  130. package/resources/components/Dashboard/Commerce/RestaurantWaitlistTable.stx +29 -3
  131. package/resources/components/Dashboard/Kanban/KanbanBoardsDashboard.stx +10 -1
  132. package/resources/components/Dashboard/Kanban/KanbanCardDialog.stx +21 -1
  133. package/resources/components/Dashboard/Models/ModelRecordsDashboard.stx +24 -4
  134. package/resources/components/Dashboard/Models/ModelsOverview.stx +13 -2
  135. package/resources/components/Dashboard/Queue/QueueDashboard.stx +7 -1
  136. package/routes/dashboard-api.ts +11 -0
  137. package/views/dashboard/stores/kanban.ts +38 -6
@@ -11,6 +11,7 @@ interface ModelRow {
11
11
  source: 'userland' | 'framework'
12
12
  apiUri: string
13
13
  apiRoutes: string[]
14
+ migrated?: boolean
14
15
  error: string | null
15
16
  }
16
17
 
@@ -26,6 +27,7 @@ interface ModelsResponse {
26
27
  totalRecords: number
27
28
  userlandCount: number
28
29
  unavailableModels: number
30
+ unmigratedModels?: number
29
31
  categoryGroups: ModelGroup[]
30
32
  }
31
33
 
@@ -35,6 +37,7 @@ const totalModels = state(0)
35
37
  const totalRecords = state(0)
36
38
  const userlandCount = state(0)
37
39
  const unavailableModels = state(0)
40
+ const unmigratedModels = state(0)
38
41
  const categoryGroups = state<ModelGroup[]>([])
39
42
  const loading = state(true)
40
43
  const loadError = state('')
@@ -78,6 +81,7 @@ async function loadModels(): Promise<void> {
78
81
  totalRecords.set(response.totalRecords || 0)
79
82
  userlandCount.set(response.userlandCount || 0)
80
83
  unavailableModels.set(response.unavailableModels || 0)
84
+ unmigratedModels.set(response.unmigratedModels || 0)
81
85
  categoryGroups.set(response.categoryGroups || [])
82
86
  }
83
87
  catch (error) {
@@ -85,6 +89,7 @@ async function loadModels(): Promise<void> {
85
89
  totalRecords.set(0)
86
90
  userlandCount.set(0)
87
91
  unavailableModels.set(0)
92
+ unmigratedModels.set(0)
88
93
  categoryGroups.set([])
89
94
  loadError.set(error instanceof Error ? error.message : 'Models could not be loaded.')
90
95
  }
@@ -98,7 +103,7 @@ onMount(() => {
98
103
  })
99
104
  </script>
100
105
 
101
- <div class="space-y-6">
106
+ <div class="flex flex-col gap-6">
102
107
  <header class="flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between">
103
108
  <div>
104
109
  <h1 class="font-semibold text-2xl text-neutral-900 tracking-tight dark:text-white">{{ title() }}</h1>
@@ -132,6 +137,11 @@ onMount(() => {
132
137
  <span>{{ unavailableModels() }} model {{ unavailableModels() === 1 ? 'count is' : 'counts are' }} unavailable. Affected cards remain unavailable instead of reporting zero records.</span>
133
138
  </div>
134
139
 
140
+ <div :if="!loadError() && unmigratedModels() > 0" role="status" class="flex gap-3 items-start px-4 py-3 text-neutral-700 text-sm dark:text-neutral-200 bg-neutral-50 dark:bg-neutral-800/60 border border-neutral-200 rounded-lg dark:border-neutral-700">
141
+ <span aria-hidden="true" class="flex-none mt-0.5 h-4 w-4 i-hugeicons-database-sync-01"></span>
142
+ <span>{{ unmigratedModels() }} {{ unmigratedModels() === 1 ? 'model has' : 'models have' }} no table yet. Run <code>./buddy migrate</code> to create {{ unmigratedModels() === 1 ? 'it' : 'them' }}.</span>
143
+ </div>
144
+
135
145
  <Card padding="none">
136
146
  <div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between p-5 border-b border-neutral-200 dark:border-neutral-700">
137
147
  <div>
@@ -191,7 +201,8 @@ onMount(() => {
191
201
  <div>
192
202
  <dt class="text-neutral-500 text-xs dark:text-neutral-400">Records</dt>
193
203
  <dd :if="model.count !== null" class="mt-1 font-medium text-neutral-900 text-sm dark:text-white">{{ model.count.toLocaleString() }}</dd>
194
- <dd :if="model.count === null" class="mt-1 font-medium text-amber-700 text-sm dark:text-amber-300">Unavailable</dd>
204
+ <dd :if="model.count === null && model.migrated !== false" class="mt-1 font-medium text-amber-700 text-sm dark:text-amber-300">Unavailable</dd>
205
+ <dd :if="model.migrated === false" class="mt-1 font-medium text-neutral-500 text-sm dark:text-neutral-400">Not migrated</dd>
195
206
  </div>
196
207
  <div>
197
208
  <dt class="text-neutral-500 text-xs dark:text-neutral-400">Attributes</dt>
@@ -11,6 +11,7 @@ const stats = state<QueueAggregateStats | null>(null)
11
11
  const queueConnected = state(false)
12
12
  const workerRunning = state(false)
13
13
  const activeWorkerJobs = state(0)
14
+ const workersMigrated = state(true)
14
15
  const isLoading = state(true)
15
16
  const isRetrying = state(false)
16
17
  const loadError = state('')
@@ -63,6 +64,7 @@ async function loadQueue(): Promise<void> {
63
64
  workers.set(workerData.data)
64
65
  workerRunning.set(workerData.worker_running)
65
66
  activeWorkerJobs.set(workerData.active_jobs)
67
+ workersMigrated.set(workerData.workers_migrated !== false)
66
68
  }
67
69
  catch (error) {
68
70
  loadError.set('Queue data could not be loaded.')
@@ -159,7 +161,11 @@ onMount(() => {
159
161
  Retry failed jobs
160
162
  </Button>
161
163
  </div>
162
- <div :if="!isLoading() && workerRows().length === 0" class="px-5 py-12 text-center">
164
+ <div :if="!isLoading() && !workersMigrated()" role="status" class="px-5 py-12 text-center">
165
+ <p class="font-semibold text-gray-900 dark:text-white">Worker telemetry is not set up yet</p>
166
+ <p class="mt-1 text-gray-500 text-sm dark:text-neutral-400">Workers report here through the <code>queue_workers</code> table. Run <code>./buddy migrate</code> to create it.</p>
167
+ </div>
168
+ <div :if="!isLoading() && workersMigrated() && workerRows().length === 0" class="px-5 py-12 text-center">
163
169
  <p class="font-semibold text-gray-900 dark:text-white">No workers tracked in this process</p>
164
170
  <p class="mt-1 text-gray-500 text-sm dark:text-neutral-400">Start a queue worker to populate heartbeat and processing metrics.</p>
165
171
  </div>
@@ -107,6 +107,9 @@ route.group({ prefix: '/api/dashboard', apiResponse: true }, () => {
107
107
  guard(route.get('/library/components', 'Actions/Dashboard/Library/GetComponents'))
108
108
  guard(route.post('/library/components', 'Actions/Dashboard/Library/CreateComponent'))
109
109
  if (feature('commerce')) {
110
+ // The products and customers the waitlist dialogs offer, searched (commerce-choices.ts).
111
+ guard(route.get('/commerce/product-choices', 'Actions/Dashboard/Commerce/CommerceProductChoicesAction'))
112
+ guard(route.get('/commerce/customer-choices', 'Actions/Dashboard/Commerce/CommerceCustomerChoicesAction'))
110
113
  guard(route.get('/commerce/waitlist-products', 'Actions/Dashboard/Commerce/ProductWaitlistIndexAction'))
111
114
  guard(route.post('/commerce/waitlist-products', 'Actions/Commerce/WaitlistProductStoreAction'))
112
115
  guard(route.patch('/commerce/waitlist-products/{id}', 'Actions/Commerce/WaitlistProductUpdateAction'))
@@ -123,6 +126,7 @@ route.group({ prefix: '/api/dashboard', apiResponse: true }, () => {
123
126
  guard(route.patch('/commerce/coupons/{id}', 'Actions/Commerce/CouponUpdateAction'))
124
127
  guard(route.delete('/commerce/coupons/{id}', 'Actions/Commerce/CouponDestroyAction'))
125
128
  guard(route.get('/commerce/gift-cards', 'Actions/Dashboard/Commerce/CommerceGiftCardsAction'))
129
+ guard(route.get('/commerce/gift-cards/export', 'Actions/Dashboard/Commerce/CommerceGiftCardsExportAction'))
126
130
  guard(route.post('/commerce/gift-cards', 'Actions/Commerce/GiftCardStoreAction'))
127
131
  guard(route.patch('/commerce/gift-cards/{id}', 'Actions/Commerce/GiftCardUpdateAction'))
128
132
  guard(route.delete('/commerce/gift-cards/{id}', 'Actions/Commerce/GiftCardDestroyAction'))
@@ -135,12 +139,17 @@ route.group({ prefix: '/api/dashboard', apiResponse: true }, () => {
135
139
  guard(route.patch('/commerce/customers/{id}', 'Actions/Commerce/CustomerUpdateAction'))
136
140
  guard(route.delete('/commerce/customers/{id}', 'Actions/Commerce/CustomerDestroyAction'))
137
141
  guard(route.get('/commerce/orders', 'Actions/Dashboard/Commerce/CommerceOrdersAction'))
142
+ guard(route.get('/commerce/orders/export', 'Actions/Dashboard/Commerce/CommerceOrdersExportAction'))
143
+ guard(route.get('/commerce/orders/customers', 'Actions/Dashboard/Commerce/CommerceOrderCustomersAction'))
138
144
  guard(route.post('/commerce/orders', 'Actions/Commerce/OrderStoreAction'))
139
145
  guard(route.patch('/commerce/orders/{id}', 'Actions/Commerce/OrderUpdateAction'))
140
146
  guard(route.delete('/commerce/orders/{id}', 'Actions/Commerce/OrderDestroyAction'))
141
147
  guard(route.get('/commerce/pos', 'Actions/Dashboard/Commerce/CommercePosAction'))
148
+ guard(route.get('/commerce/pos/products', 'Actions/Dashboard/Commerce/CommercePosProductsAction'))
142
149
  guard(route.post('/commerce/pos/checkout', 'Actions/Dashboard/Commerce/CommercePosCheckoutAction'))
143
150
  guard(route.get('/commerce/products', 'Actions/Dashboard/Commerce/CommerceProductsAction'))
151
+ // Before `{id}`, so "export" is never read as a product id.
152
+ guard(route.get('/commerce/products/export', 'Actions/Dashboard/Commerce/CommerceProductsExportAction'))
144
153
  guard(route.get('/commerce/products/{id}', 'Actions/Dashboard/Commerce/CommerceProductDetailAction'))
145
154
  guard(route.post('/commerce/products', 'Actions/Commerce/Product/ProductStoreAction'))
146
155
  guard(route.patch('/commerce/products/{id}', 'Actions/Commerce/Product/ProductUpdateAction'))
@@ -164,12 +173,14 @@ route.group({ prefix: '/api/dashboard', apiResponse: true }, () => {
164
173
  guard(route.patch('/commerce/variants/{id}', 'Actions/Commerce/Product/ProductVariantUpdateAction'))
165
174
  guard(route.delete('/commerce/variants/{id}', 'Actions/Commerce/Product/ProductVariantDestroyAction'))
166
175
  guard(route.get('/commerce/payments', 'Actions/Dashboard/Commerce/CommercePaymentsAction'))
176
+ guard(route.get('/commerce/payments/export', 'Actions/Dashboard/Commerce/CommercePaymentsExportAction'))
167
177
  guard(route.post('/commerce/payments/{id}/refund', 'Actions/Dashboard/Commerce/PaymentRefundAction'))
168
178
  guard(route.get('/commerce/print-devices', 'Actions/Dashboard/Commerce/CommercePrintDevicesAction'))
169
179
  guard(route.post('/commerce/print-devices', 'Actions/Commerce/PrintDeviceStoreAction'))
170
180
  guard(route.patch('/commerce/print-devices/{id}', 'Actions/Commerce/PrintDeviceUpdateAction'))
171
181
  guard(route.delete('/commerce/print-devices/{id}', 'Actions/Commerce/PrintDeviceDestroyAction'))
172
182
  guard(route.get('/commerce/print-logs', 'Actions/Dashboard/Commerce/CommercePrintLogsAction'))
183
+ guard(route.get('/commerce/print-logs/export', 'Actions/Dashboard/Commerce/CommercePrintLogsExportAction'))
173
184
  guard(route.delete('/commerce/print-logs/{id}', 'Actions/Commerce/ReceiptDestroyAction'))
174
185
  }
175
186
  guard(route.get('/deployments', 'Actions/Dashboard/Deployments/GetDeployments'))
@@ -126,6 +126,10 @@ export const kanbanStore = defineStore('kanban', () => {
126
126
  const loading = state(true)
127
127
  const loadingBoard = state(false)
128
128
  const error = state<string | null>(null)
129
+ // Why the last board delete failed. Kept apart from `error`, which means the
130
+ // board list could not load: a failed delete used to replace the whole list
131
+ // with "Couldn't load boards" (stacksjs/stacks#3217).
132
+ const deleteError = state<string | null>(null)
129
133
  const errorBoard = state<string | null>(null)
130
134
 
131
135
  // Card detail modal state. Holding card + comments here
@@ -137,8 +141,13 @@ export const kanbanStore = defineStore('kanban', () => {
137
141
  const openCard = state<CardDetail | null>(null)
138
142
  const loadingCard = state(false)
139
143
  const errorCard = state<string | null>(null)
144
+ // The assignee picker's users: one bounded page of a server-side search
145
+ // (stacksjs/stacks#3216), and how many users matched it.
140
146
  const users = state<UserSummary[]>([])
147
+ const usersTotal = state(0)
148
+ const userSearch = state('')
141
149
  const loadingUsers = state(false)
150
+ let usersRequest = 0
142
151
 
143
152
  const hasBoards = derived(() => boards().length > 0)
144
153
 
@@ -224,6 +233,7 @@ export const kanbanStore = defineStore('kanban', () => {
224
233
 
225
234
  async function deleteBoard(id: number): Promise<boolean> {
226
235
  const snapshot = boards()
236
+ deleteError.set(null)
227
237
  // Optimistic remove.
228
238
  boards.set(snapshot.filter(b => b.id !== id))
229
239
  try {
@@ -232,7 +242,7 @@ export const kanbanStore = defineStore('kanban', () => {
232
242
  }
233
243
  catch (e) {
234
244
  boards.set(snapshot)
235
- error.set(e instanceof Error ? e.message : String(e))
245
+ deleteError.set(e instanceof Error ? e.message : String(e))
236
246
  return false
237
247
  }
238
248
  }
@@ -491,18 +501,37 @@ export const kanbanStore = defineStore('kanban', () => {
491
501
  }
492
502
  }
493
503
 
494
- async function loadUsers(): Promise<void> {
495
- if (loadingUsers() || users().length > 0) return
504
+ /**
505
+ * The users matching `search` (name or email, ignoring case), newest request
506
+ * wins. It used to load the first 500 by name once and never search, so
507
+ * anyone past the 500th could not be assigned.
508
+ */
509
+ async function loadUsers(search = ''): Promise<void> {
510
+ const term = search.trim()
511
+ userSearch.set(term)
512
+ const request = ++usersRequest
496
513
  loadingUsers.set(true)
497
514
  try {
498
- const data = await dashboardApi<{ users?: UserSummary[] }>('/api/dashboard/kanban/users')
515
+ const params = new URLSearchParams()
516
+ if (term)
517
+ params.set('q', term)
518
+ const suffix = params.toString()
519
+ const data = await dashboardApi<{ users?: UserSummary[], total?: number }>(`/api/dashboard/kanban/users${suffix ? `?${suffix}` : ''}`)
520
+ if (request !== usersRequest)
521
+ return
499
522
  users.set(data.users ?? [])
523
+ usersTotal.set(data.total ?? (data.users?.length ?? 0))
500
524
  }
501
525
  catch {
502
- // Soft-fail — assignee picker just shows empty.
526
+ // Soft-fail: the picker shows no users rather than an error.
527
+ if (request === usersRequest) {
528
+ users.set([])
529
+ usersTotal.set(0)
530
+ }
503
531
  }
504
532
  finally {
505
- loadingUsers.set(false)
533
+ if (request === usersRequest)
534
+ loadingUsers.set(false)
506
535
  }
507
536
  }
508
537
 
@@ -700,6 +729,7 @@ export const kanbanStore = defineStore('kanban', () => {
700
729
  loading,
701
730
  loadingBoard,
702
731
  error,
732
+ deleteError,
703
733
  errorBoard,
704
734
  hasBoards,
705
735
  loadBoards,
@@ -717,6 +747,8 @@ export const kanbanStore = defineStore('kanban', () => {
717
747
  loadingCard,
718
748
  errorCard,
719
749
  users,
750
+ usersTotal,
751
+ userSearch,
720
752
  loadingUsers,
721
753
  openCardDetail,
722
754
  closeCardDetail,