Commit graph

194 commits

Author SHA1 Message Date
0bd037b98a fix: Resolve pattern rendering and coordinate handling bugs
This commit addresses multiple critical issues in pattern rendering and coordinate handling:

1. Fixed Y-axis offset accumulation in penParser.ts
   - Corrected sign extension logic for 16-bit signed coordinates
   - Changed to interpret full 16-bit value as signed before shifting
   - Prevents coordinate drift and offset accumulation

2. Fixed color assignment for tack stitches in patternConverter.worker.ts
   - Added detection for small finishing stitches after COLOR_CHANGE commands
   - Assigns tack stitches to correct (previous) color instead of new color
   - Uses conservative pattern matching (< 1.0 unit, followed by JUMP)

3. Made jump stitches visible in pattern preview (KonvaComponents.tsx)
   - Render jump stitches in thread color instead of gray
   - Use dashed pattern [8, 4] to distinguish from regular stitches
   - Set appropriate opacity (0.8 completed, 0.5 not completed)
   - Fixed critical bug: include previous position in jump groups to create proper line segments

4. Updated konvaRenderers.ts for consistency
   - Applied same jump stitch rendering logic
   - Ensures consistent behavior across rendering methods

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-13 18:37:30 +01:00
Jan-Henrik Bruhn
8c0b893599
Merge pull request #7 from jhbruhn/delete-release-artifacts-before-upload
feature: Streamline build pipeline to only run lint and build checks
2025-12-13 14:16:37 +01:00
Jan-Henrik Bruhn
6293aebc46 feature: Streamline build pipeline to only run lint and build checks
Remove expensive cross-platform Electron packaging from the build pipeline
since it duplicates work done by the release pipeline. The build pipeline
now focuses on quick quality checks (linting + TypeScript compilation) for
every PR and main branch push.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-13 14:15:07 +01:00
Jan-Henrik Bruhn
d3655c4565
Merge pull request #6 from jhbruhn/delete-release-artifacts-before-upload
fix: Delete release artifacts before upload to prevent duplicates
2025-12-13 14:10:02 +01:00
Jan-Henrik Bruhn
6e7f4fb212 fix: Delete release artifacts before upload to prevent duplicates
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-13 14:07:41 +01:00
Jan-Henrik Bruhn
77efb8e9b9
Merge pull request #5 from jhbruhn/center-button
feature: Add center pattern button to canvas controls
2025-12-13 13:57:29 +01:00
Jan-Henrik Bruhn
ca3d18fb2c feature: Add center pattern button to canvas controls
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-13 13:54:04 +01:00
Jan-Henrik Bruhn
7b5cf26428
Merge pull request #4 from jhbruhn/conversion-worker
feature: Implement Web Worker-based pattern conversion with progress tracking
2025-12-13 13:36:38 +01:00
Jan-Henrik Bruhn
0dfc8b731b feature: Implement Web Worker-based pattern conversion with progress tracking
Move Pyodide/PyStitch pattern conversion to a dedicated Web Worker for
non-blocking UI performance. Pyodide now loads in the background on app
startup with real-time progress indicator showing download and initialization
status.

Key changes:
- Create patternConverter.worker.ts with full PES to PEN conversion logic
- Add patternConverterClient.ts singleton for worker management
- Implement progress tracking (0-100%) with step descriptions
- Add inline progress bar in FileUpload component with contextual messaging
- Configure COEP headers for Electron to support Web Workers
- Pass dynamic asset URLs to worker for file:// protocol support
- Update UIStore with progress state management
- Simplify pystitchConverter.ts to delegate to worker client

Benefits:
- Truly non-blocking UI (heavy Python/WASM runs off main thread)
- Real progress feedback during 15MB Pyodide download
- Works in both browser and Electron (dev and production)
- Faster app startup perception with background loading
- Better UX with "waiting" state if user clicks before ready

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-13 13:34:13 +01:00
Jan-Henrik Bruhn
077c7d0bf5 Add enhancement label to minor 2025-12-12 21:48:27 +01:00
Jan-Henrik Bruhn
2eb78329df
Merge pull request #3 from jhbruhn/zustand
Use Zustand
2025-12-12 21:47:37 +01:00
Jan-Henrik Bruhn
fe2e68a457 feature: Update WorkflowStepper to use Zustand stores directly
Complete the component refactoring by updating WorkflowStepper to
consume stores directly instead of receiving props.

Changes:
- Updated WorkflowStepper to use useMachineStore and usePatternStore
- Removed 7 props that were being passed from App.tsx
- Added hasError import to WorkflowStepper
- Removed unused hasError import from App.tsx

Now all major components use Zustand stores directly:
- FileUpload: 0 props (was 14)
- ProgressMonitor: 0 props (was 9)
- PatternCanvas: 0 props (was 7)
- PatternSummaryCard: 0 props (was 5)
- WorkflowStepper: 0 props (was 7)

Total props eliminated: 42

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-12 21:43:45 +01:00
Jan-Henrik Bruhn
c22216792a feature: Update components to use Zustand stores directly
Refactor all child components to consume stores directly instead of
receiving props from App.tsx. This eliminates prop drilling and
simplifies the component tree.

Components updated:
- FileUpload: Now uses useMachineStore, usePatternStore, and useUIStore
  directly instead of receiving 14 props
- ProgressMonitor: Now uses useMachineStore and usePatternStore instead
  of receiving 9 props
- PatternCanvas: Now uses useMachineStore and usePatternStore instead of
  receiving 7 props
- PatternSummaryCard: Now uses useMachineStore and usePatternStore
  instead of receiving 5 props

Changes to App.tsx:
- Removed all component props that are now accessed via stores
- Removed unused callbacks: handlePatternLoaded, handlePatternOffsetChange,
  handleUpload, handleDeletePattern
- Removed unused imports: PesPatternData, canDeletePattern, useCallback
- Simplified component tree with zero-prop component calls

Benefits:
- Eliminated prop drilling across 37 props total
- Components can access exactly what they need from stores
- Cleaner, more maintainable component interfaces
- Better separation of concerns

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-12 21:40:24 +01:00
Jan-Henrik Bruhn
e015c587bd feature: Implement Zustand state management
- Add zustand dependency for modern state management
- Create three separate stores for better code organization:
  - useMachineStore: Machine connection, status, and operations
  - usePatternStore: Pattern data, offset, and upload state
  - useUIStore: Pyodide and UI-specific state
- Migrate App.tsx from useBrotherMachine hook to Zustand stores
- Use useShallow for optimized multi-value selections
- Implement dynamic polling intervals based on machine state
- Add ESLint ignore for .vite build directory

Benefits:
- Better separation of concerns with logical store divisions
- Improved performance through selector-based subscriptions
- Cleaner code replacing 445-line hook with maintainable stores
- Full TypeScript support with proper typing

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-12 21:28:52 +01:00
Jan-Henrik Bruhn
b7d64887cb
Merge pull request #2 from jhbruhn/update-node
feature: use proper node version for used electron version
2025-12-12 21:01:51 +01:00
Jan-Henrik Bruhn
e48879d8f9
Merge pull request #1 from jhbruhn/show-version
feature: Display version in Electron window title
2025-12-12 20:59:14 +01:00
Jan-Henrik Bruhn
7ca4a52c85 feature: use proper node version for used electron version 2025-12-12 20:58:48 +01:00
Jan-Henrik Bruhn
ae13001f25 feature: Display version in Electron window title
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-12 20:50:29 +01:00
Jan-Henrik Bruhn
b2fa76d0dd feature: newer release-drafter version 2025-12-12 20:33:06 +01:00
Jan-Henrik Bruhn
34c641abc7 feature: Add autolabeler configuration and commit guidelines
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-12 20:31:44 +01:00
Jan-Henrik Bruhn
2d38451629
Increase minimum height of main window to 800 2025-12-12 11:54:58 +01:00
Jan-Henrik Bruhn
821f41d69a
Adjust minimum window size for better layout 2025-12-12 11:52:41 +01:00
Jan-Henrik Bruhn
3516b609f6 Fix ESLint configuration and resolve all linting issues
- Rename eslint.config.js to eslint.config.mjs to support ES modules
- Remove unused parameters from interface implementations
- Fix refs access during render in WorkflowStepper by removing redundant check
- Wrap colorBlocks computation in useMemo to fix exhaustive-deps warning

All linting errors and warnings are now resolved.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-11 14:11:35 +01:00
Jan-Henrik Bruhn
75ec5c49a9 Add checkout step to publish-to-pages job
The gh CLI needs to be run in a git repository to download release
assets. Add checkout step before downloading release assets.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-11 13:57:28 +01:00
Jan-Henrik Bruhn
5ef58495bb Fix release asset upload by checking out repository
The gh CLI needs to be run in a git repository to determine the target
repo for uploading release assets. Add checkout step to the
upload-to-release job.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-11 13:47:31 +01:00
Jan-Henrik Bruhn
0e57ade95f Separate GitHub Pages publishing to only run on release publish
Move GitHub Pages deployment to a separate workflow that triggers only
when a release is published, not when drafts are created or updated.
The new workflow downloads release assets directly from the published
release to deploy alongside the web app.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-11 13:42:17 +01:00
Jan-Henrik Bruhn
675bb2a6cc Remove readme, for now 2025-12-11 13:40:24 +01:00
Jan-Henrik Bruhn
3d57853928 Add update electron app handler 2025-12-11 13:33:47 +01:00
Jan-Henrik Bruhn
7d7d17f918 Build web app with correct base path for GitHub Pages
Set Vite base path to /respira/ when building for GitHub Pages
so assets load correctly from the repository subdirectory.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-11 13:30:11 +01:00
Jan-Henrik Bruhn
3760f05c29 Add web app build and deploy to GitHub Pages root
- Add build-web job that builds the web app
- Publish web app to GitHub Pages root directory
- Keep auto-update files in /update/ subdirectory
- Web app accessible at https://jhbruhn.github.io/respira/
- Auto-update files at /update/win32/x64/ and /update/darwin/arm64/

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-11 13:24:17 +01:00
Jan-Henrik Bruhn
e28761f127 Fix auto-update structure and macOS manifest URL
- Organize files in correct directory structure for auto-updater
- Windows files → update/win32/x64/
- macOS files → update/darwin/arm64/ (ZIP + RELEASES.json only)
- Fix macOS update manifest URL from x64 to arm64
- Exclude Linux packages and macOS DMG (not used for auto-updates)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-11 13:22:38 +01:00
Jan-Henrik Bruhn
6a53f86aea Add GitHub Pages deployment and consolidate release uploads
- Upload build outputs as workflow artifacts (windows/macos/linux)
- Add upload-to-release job that consolidates all platform uploads
- Add publish-to-pages job that deploys to GitHub Pages
- Add required permissions for Pages deployment

Build artifacts are now available in two places:
- GitHub Release for manual downloads
- GitHub Pages /update/ for auto-update systems

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-11 13:06:43 +01:00
Jan-Henrik Bruhn
a60f9c801f make build include releases.json for macos 2025-12-11 12:54:48 +01:00
Jan-Henrik Bruhn
8026a8977d Include RELEASES.json in macOS build assets upload
Add RELEASES.json to the release artifacts for macOS builds,
which is needed for auto-update functionality.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-11 12:50:38 +01:00
Jan-Henrik Bruhn
4a8127e5fb Increase left column width from 400px to 480px
Provides more breathing room for controls and progress monitor
in the left column on wide screens.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-11 12:44:33 +01:00
Jan-Henrik Bruhn
675b0f2b4e Set minimum Electron window size to prevent layout breaks
- Set minWidth to 1024px (matches Tailwind lg breakpoint)
- Set minHeight to 700px for adequate vertical space
- Prevents window from being resized to mobile single-column layout

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-11 12:43:10 +01:00
Jan-Henrik Bruhn
0c15f67ef0 Add Home Machine step to workflow for Initial state
- Add step 2: "Home Machine" to initialize hoop position
- Shift all subsequent workflow steps by 1 (now 8 steps total)
- Detect MachineStatus.Initial and show homing instructions
- Reuse existing InitialHoopError guidance for step content
- Update getCurrentStep logic to return step 2 when homing needed

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-11 12:38:51 +01:00
Jan-Henrik Bruhn
efc712995b Move error display to header with clickable popover
- Replace content-pushing error banners with header status indicator
- Add categorized error labels (Python Error, Connection Error, etc.)
- Show detailed error info with solutions in 600px popover on click
- Fix layout shift by always rendering error button (invisible when no error)
- Clear machineError state on disconnect
- Fix TypeScript error in WorkflowStepper ref callback

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-11 12:31:57 +01:00
Jan-Henrik Bruhn
bf3e397ddb Redesign UI for fixed-size window with floating guide overlay
- Convert NextStepGuide to collapsible floating overlay in bottom-right
- Implement fixed viewport layout (no page scrolling on desktop)
- Make color blocks scrollable with dynamic gradient indicator
- Add responsive behavior: scrollable on mobile, fixed on desktop
- Increase overlay opacity for better readability
- Enable full-height columns that expand to fill available space

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-10 21:56:19 +01:00
Jan-Henrik Bruhn
0dbfc751cb Improve responsive design and simplify typography system
Implemented comprehensive responsive design improvements for tablet support
and simplified typography from 12 different font sizes to a clean 5-level
hierarchy using only standard Tailwind classes.

Responsive improvements:
- Canvas height now adapts: 400px (mobile) → 500px (tablet) → 600px (desktop)
- Header stacks vertically on tablets, side-by-side on desktop (1024px+)
- WorkflowStepper scales appropriately for smaller screens
- Canvas overlays are more compact on mobile/tablet
- All components use responsive spacing and padding

Typography system redesign:
- Reduced from 12 sizes to 5 levels (Display, Heading, Subheading, Body, Label)
- Removed arbitrary pixel values (text-[7px], text-[9px], text-[10px], etc.)
- All text now uses standard Tailwind classes (text-xs, text-sm, text-base, text-lg, text-xl)
- Minimum text size is now 12px (text-xs) for better accessibility
- Buttons upgraded to text-sm (14px) for improved touch targets
- Consistent responsive scaling for top-level headers only

Added docs/TYPOGRAPHY_SYSTEM.md with usage guidelines and component mapping.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-10 16:56:43 +01:00
Jan-Henrik Bruhn
39d4df6a74 Fix zoom race condition and adjust zoom limits
- Fix race condition by using functional state updates in all zoom handlers
- Prevents negative or invalid zoom values from rapid scroll events
- Change zoom range from 10%-1000% to 10%-200% for more reasonable limits
- All zoom operations (wheel, buttons) now safely constrained
- Ensures consistent behavior even with fast mouse wheel scrolling

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-10 14:32:27 +01:00
Jan-Henrik Bruhn
6534684967 Add pre-upload validation for pattern bounds vs hoop size
- Validate pattern (with offset) fits within hoop bounds before upload
- Calculate precise overflow in each direction (left, right, top, bottom)
- Display detailed error message showing exact measurements
- Disable upload button when pattern exceeds hoop bounds
- Position error messages below buttons with smooth slide animation
- Set button sizing: file select (2/3), upload (1/3) for consistent layout
- Pass machineInfo to FileUpload component for hoop dimensions

Prevents uploading patterns that would exceed machine working area and
provides clear feedback on how to adjust pattern position.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-10 14:18:45 +01:00
Jan-Henrik Bruhn
eadbecc401 Add thread metadata display and unique color handling
- Fix PyStitch threadlist interpretation: threads = color blocks, not unique colors
- Add uniqueColors array to PesPatternData with proper deduplication at data layer
- Display thread metadata (brand, catalog number, chart, description) across all components
- Show unique colors vs thread blocks (e.g., "5 / 12" colors/blocks)
- Improve null value handling for missing thread metadata
- Reorder metadata display: brand + catalog # • chart + description
- Add metadata to pattern preview legend, tooltips, and color swatches

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-10 14:10:27 +01:00
Jan-Henrik Bruhn
501a7e8538 Move ai docs to separate folder 2025-12-08 18:54:37 +01:00
Jan-Henrik Bruhn
be48af7274 Upload rpm assets 2025-12-08 16:59:24 +01:00
Jan-Henrik Bruhn
ba3ef6030e Build AppImage 2025-12-08 16:35:25 +01:00
22577af745 Now fix path to dmg? 2025-12-08 00:29:19 +01:00
77652b8127 Remove darwin from dmg path 2025-12-08 00:24:46 +01:00
855a472293 Icons 2025-12-08 00:21:31 +01:00
044c7f4906 Change application name 2025-12-07 23:45:34 +01:00