Commit 766738f
fix(dashboard): batch sweep — 48 pages with rendering bugs
Five distinct categories of issues caused by inconsistent template
patterns across the dashboard. All fixed in one pass so the next
audit starts from a clean baseline:
**1. Wrong @foreach syntax (3 pages)** — `/insights`, `/logs`,
`/errors` used `@foreach(item in items)` (Vue/JS style). STX is
Laravel-style: `@foreach(items as item)`. The wrong form left the
literal `@foreach(...)` string in the rendered HTML — the user saw
template directives leaking into the page body. Converted 9
occurrences total via regex sweep.
**2. Bare `<script>` instead of `<script server>` (7 pages)** —
`/access-tokens`, `/actions`, `/buddy`, `/commands`, `/environment`,
`/releases`, `/[...all]`. STX only extracts SSR variables from
`<script server>`; bare `<script>` is treated as client-only.
Result: every `{{ }}` interpolation against a script-defined const
rendered empty, and `@foreach`/`@if` directives saw an empty
context. Converted with awk so we only flip the FIRST `<script>`
(client `<script>` blocks lower in each file are intentionally
untouched).
**3. Function references in @foreach (35 pages, ~30 occurrences)** —
The most common bug, by a wide margin. Pages that had
`function paginatedPosts()` / `function filteredOrders()` /
`function categoriesForFilter()` etc. were used as
`@foreach(paginatedPosts as post)` instead of
`@foreach(paginatedPosts() as post)`. STX iterated the function
object itself, which isn't iterable, and rendered
`[Foreach Error]: paginatedPosts is not iterable` on every page.
Affected dirs: `/commerce/{coupons,gift-cards,manufacturers,
orders,payments,pos,printers/{devices,receipts},products{,/detail},
reviews,taxes,units,variants,waitlist/{products,restaurant}}`,
`/content/{authors,categories,comments,files,posts,seo,tags}`,
`/data/{activity,dashboard}`, `/jobs/history`, `/management/permissions`,
`/marketing/{campaigns,lists,reviews,social-posts}`,
`/notifications/{email,history,sms}`, `/queries/{history,slow}`,
`/realtime`, `/inbox`. Fixed via two-pass sweep that detected
function declarations in the same file as the `@foreach` and
appended `()` to the call site.
**4. Stale 2024 hard-coded dates (`/analytics/events`)** — replaced
the pre-baked "Feb 5, 2024 to Mar 6, 2024" date-range strings
with a `formatRangeLabel(days)` helper that computes from `new
Date()` so the placeholder doesn't ship out of date.
**5. Duplicate insertion of `()` from prior foreach pass** —
several pages now have idempotent `funcName()` invocations after
the regex sweep ran across already-corrected files; rerunning the
sweep is a no-op (verified with a second pass that produced 0
changes).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 9e59815 commit 766738f
48 files changed
Lines changed: 108 additions & 88 deletions
File tree
- storage/framework/defaults/views/dashboard
- access-tokens
- actions
- analytics/events
- buddy
- commands
- commerce
- gift-cards
- manufacturers
- payments
- pos
- printers
- devices
- receipts
- products
- reviews
- taxes
- units
- variants
- waitlist
- content
- authors
- categories
- comments
- files
- posts
- seo
- tags
- data
- activity
- dashboard
- environment
- errors
- inbox
- insights
- jobs
- logs
- management/permissions
- marketing
- campaigns
- lists
- reviews
- social-posts
- notifications
- queries
- realtime
- releases
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
Lines changed: 30 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
66 | 77 | | |
67 | 78 | | |
68 | 79 | | |
| |||
346 | 357 | | |
347 | 358 | | |
348 | 359 | | |
349 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
350 | 365 | | |
351 | | - | |
| 366 | + | |
352 | 367 | | |
353 | | - | |
| 368 | + | |
354 | 369 | | |
355 | | - | |
| 370 | + | |
| 371 | + | |
356 | 372 | | |
357 | | - | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
358 | 376 | | |
359 | | - | |
| 377 | + | |
| 378 | + | |
360 | 379 | | |
361 | 380 | | |
362 | 381 | | |
363 | 382 | | |
364 | 383 | | |
365 | | - | |
| 384 | + | |
| 385 | + | |
366 | 386 | | |
367 | 387 | | |
368 | 388 | | |
| |||
641 | 661 | | |
642 | 662 | | |
643 | 663 | | |
644 | | - | |
| 664 | + | |
645 | 665 | | |
646 | 666 | | |
647 | 667 | | |
| |||
830 | 850 | | |
831 | 851 | | |
832 | 852 | | |
833 | | - | |
| 853 | + | |
834 | 854 | | |
835 | 855 | | |
836 | 856 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
464 | | - | |
| 464 | + | |
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
258 | | - | |
| 258 | + | |
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
| 341 | + | |
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
550 | | - | |
| 550 | + | |
551 | 551 | | |
552 | 552 | | |
553 | 553 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
608 | | - | |
| 608 | + | |
609 | 609 | | |
610 | 610 | | |
611 | 611 | | |
| |||
710 | 710 | | |
711 | 711 | | |
712 | 712 | | |
713 | | - | |
| 713 | + | |
714 | 714 | | |
715 | 715 | | |
716 | 716 | | |
| |||
0 commit comments