Hashtag pill synthetic lint screenshot matrix #158

Closed
opened 2026-05-30 22:14:04 +00:00 by steve · 0 comments
Owner

Follow-up to #155. Regression-test hashtag pill visual stability for arbitrary cm-lintRange geometries using synthetic CodeMirror diagnostics, not markdownlint rule IDs.

Problem

Hashtag lint e2e tests wait on real markdownlint (MD018, MD009, MD041), which couples screenshots to specific linters and is flaky when lint timing or rules change.

Goal

Replace markdownlint-coupled hashtag lint Playwright tests with a geometry-based synthetic diagnostic matrix and screenshot baselines.

Scope

  • E2e init flag to suppress language-service lint during Playwright
  • Helpers to inject setDiagnostics with explicit from/to ranges
  • Scenario matrix (full line, split prefix, after tag, mid-line, path tag, dual tag, etc.)
  • Rewrite markdown-hashtag-lint.spec.ts; remove unused HASHTAG_* helpers from markdown-lint.helpers.ts
  • Update spec testing docs

Non-goals

  • Harper spellcheck coverage
  • New hashtag CSS unless screenshots fail
  • Production lint behavior changes for end users

Acceptance Criteria

  • markdown-hashtag-lint.spec.ts uses synthetic lint only (no waitForMarkdownLintDiagnostics for hashtag tests)
  • Each scenario has a Playwright screenshot baseline
  • Unused HASHTAG_* note helpers removed if unreferenced
  • spec/src/40-testing/current-state.md and editor-and-views contract note synthetic lint DOM shapes
  • pnpm --filter @lapis-notes/workspace exec playwright test e2e/markdown-hashtag-lint.spec.ts passes

Implementation Notes

  • Set __LAPIS_SUPPRESS_LANGUAGE_SERVICE_LINT__ in Playwright init script; early-return in collectLanguageServiceDiagnostics
  • Map column-relative ranges to document offsets via doc.line(); setDiagnostics via dynamic import in page.evaluate

Validation Commands

pnpm --filter @lapis-notes/workspace exec playwright test e2e/markdown-hashtag-lint.spec.ts
pnpm --filter @lapis-notes/workspace check:all

Implementation Summary

Replaced markdownlint-coupled hashtag lint e2e with eight synthetic cm-lintRange geometry scenarios via LAPIS_SYNTHETIC_LINT, Playwright init suppress flag, and dev-only __lapisE2e bridge. New screenshot baselines under markdown-hashtag-lint.spec.ts; spec docs updated.

Follow-up to #155. Regression-test hashtag pill visual stability for arbitrary `cm-lintRange` geometries using synthetic CodeMirror diagnostics, not markdownlint rule IDs. ## Problem Hashtag lint e2e tests wait on real markdownlint (MD018, MD009, MD041), which couples screenshots to specific linters and is flaky when lint timing or rules change. ## Goal Replace markdownlint-coupled hashtag lint Playwright tests with a geometry-based synthetic diagnostic matrix and screenshot baselines. ## Scope - E2e init flag to suppress language-service lint during Playwright - Helpers to inject `setDiagnostics` with explicit from/to ranges - Scenario matrix (full line, split prefix, after tag, mid-line, path tag, dual tag, etc.) - Rewrite `markdown-hashtag-lint.spec.ts`; remove unused `HASHTAG_*` helpers from `markdown-lint.helpers.ts` - Update spec testing docs ## Non-goals - Harper spellcheck coverage - New hashtag CSS unless screenshots fail - Production lint behavior changes for end users ## Acceptance Criteria - [ ] `markdown-hashtag-lint.spec.ts` uses synthetic lint only (no `waitForMarkdownLintDiagnostics` for hashtag tests) - [ ] Each scenario has a Playwright screenshot baseline - [ ] Unused `HASHTAG_*` note helpers removed if unreferenced - [ ] `spec/src/40-testing/current-state.md` and editor-and-views contract note synthetic lint DOM shapes - [ ] `pnpm --filter @lapis-notes/workspace exec playwright test e2e/markdown-hashtag-lint.spec.ts` passes ## Implementation Notes - Set `__LAPIS_SUPPRESS_LANGUAGE_SERVICE_LINT__` in Playwright init script; early-return in `collectLanguageServiceDiagnostics` - Map column-relative ranges to document offsets via `doc.line()`; `setDiagnostics` via dynamic import in `page.evaluate` ## Validation Commands ```bash pnpm --filter @lapis-notes/workspace exec playwright test e2e/markdown-hashtag-lint.spec.ts pnpm --filter @lapis-notes/workspace check:all ``` ## Related Issues - Follow-up to #155 — [Editor hashtag pill breaks when markdownlint decorates the line](../closed/155-editor-hashtag-pill-breaks-when-markdownlint-decorates-the-line.md) ## Implementation Summary Replaced markdownlint-coupled hashtag lint e2e with eight synthetic cm-lintRange geometry scenarios via __LAPIS_SYNTHETIC_LINT__, Playwright init suppress flag, and dev-only __lapisE2e bridge. New screenshot baselines under markdown-hashtag-lint.spec.ts; spec docs updated. <!-- backlog:task_id=TASK-MARKDOWN-HASHTAG-LINT-E2E source_spec=spec/src/30-cross-package-contracts/editor-and-views.md related_issue=155 -->
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lapis-notes/lapis#158
No description provided.