Commit graph

24 commits

Author SHA1 Message Date
Kayshen-X
cc17b372eb 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
a4e0934aa8 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
1950f8f618 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
30010ad5a3 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
05a3c5eb43 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
70aa10f41b chore(store): adjust default frame size to 1200x800 2026-02-19 01:21:39 +08:00
Fini
0629a99260 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
b9241db194 feat(canvas): add frame name labels for top-level elements 2026-02-19 01:21:18 +08:00
Fini
2ab2a1d074 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
0d0be80129 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
28b42e2abf 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:17 +08:00
Fini
892cc789e1 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:16 +08:00
Kayshen-X
f85bbe69dc 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
eaf66d976a 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
6cde80454e 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:17 +08:00
Kayshen-X
03c44e51b0 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:17 +08:00
Kayshen-X
515801ce26 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:17 +08:00
Kayshen-X
2dbfab49d3 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:17 +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
Kayshen-X
6a7a0d0019 feat(ai): integrate AI chat and design generation
Add floating AI assistant panel with streaming chat, design keyword
detection, and automatic PenNode JSON extraction to canvas. Server
endpoints use Anthropic SDK (with API key) or Claude Agent SDK (local
OAuth) as fallback. Panel supports minimize, drag-to-snap, and
quick action presets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 21:49:41 +08:00
Kayshen-X
b425defdca feat(history): add undo/redo, keyboard shortcuts, and file operations
Implement history store with undo/redo stacks using structuredClone
snapshots. Add keyboard shortcuts for common operations (copy, paste,
delete, group, save, export). Implement save-as dialog (.pen file
download) and export dialog (PNG/SVG with scale options).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 21:49:31 +08:00
Kayshen-X
a56577ea85 feat(panels): add property inspector and layer management
Implement property panel with sections for size, fill, stroke, corner
radius, text, appearance, and effects. Add layer panel with drag-and-drop
reordering, visibility toggles, and right-click context menu. Shared
form components: color picker, number input, and dropdown select.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 21:49:24 +08:00
Kayshen-X
01cc22412e feat(editor): scaffold core canvas engine and editor layout
Set up the Fabric.js v7 canvas integration with bidirectional sync
to a Zustand document store. Includes drawing tools (select, rectangle,
ellipse, line, text, frame, hand), viewport pan/zoom, smart guides,
dimension labels, and the main editor layout with toolbar and status bar.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 21:49:16 +08:00
Kayshen-X
c009ab7925 Initialize OpenPencil project with essential files and configurations
- Added .cta.json for project settings including TypeScript, Tailwind, and Bun as package manager.
- Created .gitignore to exclude common build and environment files.
- Introduced bun.lock for dependency management.
- Added CLAUDE.md for guidance on using Claude Code with the project.
- Set up package.json with scripts for development, build, and testing.
- Created README.md outlining project features, tech stack, and getting started instructions.
- Configured TypeScript with tsconfig.json for strict type checking.
- Established Vite configuration in vite.config.ts for project bundling.
- Added VSCode settings to exclude generated files from linting.
- Included public assets such as favicon and logos.
- Implemented initial routing structure in src/router.tsx and generated route tree in src/routeTree.gen.ts.
- Developed canvas functionality with multiple files for object management and event handling in src/canvas.
- Styled the application using Tailwind CSS in src/styles.css.
2026-02-17 21:14:16 +08:00