Skip to content

Lens: data-testid sweep — cms-admin UI instrumentation (F80)#2

Merged
cbroberg merged 18 commits into
mainfrom
lens/testid-sweep
Jun 3, 2026
Merged

Lens: data-testid sweep — cms-admin UI instrumentation (F80)#2
cbroberg merged 18 commits into
mainfrom
lens/testid-sweep

Conversation

@cbroberg
Copy link
Copy Markdown
Contributor

@cbroberg cbroberg commented Jun 2, 2026

What

Full data-testid sweep across cms-admin so the admin UI is verifiable by Lens (visual testing). Completes the F80 / Lens-readiness foundation.

Result

  • Real React-UI testid gaps: 1,178 → 0 (per the cardmem Lens daemon scanner /lens/testid-gaps).
  • 15 residual gaps remain — all confirmed false-positives, NOT real UI (left intentionally, flagged for the daemon-analyzer's false-positive filter):
    • server routes generating HTML/JS strings: widget.js/route.ts (7), mobile/open/route.ts, email-test/route.ts, ai/generate/route.ts
    • HTML/email template strings: lib/email.ts (2), lib/agent-runner.ts, public/templates/map-interactive.html
    • 3rd-party library string: Leaflet OpenStreetMap attribution <a> in map-leaflet.tsx
  • 123 files changed.
  • Typecheck: clean — 0 sweep-introduced errors (the 12 remaining tsc errors are all pre-existing: @webhouse/cms-mcp-client/server workspace-dist not built locally + webhook-dispatch.test.ts Mock types).

Convention

Per TESTID-CONVENTION.md (F086): kebab-case <surface>-<element>-<purpose>, placed as the first attribute before onClick/onChange (required by the scanner). Native DOM elements only — PascalCase React components excluded. Attribute-only additions, no logic changes.

How

Authored by the cms-core session, executed via parallel Haiku sub-agents over file chunks (the work is mechanical but voluminous), with the daemon scanner driving each file to 0 and a final tsc pass.

Safety

  • Branch only, never main. PM2 :3010 untouched (read-only). No dev-server interaction.

Notes for review

  • Some multi-line tags were reformatted by the agents while inserting the attribute (hence deletions in the diff) — behavior unchanged.
  • Next step (separate): build lens.manifest.json + the coordinated fleet-relaunch to load cardmem-lens MCP, then lens_capture/lens_verify baselines.

🤖 Generated with Claude Code

cbroberg and others added 18 commits June 2, 2026 18:40
- deploy-modal.tsx: backdrop, content container, deploy button, skip checkbox, close buttons, success link
- generate-document-dialog.tsx: backdrop, content container, prompt textarea, cancel button, generate button, header close button
- beam-progress-modal.tsx: backdrop, content container, minimize button, close button, done button
- beam-import-modal.tsx: close button, done button, error close button
- help-button.tsx: trigger button, close button, ISU buttons, learn more link, action links

Following kebab-case naming convention (e.g. deploy-modal-deploy-button), placing testids as FIRST attribute before handlers. Targeted all interactive native DOM elements (buttons, inputs, links, clickable divs/spans).

Lens testid-gaps reduced from 1029 → 874 (155 gaps closed).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…al backdrops/containers

- general-settings-panel.tsx: save button
- totp-panel.tsx: all 7 buttons (add app, verify, cancel enroll, disable trigger, disable, disable cancel, backup saved)
- deploy/generate modals: backdrop and content container divs

Lens testid-gaps being tracked. Following kebab-case convention, testids placed as FIRST attribute.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- dev-inspector.tsx: toggle button
- deploy-wizard.tsx: back and next buttons

Following kebab-case naming convention, testids as FIRST attribute before handlers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- map-leaflet.tsx: map container div

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…editor.tsx

Complete mechanical sweep adding testid attributes to all interactive elements:
- Toolbar buttons: formatting, media insertion, zoom, tools
- Modals and dialogs: link popup, video dialog, block/interactive/snippet/SVG pickers
- Media browser controls: image, audio, file inputs and search/filter
- Picker items with dynamic id suffixes (block-picker-item-<slug>, etc.)
- Form inputs and submit buttons across all interactive sections
- Pagination and navigation buttons
- Inline confirm patterns for delete operations
- Proofread editor controls (accept/reject/navigate)

All testids placed as first attribute per Lens convention.
Zero gaps remaining in rich-text-editor.tsx.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…fication

Mechanical testid sweep closing all gaps in DocumentEditor and supporting components (ConfirmDialog, RichtextCollapsible, CreateTranslationDialog, ScheduleButton, RevisionPanel, PropertiesPanel, TranslationGroupSection, and field-level interactions). Attributes placed first per convention. 33 gaps closed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… (sites, gallery, field-editor, chat, schema, etc.)
…g; drop redundant button testid passthrough)
Adds the Lens capture catalog at repo root: 26 surfaces (4 pixel-baseline:
auth pages + command; 22 no_diff value-assert: live-data /admin/* + settings/
account), element-mode anchored on per-page [data-testid="<page>-root"].
Adds matching <page>-root testids to each surface container (canonical
element-mode pattern — excludes drift-chrome from baselines).

Workspace surfaces use the fixed F146 slug /admin/lens-fixture-site/* for
stable URLs. auth = storageState (LENS_STORAGE_STATE) — the storageState file
generation (admin-role mint pattern) is pending Christian's decision and is a
capture-time concern, not a manifest concern.

Browser-verified: login-root renders as a viewport-covering anchor. Typecheck
clean (0 new errors).
…or no_diff

- examples/lens-fixture/: deterministic local fixture site (posts + pages
  collections, 2 seed posts) registered locally as slug 'lens-fixture-site'
  (org 'lens') so the 22 workspace surfaces resolve + render predictably.
- manifest auth → statePath ./.lens/storage-state.json (gitignored, holds a
  signed cms-session cookie for a local-only seeded admin lens-admin@cms.test).
- no_diff surfaces: waitFor → 2500ms settle (selector stays *-root) so captures
  don't smoke-pass on the loading/splash state (per cardmem's fysiodk finding).
- .lens/ gitignored.

Local-only (not committed, on this Mac's dev store): lens-admin user in
~/.webhouse/cms-admin/_data/users.json + lens-fixture-site registry entry +
.lens/storage-state.json. Verified: auth/me returns lens-admin (admin);
/admin/lens-fixture-site/{,/content/posts,/media,/settings} all 200.
…re feedback)

- admin-setup: /admin/setup redirects once the CMS is set up, so setup-root
  never exists → drop the surface (capture in a fresh-no-admin state later if
  needed). Manifest now 25 surfaces (3 pixel + 22 no_diff), all captured green.
- dashboard 'assert' held a selector string in a field that expects a JS body
  (SyntaxError). selector+waitFor already verify the anchor → remove it.
@cbroberg cbroberg merged commit 08999d0 into main Jun 3, 2026
6 of 7 checks passed
@cbroberg cbroberg deleted the lens/testid-sweep branch June 3, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant