Commit graph

55 commits

Author SHA1 Message Date
Kayshen-X 80dcda0bf1 feat(electron): enhance Electron app integration and CI/CD workflows
- Add new commands for Electron development, compilation, and building processes in CLAUDE.md.
- Update README.md to reflect the availability of the application as both a web and desktop app.
- Introduce a FixedChecklist component in the AI chat panel for better user interaction with generated tasks.
- Implement CI/CD workflows for automated testing and Electron builds in GitHub Actions.
- Refactor design generator prompts to support element-by-element streaming for improved performance.
2026-02-21 15:22:23 +08:00
Kayshen-X 523f96a2f7 feat(assets): add new icon files for application branding
- Introduce new icon files in various formats (ICNS, ICO, PNG) for application branding.
- Add logo image for the Electron interface to enhance visual identity.
- Update canvas selection logic to allow programmatic selection from the layer panel.
2026-02-21 12:14:02 +08:00
Kayshen-X db1b3055f1 feat(export): add export section for raster image export functionality
- Introduce a new ExportSection component to facilitate exporting layers as raster images in various formats (PNG, JPEG, WEBP) with adjustable scale options.
- Integrate the ExportSection into the PropertyPanel for easy access during design editing.
- Enhance export utility functions to support exporting layers and managing descendant nodes.
2026-02-21 09:20:55 +08:00
Fini 4733bdccd2 refactor(canvas): remove dimension label overlay
remove the blue dimension/position label that appeared on selection,
drag, and scale interactions
2026-02-21 04:47:20 +08:00
Fini 245d699ead fix(editor): save directly without dialog for previously opened files
prioritize fileName check over File System Access API so opened files
save via download without showing a file picker; also add Cmd+Alt+K
shortcut for creating reusable components
2026-02-21 04:47:14 +08:00
Fini 5324a91fec feat(canvas): match hover outline to selection style for components and instances
hover outlines now use purple solid for reusable components and #9281f7
dashed for instances, consistent with their selection border styling
2026-02-21 04:47:08 +08:00
Fini 0c0ed93ae8 feat(panels): add component/instance UI to layer and property panels
layer panel shows diamond icon and purple/#9281f7 styling for
components/instances with context menu actions; property panel resolves
RefNode display, routes instance overrides, adds header with go-to and
detach buttons, and supports inline name editing on click
2026-02-21 04:47:03 +08:00
Fini a4d6e11aad feat(store,canvas): add reusable component and instance system
add makeReusable/detachComponent store methods, RefNode resolution in
canvas sync with component/instance selection borders, virtual child ID
handling in selection context, purple/instance-colored frame labels,
and collision avoidance when duplicating nodes
2026-02-21 04:46:56 +08:00
Fini 5e53b85efa fix(canvas): multi-selection drag reparenting and infinite recursion guard
- Add re-entry guard to object:modified handler to prevent infinite
  recursion caused by discardActiveObject() firing object:modified
  via _finalizeCurrentTransform
- Extend drag-into detection to non-layout root frames (rootFrameBounds)
  in addition to layout containers (layoutContainerBounds)
- Add checkReparentIntoFrame() fallback for root-level objects dragged
  into frames, handling both layout and non-layout targets
- Redirect _currentTransform to ActiveSelection in mouse:down so the
  whole group moves/scales/rotates together
- Support same-container reorder in commitDragIntoMulti
- Fix guide-utils getEdges() for center-origin ActiveSelection objects
- Track selection descendants for visual drag-follow during multi-drag
- Show position coordinates during multi-selection drag in dimension label
2026-02-21 03:06:42 +08:00
Kayshen-X 543e64245c feat(electron): integrate Electron framework for desktop application support
- Add Electron configuration and main process setup for building a desktop application.
- Implement IPC communication for file operations (open, save) between the renderer and main processes.
- Create a preload script to expose Electron APIs to the renderer.
- Update package.json to include Electron and related dependencies.
- Enhance the build process with electron-builder for packaging the application.
- Introduce a new electron-builder.yml configuration file for build settings.
- Modify Vite configuration to support Electron-specific builds.
- Update UI components to accommodate Electron's window management and drag regions.
2026-02-20 20:19:06 +08:00
Kayshen-X 05b4cd6e49 feat(opencode): integrate OpenCode SDK for enhanced AI interactions
- Add support for OpenCode as a new AI provider, allowing users to connect to a local OpenCode server.
- Implement new API endpoints for generating and streaming chat responses via OpenCode.
- Update UI components to include OpenCode in provider selection and display.
- Introduce OpenCode logo and enhance the agent settings dialog to manage OpenCode connections.
- Refactor existing chat and generation logic to accommodate provider-specific routing.
- Include type definitions for OpenCode SDK to ensure type safety and improve developer experience.
2026-02-20 18:51:05 +08:00
Fini 61441d4014 feat(canvas,panels): multi-selection drag, shift-key selection, and chat pipeline UI
- Preserve multi-selection when clicking a selected object without Shift,
  enabling drag-move of the whole set
- Set selectionKey to shiftKey so only Shift+click toggles multi-select
- Refactor chat-message step rendering: extract step blocks with regex,
  add pipeline checklist progress UI, separate step display from markdown
- Adjust AI chat panel selection count display and layout
2026-02-20 18:20:57 +08:00
Kayshen-X 24fb09f386 feat(ai): enhance design generation with variable support and context inclusion
- Update AI design generation functions to incorporate document variables and themes, allowing for dynamic references in generated designs.
- Modify the buildContextString function to include variable summaries for improved context during AI interactions.
- Enhance prompts to instruct the AI on using variable references instead of hardcoded values, ensuring consistency and flexibility in design outputs.
- Refactor related types and services to support the new variable and theme structures, improving overall design generation capabilities.
2026-02-20 15:54:26 +08:00
Kayshen-X 7bfcb94f9a fix(variables-panel): adjust z-index for improved layering
- Update z-index of the VariablesPanel header from 10 to 20 to enhance visibility and interaction with overlapping elements.
2026-02-20 15:49:27 +08:00
Kayshen-X e8f7b597bf feat(history): increase maximum undo/redo states and enhance batch handling
- Update history store to support up to 300 undo/redo states, improving user experience during complex editing sessions.
- Refactor batch handling in various components to ensure accurate history tracking and prevent unnecessary entries.
- Implement checks to avoid adding duplicate states to the undo stack, optimizing performance and memory usage.
- Enhance event handling in canvas and keyboard shortcuts to maintain consistent history state during user interactions.
2026-02-20 15:41:45 +08:00
Fini 125d55dfc8 fix(canvas,store): history dedup, AI streaming guards, and drag reparent for nested containers
- Increase undo history to 300 states, deduplicate identical snapshots
- endBatch accepts optional currentDoc to skip no-op batches
- Add AI streaming guards: disable canvas interaction during generation
- Defer transform batch close via rAF so object:modified fires before endBatch
- Restrict layout reorder to move drags only (not scale/rotate handles)
- Extend checkDragReparent to work for any parent container, not just root frames
- Wrap design apply/modify in history batches for proper undo support
2026-02-20 15:27:05 +08:00
Kayshen-X ef157f906a feat(variables): introduce variable management and UI enhancements
- Add variable management capabilities to the document store, including setting, removing, and renaming variables.
- Implement a VariablesPanel in the editor layout for user interaction with variables.
- Enhance UI components (e.g., AppearanceSection, FillSection, LayoutSection, StrokeSection) to support variable binding for opacity, fill color, gap, and padding.
- Update code generation services to output CSS variables and React code with variable references.
- Introduce keyboard shortcuts for toggling the variables panel and improve overall user experience.
2026-02-20 15:27:04 +08:00
Kayshen-X 8e39257fee feat(canvas): enhance rotation controls and cursor handling
- Update rotation cursor SVG for improved design consistency and clarity.
- Refactor rotation control offsets and sizes for better maintainability.
- Implement a patch for `_setCursorFromEvent` to ensure rotation cursors display correctly when hovering over active object controls.
- Integrate rotation cursor handler setup in the fabric canvas initialization.
2026-02-20 13:55:20 +08:00
Kayshen-X 7d1c01cee7 feat(ui,ai): enhance chat panel and design generation feedback
- Introduce a "Thinking..." indicator in the AI chat panel to improve user experience during processing.
- Update chat message styles for better spacing and alignment.
- Implement batch undo functionality for number input adjustments to streamline user interactions.
- Refactor canvas event handling to ensure accurate history tracking during drag operations.
- Add keyboard shortcuts for agent settings and improve canvas selection handling during history state restoration.
2026-02-20 13:33:54 +08:00
Fini 7433ef0bf3 feat(canvas): layout re-flow on drag-out, drag-into layout containers, and clip path fix
- Remove hasManualX/hasManualY in computeLayoutPositions so layout children
  always use computed positions — fixes re-flow gap after drag-out
- Add layoutContainerBounds map populated during flattenNodes for drag-into
  hit detection
- Extract shared insertion-indicator.ts for indicator + container highlight
  state used by both layout-reorder and drag-into-layout
- Add drag-into-layout.ts: detect layout container under cursor during drag,
  show insertion indicator + dashed container highlight, reparent on drop
- Wire drag-into checks into object:moving / object:modified / mouse:up
- Clear clip paths on first object:moving to prevent stale ancestor clipping
  during drag; force re-sync after object:modified to restore them
- Prevent browser text selection during layer panel drag
2026-02-20 03:48:57 +08:00
Fini 87788ee97f fix(canvas,ai): path icon rendering, text centering, and stream reliability
- Path icons: use uniform scaling (preserve aspect ratio instead of squishing),
  fillRule 'evenodd' for compound paths with cutouts, transparent fill for
  stroke-only icons, strokeUniform to keep stroke width constant
- Text centering: use actual Fabric rendered height (fontSize * lineHeight)
  for cross-axis centering instead of declared height
- Hover cursor: use default arrow instead of move/crosshair on elements
- Stream reliability: server sends keep-alive pings every 15s during API TTFT,
  forwards thinking_delta events, client resets timeout on ping/thinking chunks
- Remove silent fallback from streamChat to generateCompletion (was causing
  double requests when server is unresponsive)
- Add 3-minute timeout to generateCompletion
- AI prompts: instruct model to preserve icon aspect ratios
2026-02-20 03:04:13 +08:00
Fini afccf469d0 feat(canvas): add hover highlighting, deep selection, root frame clipping and drag-out reparenting
Implement Figma-style canvas interactions:
- Hover outlines: solid blue on hovered element, dashed on direct children
- Depth-aware selection: single click selects at current depth, double-click
  enters containers progressively, Escape exits frame context
- Root frame clipping: depth-0 frames always clip overflowing children
- Drag-out reparenting: dragging a child outside its root frame detaches it
  to the overlapping frame or promotes to root level, with undo support
- Layout reorder drag with insertion indicator
- AI design generation with staggered fade-in animation
- Use default cursor on hover instead of move/crosshair
2026-02-20 02:16:55 +08:00
Fini 33d48c10f0 feat(ai): robust design generation with node sanitization and empty frame replacement
- Remove thinking_delta SSE events from server streaming
- Add generateCompletion non-streaming fallback with timeout recovery
- Refactor JSON extraction with multi-block scoring to select best output
- Add node sanitization pipeline: unique ID enforcement, layout child
  position cleanup, screen frame bounds clamping
- Progressive upsert with deep merge preserving earlier phase children
- Replace empty default frame with generated frame (preserving position)
- Enhance AI prompts for improved design output quality
2026-02-19 23:30:12 +08:00
Fini 6db7eb9b69 fix(panels): suppress blank lines between steps and fix message overflow
Group consecutive action steps without blank-line breaks between them.
Add width and overflow constraints on assistant message and design
block containers to prevent horizontal overflow.
2026-02-19 21:00:02 +08:00
Fini 9e5a83912b style(panels): refine chat message step and design block UI
Polish ActionStepItem with rounded card style, chevron toggle, and
green checkmark for completed steps. Restyle DesignJsonBlock with
consistent card layout, expand/collapse chevron, and nested JSON
preview area.
2026-02-19 20:50:13 +08:00
Fini 2118299229 feat(ai): refactor design generation with iterative pipeline and enhance chat UI
- Separate design generation and modification into dedicated functions
  with multi-step iterative pipeline (generateDesign, generateDesignModification)
- Add chat title derived from first message, shown in header and minimized bar
- Add panel resize via top drag handle with height constraints
- Show streaming loader icon next to chat title during AI generation
- Display selected object count in input area for context awareness
- Enhance chat-message with step collapsing and applied state styling
- Expand AI prompts for improved design generation quality
2026-02-19 20:42:54 +08:00
Fini 188a3c84e4 fix(canvas): remove redundant mid-drag store sync and preserve manual node positions
Remove intermediate syncTargetToStore calls during object:moving/scaling/
rotating to avoid excessive store writes during drag. In layout computation,
preserve explicit child coordinates set by user drag instead of overwriting
with auto-layout positions.
2026-02-19 18:14:32 +08:00
Fini 7147bdba25 fix(canvas): fix zoom center point accuracy and increase zoom sensitivity
Use viewport coordinates (clientX/Y relative to canvas element) instead
of scene coordinates for zoomToPoint. Bump zoom factor from 1.002 to
1.005 for snappier pinch-to-zoom response.
2026-02-19 18:06:21 +08:00
Fini c365b28c72 feat(canvas): use trackpad two-finger scroll for panning instead of zoom
Pinch-to-zoom (ctrlKey/metaKey) still zooms; plain two-finger scroll
now pans the canvas, matching Figma-style navigation.
2026-02-19 17:59:37 +08:00
Kayshen-X 4119bd8f6d feat(canvas): enhance canvas tool management and layer panel functionality
- Implement improved tool state management for drawing and selection tools, ensuring proper handling of canvas selection and event propagation.
- Refactor layer panel to support drag-and-drop functionality with visual indicators for drop positions (above, below, inside).
- Update layer item component to handle visibility and locking states more intuitively, enhancing user experience during layer manipulation.
- Introduce new keyboard shortcuts for selecting all top-level nodes, aligning with manual selection behavior.
- Enhance the README to reflect new features and improvements in the canvas and layer management systems.
2026-02-19 17:25:52 +08:00
Kayshen-X 89a4e51b17 feat(canvas): implement pen tool functionality and enhance object scaling
- Introduce a new pen tool for freehand drawing, allowing users to create custom paths on the canvas.
- Cache native dimensions of objects before scaling to ensure accurate rendering.
- Update object synchronization to utilize cached dimensions, improving scaling accuracy during transformations.
- Enhance event handling to support pen tool interactions, including pointer down, move, and up events.
- Add a shape tool dropdown in the toolbar for easy access to shape tools, including the new pen tool.
- Implement an icon picker dialog for importing SVG icons into the canvas.
2026-02-19 16:53:21 +08:00
Kayshen-X 4cd0b82a64 feat(canvas): implement parent-child drag and transformation functionality
- Introduce a new module for managing parent-child drag sessions, including functions for initiating, ending, and propagating transformations (move, scale, rotate) to descendant objects.
- Enhance the canvas event handling to support these transformations, ensuring visual feedback during drag operations.
- Add store methods for scaling and rotating descendant nodes in the document structure, maintaining consistency between the canvas and the underlying data model.
2026-02-19 13:53:09 +08:00
Kayshen-X 3bc30db5b2 feat(chat): enhance chat streaming with 'thinking' state and improve SVG handling in toolbar
- Add support for 'thinking' state in chat message streaming to indicate processing.
- Update toolbar to parse SVG files into editable nodes, allowing for better integration of SVG graphics.
- Refactor image handling to accommodate both SVG and raster images, ensuring proper placement and scaling on the canvas.
- Improve error handling and user feedback during file uploads.
2026-02-19 12:52:30 +08:00
Kayshen-X 77c7a657fa feat(dependencies): update @anthropic-ai/claude-agent-sdk to 0.2.47 and add @anthropic-ai/sdk 0.77.0; enhance error handling in connect-agent and improve chat-message display logic 2026-02-19 11:12:23 +08:00
Fini 2e61c5e640 feat(ai): add Setup Agents & MCP dialog with multi-provider support
- Add agent settings dialog to connect local Claude Code and Codex CLI
- Connect button fetches real models from Agent SDK / Codex models cache
- Provider logos (Claude, OpenAI) as React icon components in top-bar and dialog
- Model selector in AI chat panel grouped by provider with logos and Best badge
- MCP CLI integration toggles (Claude Code, Codex, Gemini, OpenCode, Kiro)
- Persist agent settings to localStorage with hydrate on mount
- Redesign AI chat panel: header, empty state pills, input area, color layering
- Add shadcn Switch component, agent-settings types and Zustand store
2026-02-19 03:15:36 +08:00
Fini afc73fc226 style(panels): polish AI chat message UI - remove assistant bubble, add pill thinking indicator, inline streaming cursor, strip extra newlines around blocks, softer DesignJsonBlock styling 2026-02-19 01:49:16 +08:00
Fini 9e862af383 chore(store): adjust default frame size to 1200x800 2026-02-19 01:21:39 +08:00
Fini 83e03c8c0f fix(canvas): support fit-content sizing and initial sync for layout containers
- add fitContentWidth/fitContentHeight to compute container size from children
- getNodeWidth/getNodeHeight fallback to fit-content for containers without explicit dimensions
- computeLayoutPositions always propagates resolved width/height to child nodes
- trigger initial document-to-canvas sync on mount so default frame renders
2026-02-19 01:21:34 +08:00
Fini 2e16d32d58 feat(canvas): add frame name labels for top-level elements 2026-02-19 01:21:18 +08:00
Fini a1256cc4fe feat(canvas): add theme-aware background and zoom-to-fit-content
- canvas background follows dark/light theme via MutationObserver
- add zoomToFitContent() to center viewport on document content
- call zoomToFitContent after canvas init, new document, and open file
- refactor top-bar theme init to useEffect for SSR hydration safety
2026-02-19 01:21:08 +08:00
Fini a49018b589 feat(editor): add top bar with file operations, theme toggle and fullscreen
- new TopBar component: layer panel toggle, new/open/save, centered filename, theme switch, fullscreen
- add layerPanelOpen state and toggleLayerPanel action to canvas-store
- add light theme CSS variables in styles.css, persisted via localStorage
- conditionally render LayerPanel based on toggle state
2026-02-18 23:46:17 +08:00
Fini bcda7e52c3 feat(store): add default frame for new documents and target AI insertion
- new documents start with a 1920x1080 white root frame
- AI-generated content inserts into the root frame instead of document root
- export DEFAULT_FRAME_ID constant for cross-module access
2026-02-18 23:46:16 +08:00
Fini 79a15240d3 feat(panels): conditional property panel, layer expand/collapse and scoped hover
- property panel only renders when an element is selected
- layer items show eye/lock icons only on the hovered row (group/layer scope)
- replace drag handle with chevron expand/collapse for nodes with children
- track collapsed state in LayerPanel, default all expanded
- remove uppercase from panel section headers
2026-02-18 23:46:15 +08:00
Kayshen-X 11375cfed8 feat(panels): enhance UI components with SectionHeader and improve layout
Introduce a new SectionHeader component for consistent section titles and action buttons across panels. Refactor existing sections (Appearance, Effects, Fill, Stroke, Text) to utilize SectionHeader, improving visual hierarchy and user experience. Update styles for better alignment and spacing in various input components, ensuring a cohesive design throughout the property panel.
2026-02-18 23:34:23 +08:00
Kayshen-X 9b8f4e0a0e feat(toolbar): implement image upload functionality and enhance toolbar
Add a new toolbar component with tools for selecting, drawing shapes, and adding images. Implement image upload functionality that allows users to add images to the canvas, including handling file selection and scaling images to fit the canvas. Update layer item icons to include an image icon for better visual representation.
2026-02-18 22:35:17 +08:00
Kayshen-X f81d6bde18 feat(ai): add model selection and fetching capabilities
Enhance AI chat and generation functionalities by introducing model selection. Update the chat and generation endpoints to accept an optional model parameter. Implement a new API endpoint to fetch available AI models from the server, and integrate model selection into the AI chat panel for improved user experience.
2026-02-18 22:35:16 +08:00
Kayshen-X 22bcd8a713 chore: update documentation and add MIT License
Enhance CLAUDE.md with detailed architecture, key modules, and AI configuration. Introduce LICENSE file with MIT License terms. Remove obsolete Header component to streamline the codebase.
2026-02-18 22:35:15 +08:00
Kayshen-X 0663505aa6 docs: update CLAUDE.md with UI component design tokens and Git commit guidelines
Add section on using shadcn/ui design tokens for UI components and establish guidelines for Git commit messages following the Conventional Commits format. Include details on commit types, scopes, and rules for writing clear commit messages.
2026-02-18 22:35:14 +08:00
Kayshen-X a32cd7aabf refactor: rename PascalCase files to kebab-case
Rename all component files to kebab-case per project convention
(e.g. EditorLayout.tsx → editor-layout.tsx). Remove obsolete
PascalCase originals that were replaced by kebab-case versions.
2026-02-18 22:35:13 +08:00
Kayshen-X 23aa080979 feat(codegen): add React and HTML code generation
Implement code generators that convert PenNode trees to React+Tailwind
and HTML+CSS output. Add code panel with tab switching, syntax
highlighting, and copy-to-clipboard. Supports generating code for
selected elements or the entire document.
2026-02-18 22:33:41 +08:00