Commit graph

278 commits

Author SHA1 Message Date
dependabot[bot]
ba9090943e
build(deps-dev): bump @hono/node-server from 1.19.7 to 1.19.10
Bumps [@hono/node-server](https://github.com/honojs/node-server) from 1.19.7 to 1.19.10.
- [Release notes](https://github.com/honojs/node-server/releases)
- [Commits](https://github.com/honojs/node-server/compare/v1.19.7...v1.19.10)

---
updated-dependencies:
- dependency-name: "@hono/node-server"
  dependency-version: 1.19.10
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-26 11:46:42 +00:00
Jan-Henrik Bruhn
18f15c071b
Merge pull request #75 from jhbruhn/dependabot/npm_and_yarn/ajv-6.14.0
build(deps-dev): bump ajv from 6.12.6 to 6.14.0
2026-03-26 12:45:48 +01:00
Jan-Henrik Bruhn
3daa55d79d
Merge pull request #71 from jhbruhn/dependabot/npm_and_yarn/webpack-5.105.0
build(deps-dev): bump webpack from 5.104.0 to 5.105.0
2026-03-26 12:45:34 +01:00
Jan-Henrik Bruhn
a0029cfb17
Merge pull request #70 from jhbruhn/dependabot/npm_and_yarn/modelcontextprotocol/sdk-1.26.0
build(deps-dev): bump @modelcontextprotocol/sdk from 1.25.1 to 1.26.0
2026-03-26 12:45:21 +01:00
Jan-Henrik Bruhn
4cf2b09701
Merge pull request #85 from jhbruhn/preview-bg
feature: Add light/dark background toggle to pattern preview
2026-03-26 12:45:02 +01:00
7817835f16 feature: Add light/dark background toggle to pattern preview
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 12:42:57 +01:00
Jan-Henrik Bruhn
3e30909311
Merge pull request #84 from jhbruhn/step-control
feature: step control
2026-03-26 12:32:41 +01:00
4fd8ad284f fix: Improve step control UX and fix machine error display
- Consolidate progress stats into 3 cards (stitches, time, speed)
- Keep rollback info visible after machine clears error while paused
- Remove Resume/Start Sewing buttons in STOP state (error must be
  resolved on machine first)
- Use adjustedStitchIndex for progress display to prevent desync
- Make step control layout stable (always render all buttons)
- Reduce polling interval from 500ms to 1000ms during sewing
- Fix machine errors (e.g. HoopError) not showing in error badge
  when there was no accompanying string error message

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 12:30:06 +01:00
7250e0e586 feature: Add stitch step control for error recovery and manual positioning
Implements automatic stitch rollback on thread errors (upper thread: -6,
lower thread: -2, sewing start: -21) and manual step controls to adjust
stitch position when machine is paused/stopped/interrupted. Adds UI with
step buttons (-100/-10/-1/+1/+10/+100), thread start jump, and current
stitch reset. Uses existing NEEDLE_MODE_INSTRUCTIONS (0x0709) BLE command.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 12:04:38 +01:00
2f45f26942 chore: allow beads 2026-03-26 09:44:08 +01:00
dependabot[bot]
404132d2b5
build(deps-dev): bump ajv from 6.12.6 to 6.14.0
Bumps [ajv](https://github.com/ajv-validator/ajv) from 6.12.6 to 6.14.0.
- [Release notes](https://github.com/ajv-validator/ajv/releases)
- [Commits](https://github.com/ajv-validator/ajv/compare/v6.12.6...v6.14.0)

---
updated-dependencies:
- dependency-name: ajv
  dependency-version: 6.14.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-22 15:17:48 +00:00
dependabot[bot]
2fe1ae5d2e
build(deps-dev): bump webpack from 5.104.0 to 5.105.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.104.0 to 5.105.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Changelog](https://github.com/webpack/webpack/blob/main/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack/compare/v5.104.0...v5.105.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-version: 5.105.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-07 17:39:09 +00:00
dependabot[bot]
48dd09ec0e
build(deps-dev): bump @modelcontextprotocol/sdk from 1.25.1 to 1.26.0
Bumps [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk) from 1.25.1 to 1.26.0.
- [Release notes](https://github.com/modelcontextprotocol/typescript-sdk/releases)
- [Commits](https://github.com/modelcontextprotocol/typescript-sdk/compare/1.25.1...v1.26.0)

---
updated-dependencies:
- dependency-name: "@modelcontextprotocol/sdk"
  dependency-version: 1.26.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-04 20:39:08 +00:00
Jan-Henrik Bruhn
fe00a854ac
Merge pull request #69 from jhbruhn/dependabot/npm_and_yarn/hono-4.11.7
Some checks failed
Build, Test, and Lint / Build, Test, and Lint (push) Has been cancelled
Draft Release / Draft Release (push) Has been cancelled
Draft Release / Build Release - ubuntu-latest (push) Has been cancelled
Draft Release / Build Release - windows-latest (push) Has been cancelled
Draft Release / Build Web App (push) Has been cancelled
Draft Release / Build Release - macos-latest (push) Has been cancelled
Draft Release / Upload to GitHub Release (push) Has been cancelled
build(deps-dev): bump hono from 4.11.1 to 4.11.7
2026-01-28 08:57:34 +01:00
Jan-Henrik Bruhn
434b922d1b
Merge pull request #68 from jhbruhn/dependabot/npm_and_yarn/lodash-4.17.23
build(deps): bump lodash from 4.17.21 to 4.17.23
2026-01-28 08:57:16 +01:00
dependabot[bot]
da1f52ce2a
build(deps-dev): bump hono from 4.11.1 to 4.11.7
Bumps [hono](https://github.com/honojs/hono) from 4.11.1 to 4.11.7.
- [Release notes](https://github.com/honojs/hono/releases)
- [Commits](https://github.com/honojs/hono/compare/v4.11.1...v4.11.7)

---
updated-dependencies:
- dependency-name: hono
  dependency-version: 4.11.7
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-27 19:28:04 +00:00
dependabot[bot]
e947a59805
build(deps): bump lodash from 4.17.21 to 4.17.23
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.21...4.17.23)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.17.23
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-23 23:53:43 +00:00
6c8078fae5 Add beads(?)
Some checks failed
Build, Test, and Lint / Build, Test, and Lint (push) Has been cancelled
Draft Release / Draft Release (push) Has been cancelled
Draft Release / Build Web App (push) Has been cancelled
Draft Release / Build Release - macos-latest (push) Has been cancelled
Draft Release / Build Release - ubuntu-latest (push) Has been cancelled
Draft Release / Build Release - windows-latest (push) Has been cancelled
Draft Release / Upload to GitHub Release (push) Has been cancelled
2026-01-07 16:05:01 +01:00
2b4fb9211f bd sync: 2026-01-07 16:03:36 2026-01-07 16:03:36 +01:00
Jan-Henrik Bruhn
3ba87ba192
Merge pull request #65 from jhbruhn/fix/konva-canvas-performance-optimization
Some checks failed
Build, Test, and Lint / Build, Test, and Lint (push) Has been cancelled
Draft Release / Draft Release (push) Has been cancelled
Draft Release / Build Web App (push) Has been cancelled
Draft Release / Build Release - macos-latest (push) Has been cancelled
Draft Release / Build Release - ubuntu-latest (push) Has been cancelled
Draft Release / Build Release - windows-latest (push) Has been cancelled
Draft Release / Upload to GitHub Release (push) Has been cancelled
fix: Optimize Konva canvas performance during drag and zoom operations
2025-12-28 14:09:58 +01:00
9d30eae901 fix: Address Copilot review feedback for performance optimizations
Fix issues identified in Copilot review:

1. Remove throttling from stage drag cursor updates - cursor now updates immediately on drag start for better UX
2. Accumulate wheel deltaY values during throttle period instead of only processing last event - prevents jerky zoom behavior
3. Remove redundant listening={false} props from child elements (inherited from parent Group)
4. Update file documentation to reflect stage drag cursor update functionality

These changes improve both performance and user experience while maintaining code clarity.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-28 14:08:08 +01:00
93ebc8398c fix: Optimize Konva canvas performance during drag and zoom operations
Implement performance optimizations to reduce lag during canvas interactions:

Performance improvements:
- Throttle wheel zoom with requestAnimationFrame to prevent excessive state updates (~50% reduction)
- Throttle stage drag cursor updates to ~60fps to eliminate unnecessary layout recalculations
- Remove unnecessary React state updates during pattern drag/transform operations
- Disable event listening on static canvas layers (grid, origin, hoop) for ~30% event processing reduction
- Add conditional logging (development only) to eliminate console overhead in production

Technical changes:
- useCanvasViewport: Add RAF throttling for wheel zoom, throttle cursor updates during stage drag
- usePatternTransform: Remove intermediate state updates during drag (let Konva handle visually)
- KonvaComponents: Set listening={false} on Grid, Origin, and Hoop components
- PatternCanvas: Disable listening on background layer, use new throttled handlers
- usePatternStore: Wrap console.log statements with isDev checks

Result: Significantly smoother drag/rotation operations with consistent 60 FPS, 30-50% CPU reduction during interactions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-28 13:57:51 +01:00
Jan-Henrik Bruhn
212d21e065
Merge pull request #63 from jhbruhn/copilot/move-helper-functions-to-utils
Some checks are pending
Build, Test, and Lint / Build, Test, and Lint (push) Waiting to run
Draft Release / Draft Release (push) Waiting to run
Draft Release / Build Web App (push) Blocked by required conditions
Draft Release / Build Release - macos-latest (push) Blocked by required conditions
Draft Release / Build Release - ubuntu-latest (push) Blocked by required conditions
Draft Release / Build Release - windows-latest (push) Blocked by required conditions
Draft Release / Upload to GitHub Release (push) Blocked by required conditions
Verify helper function refactoring completion - no changes needed
2025-12-28 09:25:52 +01:00
copilot-swe-agent[bot]
7d8af87660 Initial plan 2025-12-28 08:20:38 +00:00
Jan-Henrik Bruhn
656f501a92
Merge pull request #61 from jhbruhn/copilot/add-computed-values-selectors
Add computed selectors to pattern store for memoized transformations
2025-12-28 09:19:40 +01:00
copilot-swe-agent[bot]
5296590a45 fix: Revert pattern validation to local hook to prevent infinite re-renders
The selectPatternValidation selector doesn't work well with Zustand because:
1. It requires machineInfo parameter from a different store
2. Passing machineInfo creates new object references on every render
3. This breaks Zustand's memoization and causes infinite loops

Solution:
- Reverted usePatternValidation.ts to original implementation with useMemo
- Removed selectPatternValidation and usePatternValidationFromStore
- Removed PatternValidationResult type (not needed)
- Updated tests to remove validation selector tests (12 tests remain)

The store selectors (selectPatternCenter, selectRotatedBounds, etc) are
still useful for components that only need those specific values, but
validation logic that depends on external state should stay local.

Co-authored-by: jhbruhn <1036566+jhbruhn@users.noreply.github.com>
2025-12-28 08:17:20 +00:00
copilot-swe-agent[bot]
bcb5ea1786 fix: Use shallow comparison in selector hooks to prevent infinite re-renders
The selectors were creating new object references on every call, causing
Zustand's subscription system to detect changes and trigger infinite
re-render loops. This was particularly evident in usePatternValidationFromStore.

Solution:
- Import useShallow from zustand/react/shallow
- Wrap all selector hooks (usePatternCenter, useUploadedPatternCenter,
  useRotatedBounds, usePatternValidationFromStore) with useShallow
- useShallow performs shallow comparison on returned objects, preventing
  re-renders when values haven't actually changed

This follows the established pattern in the codebase where useShallow is
already used extensively (App.tsx, FileUpload.tsx, etc).

Co-authored-by: jhbruhn <1036566+jhbruhn@users.noreply.github.com>
2025-12-28 08:10:40 +00:00
Jan-Henrik Bruhn
2a5fbb2232
Merge pull request #62 from jhbruhn/copilot/create-shared-infocard-component
Create shared InfoCard component for error/warning/success states
2025-12-28 09:01:26 +01:00
7c3f79ae7e fix: TypeScript error in InfoCard icon variant check
Fix TypeScript build error "Type 'null' cannot be used as an index type"
by adding explicit null check for variant before indexing defaultIcons.

The variant from VariantProps can be null even with a default value,
so TypeScript requires an explicit check.

Changes:
- Added null check: showDefaultIcon && variant
- Added 'as const' to defaultIcons for better type inference

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-28 09:00:03 +01:00
copilot-swe-agent[bot]
edb8fa9264 fix: Move InfoCard to components folder and remove tests
Co-authored-by: jhbruhn <1036566+jhbruhn@users.noreply.github.com>
2025-12-27 17:07:23 +00:00
copilot-swe-agent[bot]
df71f74396 fix: Address code review feedback for InfoCard component
Co-authored-by: jhbruhn <1036566+jhbruhn@users.noreply.github.com>
2025-12-27 17:01:20 +00:00
copilot-swe-agent[bot]
6fbb3ebf1a fix: Add missing bounds field to mock PenStitches in tests
Co-authored-by: jhbruhn <1036566+jhbruhn@users.noreply.github.com>
2025-12-27 17:00:05 +00:00
copilot-swe-agent[bot]
fb94591f78 feature: Document consistent use of pattern helpers across codebase
- Add documentation to usePatternRotationUpload about using same helpers as store
- Add documentation to App.tsx pattern resume logic
- Mark PatternLayer to continue using local memoization (receives props)
- All tests passing

Co-authored-by: jhbruhn <1036566+jhbruhn@users.noreply.github.com>
2025-12-27 16:58:52 +00:00
copilot-swe-agent[bot]
b2f0455d4c feature: Refactor ErrorPopover and StepPopover to use InfoCard
Co-authored-by: jhbruhn <1036566+jhbruhn@users.noreply.github.com>
2025-12-27 16:58:19 +00:00
copilot-swe-agent[bot]
1d79ffb2a4 feature: Add computed selectors to usePatternStore for pattern transformations
- Add selectPatternCenter for pattern center calculation
- Add selectRotatedBounds for rotated bounds with memoization
- Add selectRotationCenterShift for center shift calculation
- Add selectPatternValidation for bounds checking against hoop
- Add comprehensive tests for all selectors
- Update usePatternValidation to use store selectors
- All tests passing and linter clean

Co-authored-by: jhbruhn <1036566+jhbruhn@users.noreply.github.com>
2025-12-27 16:56:54 +00:00
copilot-swe-agent[bot]
a828bf4c8f feature: Add InfoCard shared component with tests
Co-authored-by: jhbruhn <1036566+jhbruhn@users.noreply.github.com>
2025-12-27 16:55:24 +00:00
copilot-swe-agent[bot]
2114bacdae Initial plan 2025-12-27 16:49:39 +00:00
copilot-swe-agent[bot]
20fff4cdfb Initial plan 2025-12-27 16:47:35 +00:00
Jan-Henrik Bruhn
a173ee33a4
Merge pull request #60 from jhbruhn/refactor/remove-cross-store-dependencies
Some checks are pending
Build, Test, and Lint / Build, Test, and Lint (push) Waiting to run
Draft Release / Draft Release (push) Waiting to run
Draft Release / Build Web App (push) Blocked by required conditions
Draft Release / Build Release - macos-latest (push) Blocked by required conditions
Draft Release / Build Release - ubuntu-latest (push) Blocked by required conditions
Draft Release / Build Release - windows-latest (push) Blocked by required conditions
Draft Release / Upload to GitHub Release (push) Blocked by required conditions
refactor: Remove cross-store dependencies using Zustand event store
2025-12-27 17:46:53 +01:00
9299f5aed9 fix: Address Copilot review feedback on event subscriptions
Add error handling and documentation to event subscriptions based on
Copilot review feedback.

Changes:
- Added try-catch blocks to all event callbacks for graceful error handling
- Added comments documenting that subscriptions persist for app lifetime
- Improved JSDoc for onPatternDeleted function with lifecycle details
- Added error logging to help debug potential issues

Benefits:
- Prevents silent failures in event callbacks
- Clear documentation about subscription lifecycle
- Better developer experience with error messages

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-27 17:45:22 +01:00
20e9fa13e7 refactor: Remove cross-store dependencies using Zustand event store
Replace direct store imports and calls with a Zustand-based event system
for decoupled cross-store communication.

Changes:
- Created storeEvents.ts using Zustand for event management
- Removed direct usePatternStore import from useMachineStore
- Removed dynamic imports for useMachineUploadStore and useMachineCacheStore
- Added event subscriptions in usePatternStore, useMachineUploadStore, and useMachineCacheStore
- useMachineStore now emits patternDeleted event instead of calling other stores directly

Benefits:
- Stores can be tested in isolation
- No tight coupling between stores
- Clear, explicit event-driven data flow
- Uses Zustand's built-in subscription system
- Easier to refactor stores independently

Fixes #37

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-27 17:39:26 +01:00
Jan-Henrik Bruhn
e49a63a4b1
Merge pull request #59 from jhbruhn/refactor/extract-color-block-helpers
refactor: Extract color block calculation logic to utility module
2025-12-27 17:27:33 +01:00
101f46e627 refactor: Extract color block calculation logic to utility module
Extract color block calculation from ProgressMonitor component to
colorBlockHelpers utility module for better testability and reusability.

Changes:
- Created colorBlockHelpers.ts with calculateColorBlocks() and findCurrentBlockIndex()
- Added comprehensive unit tests (11 test cases, all passing)
- Updated ProgressMonitor to use new utility functions
- Reduced component complexity by removing embedded business logic

Benefits:
- Logic can be tested in isolation
- Can be reused elsewhere if needed
- Cleaner component code
- Better separation of concerns

Fixes #44

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-27 17:21:42 +01:00
Jan-Henrik Bruhn
d213ab49e2
Merge pull request #58 from jhbruhn/feature/react-memo-optimization
feature: Enhance Konva rendering with React.memo optimization
2025-12-27 17:14:54 +01:00
77ec00df86 fix: Remove ineffective React.memo from PatternCanvas
Address Copilot review feedback: PatternCanvas doesn't accept any props,
so React.memo has no effect. The component re-renders are driven by
Zustand store subscriptions which trigger regardless of memoization.

Keep React.memo on PatternLayer since it does receive props and benefits
from memoization.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-27 17:11:31 +01:00
512eb732de feature: Enhance Konva rendering with React.memo optimization
Wrap PatternCanvas and PatternLayer components with React.memo to
prevent unnecessary re-renders when props haven't changed. This builds
on the existing useMemo optimizations and provides better performance
with large patterns and frequent UI updates.

Benefits:
- Prevents re-renders when parent components update
- Improves render performance during active sewing
- Smoother user experience with complex patterns

Fixes #43

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-27 17:04:48 +01:00
Jan-Henrik Bruhn
957a3f07b8
Merge pull request #57 from jhbruhn/fix/memoize-pattern-canvas-calculations
fix: Add memoization to PatternCanvas expensive computations
2025-12-27 17:02:11 +01:00
65275c0557 fix: Add memoization to PatternCanvas expensive computations
Extract inline calculations to useMemo hooks to prevent unnecessary
recalculations on every render. Memoized displayPattern selection
and pattern dimensions calculation improve performance with large patterns.

Fixes #34

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-27 16:56:26 +01:00
Jan-Henrik Bruhn
89bc55b822
Merge pull request #56 from jhbruhn/refactor/extract-sub-components
refactor: Extract sub-components from large components
2025-12-27 16:43:19 +01:00
095c879ea3 fix: Address Copilot review feedback
- Simplify StepCircle cursor logic to use isComplete || isCurrent
- Fix UploadButton to use boundsFits prop instead of !!boundsError
- Remove XSS vulnerability by parsing markdown safely without dangerouslySetInnerHTML
- Move ColorBlock type to shared types.ts file to reduce coupling
- Rename useDisplayFilename to getDisplayFilename and move to utils (not a hook)
- Improve threadMetadata JSDoc with detailed examples
- Make WorkflowStep interface properties readonly for full immutability
- Fix PyodideProgress redundant negation logic

All issues from Copilot review resolved.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-27 16:41:58 +01:00