Commit c35db7e
fix(dashboard): W11 honesty + pause/resume UI (P3 regressions) (#64)
* test(overview): pin sparkline-array regression at source-text level (W11)
The fake sparkline arrays the P3 founder persona caught on 2026-05-13
([22,20,18,...], [12,12,...], [18,15,8,16,...]) were removed earlier
in W7-G's rewrite, and the existing DOM-level test already pins that
no svg.sparkline elements render with the default no-series wiring.
This commit hardens the pin by scanning OverviewPage.tsx source text
for the three exact arrays after stripping comments — a tier-conditional
regression that synthesises the series in only one code path would
slip past a DOM-level smoke test but would still ship the literals.
Comments are stripped first so the JSDoc reference to "[22,20,18,...]"
inside Stat doesn't trip the assertion.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(dashboard): flip /audit gap→live + wire Audit tab to real endpoint (W11)
ResourceDetailPage's API-contract panel still advertised
GET /api/v1/resources/:id/metrics and /audit as status="gap" with a
"request early access" mailto CTA. Metrics was actually live (W7-F,
2026-05-14) and the audit log is live at the team level (W7-C).
The per-resource audit path doesn't exist server-side yet, but the
team-level GET /api/v1/audit already scopes rows to team_id OR
metadata.resource_id pointing at a resource the caller owns — so the
dashboard fetches that window and filters client-side for matching
resource_id. Precision cut, not a security boundary.
Changes:
- Flip the /audit ContractLine from status="gap" to status="live".
- Drop the `audit-early-access` mailto CTA — there's no gap to
apologise for now that the data is real.
- Drop the legacy `blocked` tag from the Audit tab.
- Wire the Audit tab body to a new <AuditPanel /> that fetches via
api.fetchResourceAudit(resourceId, 24h) and renders an honest
table: timestamp, actor_email_masked, kind, metadata. Empty state
when no rows; upgrade-required state on 402 (anonymous/free tier);
error banner on 5xx — never fake rows.
- Add api.fetchResourceAudit() that wraps the team-level endpoint
and applies the resource_id filter so the panel stays simple.
- Stop using `r.token` as the AuditPanel resourceId — audit
metadata stores the UUID (r.id), not the public token.
- Fix a stray malformed `</>` closing the JSX root that the prior
"AUDIT — blocked" placeholder left behind.
Tests:
- ResourceDetailPage.test.tsx — flip the .meta.gap assertion from 1
to 0, flip .meta.ok from 8 to 9, assert audit-early-access does
NOT render, assert the Audit tab tag has no `.tag` span, and
assert the AuditPanel mounts (empty / table / upgrade-required).
- AuditPanel.test.tsx — five state pins: loading, empty, populated,
402 upgrade-required, generic 5xx error.
npm test before: 473 pass, 3 skip / after: 519 pass, 3 skip
(post-rebase baseline 522; +5 audit panel + +5 page-level audit tests
+ test reshuffle).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* test(resource-detail): pin PauseResumeButton presence on Overview tab (W11)
P3 #58 regression: an earlier PR claimed pause/resume support but the
component file didn't ship — grep on the time confirmed zero
`pause|resume` references in dashboard/src/. The component eventually
landed in W9-B1, and PauseResumeButton has its own dense test file,
but those tests render the component in isolation and would still
pass even if ResourceDetailPage forgot to mount it.
This adds a page-level presence assertion: render
ResourceDetailPage with an active resource and assert
`pause-resume-button` is in the DOM. A future refactor that drops the
import (or moves the button behind a tier-gated conditional that no
longer fires) breaks the test, not the user.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent aa9b3c7 commit c35db7e
6 files changed
Lines changed: 640 additions & 57 deletions
File tree
- src
- api
- components
- pages
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
557 | 628 | | |
558 | 629 | | |
559 | 630 | | |
| |||
| 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 | + | |
0 commit comments