mirror of
https://github.com/ZSeven-W/openpencil.git
synced 2026-06-01 03:14:29 +07:00
3 commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
4af8ef412b
|
V0.3.3 (#33)
* fix(ai): add icon name aliases and fix multi-path SVG concatenation Add 55+ common icon name aliases (burger→hamburger, sushi→fish, etc.) to both client icon-resolver and server icon API for robust AI-generated icon resolution. Register Lucide's own aliases for broader coverage. Fix SVG path concatenation bug where joining multiple <path> d-values caused incorrect rendering — a standalone <path> treats initial lowercase "m" as absolute, but after concatenation it becomes relative to the previous sub-path endpoint. Now ensures each sub-path starts with absolute "M". Add tryAsyncIconFontResolution for icon_font nodes that miss local lookup — fetches from server API, caches result, and triggers canvas re-render. * fix(canvas): preserve badge/overlay absolute positioning in auto-layout Add isBadgeOverlayNode() detector for badge, indicator, notification-dot, and overlay nodes. These nodes now retain their x/y coordinates instead of being stripped by layout sanitization. Update computeLayoutPositions to exclude badge nodes from the layout flow — they keep absolute positioning and render on top (prepended for correct z-order in reverse iteration). * fix(ai): prevent duplicate canvas objects and fix emoji-to-icon pipeline Streaming path: add ensureUniqueNodeIds before inserting nodes to prevent ID collisions across multiple AI generations. Track newly inserted IDs so subsequent streaming nodes don't collide either. Canvas sync: deduplicate Fabric objects sharing the same penNodeId — keep only the one tracked in objMap, remove stale duplicates. Badge nodes: use shared isBadgeOverlayNode() for z-order insertion and skip x/y stripping in layout parents. Fix emoji-to-icon pipeline: re-run applyIconPathResolution after applyNoEmojiIconHeuristic converts emoji text nodes to path nodes, so the icon resolver can match by name (e.g. "Pizza Emoji Path" → pizza). * fix(canvas): add async icon resolution fallback for icon_font nodes When lookupIconByName fails locally, queue tryAsyncIconFontResolution to fetch from server API. Cache result in ICON_PATH_MAP and trigger canvas re-render via store update. Store iconFontName and iconStyle on Fabric object for sync tracking. * fix(ai): strengthen emoji ban in prompts and improve orchestrator defaults Update all AI prompts to explicitly ban emoji characters with concrete examples and redirect to icon_font nodes instead of the previously incorrect "path nodes" guidance. Add z-order rule to orchestrator prompt: overlay elements must come before content they overlap. Add padding support to OrchestratorPlan rootFrame type. Default mobile root frame gap to 16 for consistent spacing. * feat(electron): add publisher name to Windows build configuration Updated the `electron-builder.yml` to include a publisher name for Windows builds, enhancing the identification of the application during installation. Additionally, revised the README files across multiple languages to reflect the new project description and features, emphasizing OpenPencil as the world's first AI-native open-source vector design tool with concurrent agent teams and design-as-code capabilities. --------- Co-authored-by: Fini <fini.yang@gmail.com> |
||
|
|
a671c38785
|
V0.3.1 (#25)
* feat(mcp): enhance document management and design tools - Updated `openDocument` to always re-fetch the live canvas, ensuring user edits are captured. - Introduced new tools: `get_design_prompt` for retrieving design guidelines and `batch_design` for executing multiple design operations using a DSL. - Improved `handleInsertNode` and `handleUpdateNode` to include validation for node data and return the final node state after operations. - Enhanced design prompt with detailed PenNode schema and layout rules for better AI-generated designs. - Added validation functions to ensure node data integrity during CRUD operations. - Updated `handleOpenDocument` to provide context-aware design prompts based on document content. * feat(electron): enhance build configuration and auto-update functionality - Updated `electron-builder.yml` to include artifact naming conventions for Windows and Linux builds. - Enhanced NSIS installer settings to create desktop and start menu shortcuts. - Improved path handling for GUI applications on Windows to ensure proper environment variable inheritance. - Refactored auto-update logic in `main.ts` to streamline update checks and improve error handling. - Added new IPC handlers for managing pending file paths and improved file handling during application startup. - Updated `use-electron-menu` hook to handle additional menu structures and improve document loading logic. * chore: bump version to 0.3.1 and update project description - Updated version in package.json to 0.3.1. - Enhanced project description to highlight OpenPencil as the world's first open-source AI-native vector design tool featuring concurrent Agent Teams and Design-as-Code capabilities. - Refactored auto-updater to utilize constants for GitHub repository details, improving maintainability. - Introduced a new constants file to centralize shared values for the Electron application, enhancing code clarity and reducing duplication. - Updated various components to use new constants for port file handling and window dimensions, ensuring consistency across the application. * feat(ai): clarify mobile design guidelines and mockup usage - Updated design guidelines to emphasize that "mobile" requests should generate actual mobile-sized screens (375x812) instead of desktop mockups. - Added critical notes regarding the use of phone mockups, specifying they should only be used for marketing showcases and not for functional mobile screens. - Enhanced clarity on sizing and layout rules for mobile and web designs to ensure consistent application of design principles. * fix(canvas): improve text centering, layout inference, and Pencil format rendering - Resolve fit-content parent dimensions in computeLayoutPositions instead of using 0 (which caused negative available space and broken child positioning) - Reduce text width estimation minimum from 20px to 1px to fix centering of narrow single-character text in fixed-size centered frames - Add inferLayout() to detect padding-only frames as layout containers, so padding offsets are applied to children (fixes badge text ignoring padding) - Use Fabric's fontSize * 1.13 for single-line text height in centering calculations instead of fontSize * lineHeight - Add fontWeight propagation to text width/height estimation functions - Refine defaultLineHeight() tiers for better Pencil format compatibility - Support Pencil's singular `effect` property alongside `effects` array - Handle plain color strings in fill/stroke resolution for Pencil format - Add directional stroke rendering as synthetic border rectangles - Add icon_font node type rendering via lookupIconByName - Fix z-order reconciliation to use fresh canvas object map after text recreation - Fix canvas initialization race: defer reference tracking until canvas is ready - Resolve $variable references with circular reference guards * feat(types): add icon_font node type with panel and store support - Add IconFontNode type to pen.ts for icon_font nodes storing iconFontName - Extend property panel and icon section to recognize icon_font nodes - Add icon_font type icon in layer panel - Support icon_font in document tree utilities * feat(ai): improve design generation accuracy and validation - Add pre-validation pass to fix text with explicit pixel height to fit_content - Enhance validation tree dump with textGrowth and lineHeight fields - Update orchestrator prompts with structural patterns from Pencil analysis - Simplify role-resolver defaults to match Pencil conventions - Only force textGrowth=fixed-width on text >15 chars in streaming insertion * feat(ai): optimize generation pipeline and fix streaming layout - Disable LLM validation layer (pre-validation heuristics still run) - Remove visual-ref pipeline (3 fewer LLM calls per generation) - Compress sub-agent prompt and design principles (~70% smaller) - Remove width>480 guards so mobile gets root frame height expansion - Add gap field to orchestrator rootFrame format and guidance - Default icon_font nodes to lucide family in generation heuristics * feat(ai): load full Lucide icon set and default icon_font to lucide - Load all 1,729 Lucide icons as primary set (replaces 286 hand-picked) - Keep Feather as fallback for unmatched names - Default iconFontFamily to 'lucide' during .pen file normalization * feat(codegen): add icon_font support to all 8 code generators Output Lucide icon references instead of 'Unknown node' comments. React/RN use component syntax, HTML/Vue/Svelte use data-lucide, Flutter/SwiftUI/Compose use framework-native icon APIs. * feat(panels): replace product card quick action with food app homepage * feat(electron): implement preferences management and app storage abstraction - Introduced a new preferences management system in Electron, replacing localStorage with a JSON-based preferences file. - Added IPC handlers for getting, setting, and removing preferences, ensuring data persistence across sessions. - Created an app storage utility to provide a consistent API for accessing preferences in both Electron and web environments. - Updated various components and stores to utilize the new app storage system for improved data handling and synchronization. - Enhanced the initialization process to load preferences at startup, ensuring a seamless user experience. --------- Co-authored-by: Fini <fini.yang@gmail.com> |
||
|
|
d51510d7e9 |
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. |