Repository navigation
Develop/V2.0 - #38
Develop/V2.0#38sebastianMindee wants to merge 9 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Controlled position and options updates are stale, disabled zoom blocks scrolling, and the new lint configuration leaves failing unused imports.
Review effort: Balanced
Findings: 4
Open (4)
What changed in this PR
Modernizes the library’s toolchain and refactors canvas lifecycle, image handling, selection, zoom, and testing for v2.
Changes:
- Upgrades TypeScript, Vite, ESLint, Prettier, Cypress, and packaging.
- Refactors viewer/lens rendering and asynchronous image loading.
- Improves typing, Konva state handling, and component tests.
| File | Description |
|---|---|
vite.config.ts |
Adds typed Vite library configuration. |
vite.config.js |
Removes legacy Vite configuration. |
tsconfig.json |
Modernizes TypeScript compilation settings. |
src/utils/zoom.ts |
Centralizes zoom state and tightens guards. |
src/utils/zoom.spec.ts |
Updates type-only imports. |
src/utils/useMultiSelection.ts |
Refactors modifier handling around stage refs. |
src/utils/useEventListener.ts |
Simplifies typed event-listener management. |
src/utils/selection.ts |
Moves selection metadata into weak maps. |
src/utils/selection.spec.ts |
Updates type-only imports. |
src/utils/orientation.ts |
Simplifies rotation and adds error handling. |
src/utils/layer.ts |
Updates type-only imports. |
src/utils/image.ts |
Improves image typing, errors, and zoom access. |
src/utils/image.spec.ts |
Updates test typing. |
src/utils/getPDFPageCount.ts |
Converts PDF counting to async/await. |
src/utils/getPDFPageCount.spec.tsx |
Tightens rejected-error typing. |
src/utils/getImagesFromPDF.ts |
Refactors PDF rendering with async/await. |
src/utils/getImagesFromPDF.spec.tsx |
Tightens rejected-error typing. |
src/utils/functions.ts |
Improves Konva node lookup safety. |
src/utils/canvas.ts |
Stores annotation metadata outside Konva attributes. |
src/utils/canvas.spec.ts |
Simplifies test casts. |
src/index.ts |
Exports the zoom-scale accessor. |
src/components/dynamicZoom.spec.tsx |
Updates dynamic zoom test component. |
src/components/AnnotationViewer.tsx |
Refactors stage, image, callback, and shape lifecycles. |
src/components/AnnotationViewer.spec.tsx |
Updates event assertions and imports. |
src/components/AnnotationLens.tsx |
Refactors lens rendering and image lifecycle. |
src/components/AnnotationLens.spec.tsx |
Modernizes test types. |
src/common/types.ts |
Strengthens public TypeScript types. |
src/common/constants.ts |
Updates type imports and Konva accessors. |
README.md |
Reorders example imports. |
pnpm-workspace.yaml |
Documents the disabled canvas build. |
package.json |
Upgrades tooling and changes ESM packaging. |
ISSUE_TEMPLATE.md |
Normalizes Markdown lists. |
eslint.config.ts |
Adds strict flat ESLint configuration. |
cypress/support/index.d.ts |
Updates Cypress mount typing. |
cypress/support/component.ts |
Migrates Cypress snapshot integration. |
cypress/support/component-index.html |
Formats component-runner HTML. |
cypress/assets/shapes.ts |
Uses a type-only import. |
cypress.config.ts |
Updates snapshot plugin configuration. |
CONTRIBUTING.md |
Normalizes Markdown lists. |
CODE_OF_CONDUCT.md |
Applies formatting corrections. |
.prettierrc |
Updates import-sorting configuration. |
.prettierignore |
Adds repository-wide formatting exclusions. |
.eslintrc |
Removes the legacy ESLint configuration. |
.eslintignore |
Removes legacy ignore configuration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
723b427 to
a907016
Compare
a907016 to
fe56745
Compare
a14374a to
ac94fd4
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The release still publishes version 1.7.0, and the lens does not apply the new TIFF/HEIF preparation path.
2 open findings
4 resolved since last review
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
| try { | ||
| const image = await rotateImage(annotationData.current) | ||
| imageDataObject.current.element.src = image | ||
| const src = await rotateImage(image, orientation); |
There was a problem hiding this comment.
🟡 Changes recommended
Small fitted images cannot zoom reliably, and modifier release can incorrectly enable stage dragging.
3 open findings
1 resolved since last review
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
| useEventListener('keyup', (event) => { | ||
| event.stopPropagation(); | ||
| if (isSelectionModifier(event)) { | ||
| stageRef.current?.draggable(true); |


PR Details
BIG PR to bump, rehaul, fix and update most of the repo + add page lazy-loading
Description
Related Issue
Motivation and Context
How Has This Been Tested
Types of changes
Checklist