Skip to content

chore: post-merge follow-ups (region cleanup + landing tests)#45

Closed
AlexandreCamillo wants to merge 2 commits into
mainfrom
chore/post-merge-followups
Closed

chore: post-merge follow-ups (region cleanup + landing tests)#45
AlexandreCamillo wants to merge 2 commits into
mainfrom
chore/post-merge-followups

Conversation

@AlexandreCamillo

@AlexandreCamillo AlexandreCamillo commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Two follow-ups from PR #44 (tldraw removal + ViewerShell extraction) that we explicitly parked.

Commits

  • 649a9c1 — remove GET /api/annotations/[id]/region and the sharp-backed cropRegion helper. The endpoint cropped a screenshot using pinCoords; since the comment-only annotation flow landed in refactor: tldraw removal + ViewerShell extraction #44 no new annotation row has either field set, so this URL became unreachable for anything created after the cutover. Touches: route file, lib helper, unit test, sharp pnpm onlyBuiltDependencies entry, plus 11 doc cross-refs (agent-loop endpoints + INDEX, api INDEX + routes + storage, feature catalog, stack, ci, frontend INDEX, task-rules, testing).
  • 2fe71e7 — rewrite the two failing landing.spec.ts tests. They still looked for a Drop pin button that has not existed since the ViewerShell migration. New flow: click "New annotation" → click iframe → fill "Annotation body" textarea → click "Send" → assert data-pin-target count. Drops the now-unused window.prompt mock.

Acceptance

  • tsc --noEmit clean
  • pnpm test — 970 vitest tests pass (137 files; lost 4 from the deleted region crop unit, gained nothing)
  • biome check src tests docs — same 2 pre-existing warnings on untouched test files; no new errors
  • No /region, region.png, cropRegion, agent-region-crop, or from 'sharp' references anywhere in src/, tests/, or docs/ (excluding gitignored spec/plan)
  • Manual e2e verification (CI will run the rewritten landing tests + existing happy-path/historic-viewing)

Out of scope

The endpoint cropped a screenshot using pinCoords. After the
comment-only annotation flow landed in PR #44, no new annotation row
has either field set — the endpoint was unreachable for anything
created after the cutover. Removing the route, the sharp-backed
cropRegion helper, the unit test, sharp's pnpm "built-dependencies"
entry, and every doc cross-reference (agent-loop endpoints + INDEX,
api INDEX, feature catalog, stack, storage, routes, ci, frontend
INDEX, task-rules, testing).

Legacy annotation rows with screenshotPath + pinCoords populated will
no longer be reachable through this URL — orchestrators relying on it
should fetch the full screenshot via /api/annotations/[id]/screenshot.
The two failing landing.spec.ts tests still looked for a "Drop pin"
button that has not existed since the ViewerShell migration. The
demo's create-annotation flow now: click "New annotation" → click
inside the iframe (title="Mockup") → fill the draft textarea ("Annotation
body") → click "Send" → annotation card appears with data-pin-target.
Drops the window.prompt mock (the old DraftCard used prompt, the new
one is a real textarea). Reset test uses the same flow to seed a 4th
annotation before exercising the two-click reset.
@github-actions

Copy link
Copy Markdown

Coverage report

Metric Baseline (main) This PR Δ
Lines 58.57% 58.70% +0.13
Statements 55.64% 55.81% +0.17
Functions 50.91% 51.58% +0.67
Branches 47.66% 47.60% -0.06

@AlexandreCamillo

Copy link
Copy Markdown
Collaborator Author

Superseded by #47 — consolidando os dois PRs lá.

Disposição dos dois commits desta branch após análise contra o main atual (que foi reescrito desde que este PR foi aberto em 28/mai):

  • 649a9c1 (remover GET /api/annotations/[id]/region + helper cropRegion + sharp)ainda relevante. Os arquivos (region/route.ts, lib/region/crop.ts, o unit test) e a dep sharp continuavam presentes no main atual. Cherry-picked para a branch do feat(ci): adopt @quality-gate/core for multi-metric merge gate #47 (commit f413acb). Verificado lá: zero consumidores de /region/cropRegion, sharp permanece apenas como dep transitiva do next@16.2.6 (otimização de imagem), lockfile consistente (--frozen-lockfile passa), docs de agent-loop limpas, tsc + 724 unit tests verdes.
  • 2fe71e7 (reescrever landing.spec.ts)stale. O main atual já corrigiu landing.spec.ts de forma independente (usa os seletores data-pin-target / new annotation, sem o botão Drop pin nem o mock de window.prompt). Trazer esta versão seria redundante/regressão, então foi descartada.

Fechando este PR; o trabalho relevante segue no #47.

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