Skip to content

refactor: editor quality improvements#87

Merged
omachala merged 2 commits intomainfrom
editor-quality-improvements
Feb 11, 2026
Merged

refactor: editor quality improvements#87
omachala merged 2 commits intomainfrom
editor-quality-improvements

Conversation

@omachala
Copy link
Owner

Summary

  • Extract 4 modules from ElementPicker (1354→~870 lines): textEditing.ts, paddingResize.ts, backgroundFill.ts, overlayGeometry.ts
  • Add 88 new tests: 78 annotation unit tests (arrow, rect, ellipse) + 10 annotation E2E tests (draw, move, delete, selection)
  • Create shared constants.ts replacing magic z-indices, timeouts, and colors across 5 files
  • Accessibility: ARIA labels on all icon buttons/inputs, aria-pressed/aria-expanded states, keyboard resize on padding handles (arrow keys)
  • Performance: RAF-throttle scroll handler
  • Error handling: Console warnings for highlightElement retry exhaustion and text override selector misses
  • Dead code removal: Delete unused StyleEditor.svelte (132 lines)

Test plan

  • pnpm test:editor — 337 unit tests pass
  • pnpm test:editor:e2e — 51 E2E tests pass (6 pre-existing snapshot failures from Chrome version diff)
  • pnpm lint:editor — clean
  • pnpm typecheck:editor — clean
  • pnpm build:editor — builds successfully

…and accessibility

- Extract 4 modules from ElementPicker (1354→~870 lines): textEditing, paddingResize, backgroundFill, overlayGeometry
- Add 78 annotation unit tests for arrow, rect, ellipse types
- Add 10 annotation E2E tests covering draw, move, delete, and selection lifecycle
- Create shared constants.ts replacing magic numbers across 5 files
- Add ARIA labels and keyboard resize support for padding handles
- RAF-throttle scroll handler for performance
- Add console warnings for silent failures (highlightElement retries, text override misses)
- Delete unused StyleEditor.svelte (132 lines)
@changeset-bot
Copy link

changeset-bot bot commented Feb 11, 2026

🦋 Changeset detected

Latest commit: 572519f

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

- Fix Object possibly undefined errors in annotation E2E tests
- Exclude extracted browser-only modules from unit test coverage
- Add empty changeset for internal refactoring
@omachala omachala force-pushed the editor-quality-improvements branch from d0d7c89 to 572519f Compare February 11, 2026 16:27
@sonarqubecloud
Copy link

@omachala omachala merged commit 311f56f into main Feb 11, 2026
12 checks passed
@omachala omachala deleted the editor-quality-improvements branch February 11, 2026 16:29
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