diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..101d939 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,18 @@ +.git +.github +.codex +.codex-run +.codex-remote-attachments +node_modules +**/node_modules +.next +**/.next +**/.next-export +apps/web/out +coverage +playwright-report +test-results +tests +docs +*.log +*.tsbuildinfo diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index d83c0f8..315c173 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -35,3 +35,7 @@ The app runs at `http://127.0.0.1:3000/` by default. - Keep UI behavior local to the relevant component unless the behavior is shared. - Use TypeScript types instead of loose object shapes where practical. - Keep comments short and useful. + +## Contribution Licensing + +Unless explicitly agreed otherwise in writing, by submitting a contribution you license it under the MIT License. See [LICENSE](../LICENSE). diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 244c124..21f2f15 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -4,10 +4,15 @@ on: push: branches: - main - - '**' + workflow_dispatch: + +concurrency: + group: docker-publish-${{ github.ref }} + cancel-in-progress: true jobs: build: + timeout-minutes: 30 permissions: packages: write contents: read @@ -16,9 +21,6 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -40,11 +42,13 @@ jobs: type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} - name: Build and Push Docker Image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . file: deploy/docker/Dockerfile platforms: linux/amd64,linux/arm64 push: true tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha,scope=sketchforge-docker + cache-to: type=gha,mode=max,scope=sketchforge-docker diff --git a/.gitignore b/.gitignore index c6b403a..1f93e4f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ node_modules/ # Next.js .next/ +.next-export/ out/ build/ dist/ @@ -32,6 +33,7 @@ playwright-report/ # Local workspace state .codex/ +.codex-run/ .codex-remote-attachments/ # OS/editor noise diff --git a/README.md b/README.md index 43c9cda..76022a2 100644 --- a/README.md +++ b/README.md @@ -17,12 +17,13 @@
- + ## Why SketchForge @@ -275,40 +276,6 @@ Build a static export: npm run export ``` -## Project Layout - -```text -apps/web/ Next.js app workspace -apps/web/src/app/ App routes, dashboard, API routes, styles -apps/web/src/components/ Editor, viewport, sidebar, icons, controls -apps/web/src/types/ Shared shape and editor types -apps/web/src/generated/ Generated Manifold runtime source -apps/web/src/lib/ Shared utilities -apps/web/public/assets/ Static app images, icons, logos, shape assets -scripts/ Build and local automation helpers -docs/media/ README screenshots and demo videos -docs/mcp/ MCP client configuration examples -docs/skills/ Optional AI-agent skill bundles -deploy/docker/ Docker, Compose, and Nginx deployment files -.github/ Issue templates and community files -``` - -## Current Status - -SketchForge is alpha, but the core editor loop is usable today: - -- create and reopen local projects -- add, move, resize, rotate, mirror, align, duplicate, hide, and delete shapes -- switch shapes between solid and hole modes -- group and ungroup geometry -- apply and remove chamfer/fillet edge treatments -- import STL files -- import and export STEP files -- export STL or OBJ -- generate project thumbnails - -The next big areas are workflow polish, more geometry edge-case testing, stronger automated editor coverage, and better release documentation. - ## Contributing Contributions are welcome. Good places to help: diff --git a/apps/web/next.config.ts b/apps/web/next.config.ts index f714ce3..03ded85 100644 --- a/apps/web/next.config.ts +++ b/apps/web/next.config.ts @@ -29,8 +29,8 @@ const nextConfig: NextConfig = { ...(isStaticExport ? { output: "export" as const, + distDir: ".next-export", trailingSlash: true, - assetPrefix: "./", } : {}), }; diff --git a/apps/web/src/app/globals.css b/apps/web/src/app/globals.css index 279ef7c..2766c4e 100644 --- a/apps/web/src/app/globals.css +++ b/apps/web/src/app/globals.css @@ -2797,36 +2797,111 @@ button { .camera-controls { position: absolute; top: 173px; - left: 8px; + left: 10px; z-index: 8; - display: grid; - gap: 4px; + display: flex; + flex-direction: column; + gap: 2px; + padding: 5px; + background: rgba(255, 255, 255, 0.86); + border: 1px solid rgba(194, 209, 219, 0.9); + border-radius: 17px; + box-shadow: 0 10px 30px rgba(32, 64, 84, 0.14), 0 2px 6px rgba(32, 64, 84, 0.08); + backdrop-filter: blur(14px) saturate(1.15); } .camera-controls button { + position: relative; display: grid; - width: 51px; - height: 51px; + width: 44px; + height: 43px; place-items: center; color: #173b5a; - background: rgba(255, 255, 255, 0.88); - border: 1px solid #dfe6eb; - border-radius: 999px; - box-shadow: 0 1px 2px rgba(30, 50, 70, 0.08); + background: transparent; + border: 1px solid transparent; + border-radius: 12px; + box-shadow: none; cursor: pointer; + transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease, transform 140ms ease; } .camera-controls button:hover { - color: #000; - border-color: #c4d2dc; + color: #071f32; + background: rgba(223, 239, 247, 0.82); + border-color: rgba(155, 190, 207, 0.7); + transform: translateX(1px); +} + +.camera-controls button:focus-visible { + outline: 2px solid #28a9d2; + outline-offset: 1px; +} + +.camera-controls.collapsed { + border-radius: 17px; } .camera-controls button.active, .camera-controls button[aria-pressed="true"] { - color: #007eae; - background: #e8f8fd; - border-color: #63cbe8; - box-shadow: 0 0 0 3px rgba(0, 159, 207, 0.14), 0 1px 2px rgba(30, 50, 70, 0.08); + color: #006b94; + background: #def5fb; + border-color: #6fc8df; + box-shadow: inset 3px 0 0 #079bc6; +} + +.ruler-control-group { + position: relative; + margin-top: 6px; +} + +.ruler-control-group::before { + position: absolute; + top: -5px; + right: 8px; + left: 8px; + height: 1px; + content: ""; + background: rgba(117, 144, 160, 0.28); +} + +.ruler-tool-popover { + position: absolute; + top: 2px; + left: calc(100% + 10px); + display: flex; + gap: 3px; + padding: 4px; + background: rgba(255, 255, 255, 0.94); + border: 1px solid rgba(194, 209, 219, 0.94); + border-radius: 13px; + box-shadow: 0 8px 24px rgba(32, 64, 84, 0.18), 0 2px 6px rgba(32, 64, 84, 0.1); + backdrop-filter: blur(14px) saturate(1.15); + animation: ruler-tools-in 130ms ease-out; +} + +.camera-controls .ruler-tool-popover button { + width: 35px; + height: 35px; + border-radius: 9px; +} + +.camera-controls .ruler-tool-popover .ruler-delete-button.active { + color: #b42318; + background: #fff0ee; + border-color: #ee9b92; + box-shadow: inset 3px 0 0 #dc3f36; +} + +@keyframes ruler-tools-in { + from { + opacity: 0; + transform: translateX(-4px) scale(0.96); + } + + to { + opacity: 1; + transform: translateX(0) scale(1); + } } .workplane-wrap { @@ -2870,6 +2945,11 @@ button { cursor: crosshair; } +.workplane-wrap.ruler-delete-mode .three-workplane-host, +.workplane-wrap.ruler-delete-mode .three-workplane-host:active { + cursor: default; +} + .workplane-wrap.modifier-edge-pick .three-workplane-host, .workplane-wrap.modifier-edge-pick .three-workplane-host:active { cursor: crosshair; @@ -2909,6 +2989,7 @@ button { stroke-width: 2; vector-effect: non-scaling-stroke; pointer-events: none; + transition: stroke 120ms ease, stroke-width 120ms ease; } .ruler-segment-hit { @@ -2930,6 +3011,19 @@ button { .ruler-point { pointer-events: all; cursor: pointer; + transition: fill 120ms ease, stroke 120ms ease, filter 120ms ease; +} + +.ruler-overlay.delete-mode .ruler-segment-group:hover .ruler-segment { + stroke: #dc3f36; + stroke-width: 3; + filter: drop-shadow(0 0 2px rgba(220, 63, 54, 0.3)); +} + +.ruler-overlay.delete-mode .ruler-point:hover { + fill: #fff0ee; + stroke: #dc3f36; + filter: drop-shadow(0 0 3px rgba(220, 63, 54, 0.36)); } .ruler-point.pending { @@ -4255,6 +4349,14 @@ button { font-weight: 700; } +.workspace-global-note { + margin: -10px 0 0 153px; + color: #718697; + font-size: 12px; + font-weight: 650; + line-height: 1.45; +} + .workspace-dimensions { display: grid; grid-template-columns: 1fr 1fr; diff --git a/apps/web/src/app/layout.tsx b/apps/web/src/app/layout.tsx index bf5d35e..6328b61 100644 --- a/apps/web/src/app/layout.tsx +++ b/apps/web/src/app/layout.tsx @@ -16,7 +16,7 @@ export default function RootLayout({ children: React.ReactNode; }>) { return ( - + {children} ); diff --git a/apps/web/src/app/page.tsx b/apps/web/src/app/page.tsx index 574c6aa..76cbb41 100644 --- a/apps/web/src/app/page.tsx +++ b/apps/web/src/app/page.tsx @@ -2,10 +2,10 @@ import { Clock3, EllipsisVertical, FileUp, Grid3X3, HomeIcon, List, Pencil, Plus, Search, Settings, SlidersHorizontal, Trash2, X } from "lucide-react"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; -import { SketchForgeEditor, importedShapeFromStl } from "@/components/SketchForgeEditor"; +import { SketchForgeEditor, importedShapeFromStl, importedShapeFromSvg } from "@/components/SketchForgeEditor"; import { createLocalId } from "@/lib/localIds"; import { importExtensionSupported } from "@/lib/stlImport"; -import { DEFAULT_SNAP_GRID, DEFAULT_WORKPLANE_WORKSPACE, normalizeSnapGrid, normalizeWorkspaceSettings } from "@/lib/workplaneSettings"; +import { DEFAULT_SNAP_GRID, DEFAULT_WORKPLANE_WORKSPACE, normalizeSnapGrid, normalizeWorkspaceSettings, workplaneSettingsFingerprint } from "@/lib/workplaneSettings"; import type { GridSize, WorkplaneShape, WorkplaneWorkspaceSettings } from "@/types/sketchforge"; type AppView = "dashboard" | "editor"; @@ -236,7 +236,7 @@ function newProject(name: string, index: number, shapeCount = 0): DashboardProje } function projectNameFromFileName(fileName: string) { - return fileName.replace(/\.[^.]+$/, "").trim() || "Imported STL design"; + return fileName.replace(/\.[^.]+$/, "").trim() || "Imported design"; } export default function Home() { @@ -255,11 +255,18 @@ export default function Home() { const [dashboardNotice, setDashboardNotice] = useState(""); const [projectShapesById, setProjectShapesById] = useState