feat(dashboard): entity list UX — REF column, name cells, detail pages (CUST-WP-0030)

- ref-cell.js: REF column component — click=copy deeplink, dblclick=open
- field-help.js: field registry + fieldRow helper with help-tip decoration;
  FK fields (task_id, workstream_id, repo_id) render as async-linked cells
  with entity-title bubble-help on hover
- GET /token-events/{id} endpoint + get-by-id tests
- GET /repos/by-id/{repo_id} UUID lookup endpoint
- Landing pages: /token-events/[id], /workstreams/[id], /repos/[slug], /tasks/[id]
- token-cost.md: REF + Name columns on all three tables; parallel fetch of
  workstreams/tasks for title resolution
- reference.md: entity detail page URL scheme documented

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-29 22:35:35 +02:00
parent acb30978cd
commit b28298a2ec
14 changed files with 748 additions and 15 deletions

View File

@@ -196,3 +196,22 @@ class TestTokenSummary:
s = r.json()
assert s["tokens_total"] == 0
assert s["event_count"] == 0
@pytest.mark.asyncio
class TestTokenEventGetById:
async def test_get_by_id(self, client):
ev = await _post_event(client, tokens_in=111, tokens_out=222, note="get-by-id-test")
r = await client.get(f"/token-events/{ev['id']}")
assert r.status_code == 200
result = r.json()
assert result["id"] == ev["id"]
assert result["tokens_in"] == 111
assert result["tokens_out"] == 222
assert result["tokens_total"] == 333
assert result["note"] == "get-by-id-test"
async def test_get_by_id_not_found(self, client):
import uuid
r = await client.get(f"/token-events/{uuid.uuid4()}")
assert r.status_code == 404