Commit Graph
505 Commits
Author SHA1 Message Date
Wassim SAMADandGitHub 4b94f6121a Merge pull request #128 from pascalorg/fix/remove-is-editor
Fix/remove is editor
2026-03-02 08:55:10 +09:00
wass08 f17e0cb955 fix dot color 2026-03-02 08:53:34 +09:00
wass08 882d3fec7e remove is editor completely 2026-03-02 08:50:53 +09:00
wass08 d81a48d64e remove isEditor for site-edge-labels 2026-03-02 08:35:16 +09:00
f1d0d3a78c feat(editor): redesign panel UI with shared control components (#127)
Extract reusable control components (SliderControl, MetricControl, SegmentedControl,
ToggleControl, ActionButton, PanelSection) and PanelWrapper to reduce duplication
across all property panels. Net reduction of ~500 lines.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 02:35:19 -05:00
Aymeric Rabot 2ddf10f3f0 Play SFX when placing doors and windows
Add audio feedback for item placement by importing sfxEmitter and emitting 'sfx:item-place' in DoorTool and WindowTool. This change triggers a placement sound when a door or window node is created, improving UX by confirming successful placement.
2026-02-28 01:39:35 -05:00
Aymeric Rabot 7dde5dc578 Update ground-occluder.tsx 2026-02-28 01:34:41 -05:00
bde8a005a7 feat(viewer): redesign viewer UI with dark toolbar and camera controls (#126)
Overhaul viewer overlay with a unified bottom toolbar, dark theme support,
theme toggle, camera orbit/top-view controls, and fix TypeScript array
access errors for level and wall mode cycling.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 01:28:37 -05:00
98c1d5247e feat: filter empty projects from public gallery (#125)
* feat(community): filter empty projects from public gallery

Add is_empty column to projects table so the public gallery only shows
projects with actual content. Scene graph emptiness is computed on save
and on creation, and a backfill migration marks existing non-empty
projects. Also cleans up import ordering, fixes README migration path,
and removes stale feedback table migration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Use ESNext modules and bundler resolution

Update packages/db tsconfig to emit ESNext modules and use 'bundler' moduleResolution. This enables modern ESM output and bundler-style resolution for the db package (keeps outDir and rootDir unchanged).

* feat(editor): add dark mode theme and grid visibility toggle

Add theme state to viewer store with light/dark modes, dark-aware
lighting and background colors, grid show/hide toggle in settings,
and theme toggle buttons in the sidebar.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add ground occluder, animated lighting & UI tweaks

Introduce a ground occluder and smoother animated lighting while adjusting editor UI and icons. Viewer: add GroundOccluder (uses polygon-clipping to union slab/zone polygons) and AnimatedBackground, integrate both into the Canvas; improve Lights to interpolate intensities/colors/ambient for smooth theme transitions. Editor: refactor sidebar header to support inline project title editing and move the theme toggle; replace some lucide icons with image assets and add a settings icon (apps/editor/public/icons/settings.png). Also add polygon-clipping to the viewer package dependencies.

* Update dark mode background color and clean up imports

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 23:49:48 -05:00
Aymeric Rabot 5077011c26 Initialize WebGPU renderer before post-processing
Make the gl prop synchronous and move/await renderer initialization inside the post-processing component. index.tsx: remove async gl factory and the await renderer.init() so renderer is created synchronously. post-processing.tsx: add isInitialized state, an async initRenderer that calls renderer.init(), and guard post-processing setup until init completes (with mounted cleanup and updated effect deps). This ensures the WebGPU renderer is fully initialized before building the render pipeline and avoids using an async gl factory.
2026-02-27 14:28:31 -05:00
Aymeric RabotandClaude Opus 4.6 64de2a8e63 feat(editor): direct-to-Supabase uploads with progress for large scans
Upload files directly to Supabase Storage via signed URLs, bypassing
the Next.js 100MB body size limit. Supports scans up to 200MB with
real-time progress tracking that persists across sidebar panel switches.

- Add Zustand upload store for persistent upload state
- Add createAssetUploadUrl/confirmAssetUpload server actions
- Add XHR-based upload orchestrator with progress events
- Scene node creation works even if sidebar panel unmounts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 14:19:06 -05:00
Aymeric RabotandClaude Opus 4.6 77f41ba8b7 fix(db): add missing drizzle metadata for storage buckets migration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 13:15:21 -05:00
Aymeric Rabot 18307761b5 Revert "chore(editor): remove instrumentation.ts bucket creation logic"
This reverts commit da3168ccb8.
2026-02-27 12:58:18 -05:00
Aymeric Rabot da3168ccb8 chore(editor): remove instrumentation.ts bucket creation logic
Made-with: Cursor
2026-02-27 12:43:09 -05:00
Aymeric Rabot efa97444f6 fix(db): create missing storage buckets in migration
Made-with: Cursor
2026-02-27 12:39:59 -05:00
Aymeric RabotandClaude Opus 4.6 31c09bacdd Fix scan/guide visibility with per-project preferences
- Store showScans/showGuides preferences per project so toggling
  persists when switching between projects
- Apply showGuides/showScans directly on guide and scan renderer groups
- Set projectId in both editor and viewer pages on mount

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 01:38:10 -05:00
Aymeric RabotandClaude Opus 4.6 d0e0fe7e1e UX polish round 4: action button component, keyboard shortcuts dialog, and build fixes
- Add reusable ActionButton component with tooltip and shortcut display
- Add keyboard shortcuts dialog in settings panel
- Fix ButtonProps import error (derive type from Button component)
- Fix AnyNodeId type mismatch in tree-node-actions visibility toggle
- Various UI refinements across action menu, sidebar, and editor

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 01:19:13 -05:00
5ecefbdc06 Feat/ux round 3 (#124)
* Tree: add isLast prop & draw connectors

Introduce an optional isLast prop across all site panel tree node components and TreeNode so children know when they're the last sibling. TreeNodeWrapper now renders vertical and horizontal connector lines (adjusted by depth and isLast) and keeps the toggle button clickable (z-index). Children are passed isLast when mapped, so the UI can stop the vertical line for final siblings. Also bump several deps in apps/editor package.json and update the lockfile accordingly.

* chore: clean up monorepo dependencies and update packages

Move app/library dependencies out of root package.json into their
respective workspaces. Root now only contains monorepo tooling
(turbo, biome, supabase CLI, typescript, portless, ultracite).

Updates:
- next 16.1.0 → 16.1.6
- drizzle-orm ^0.39.0 → ^0.45.1
- drizzle-kit ^0.30.0 → ^0.31.9
- drizzle-zod ^0.5.1 → ^0.8.3
- three-bvh-csg ^0.0.17 → ^0.0.18
- supabase 2.75.3 → 2.76.15
- typescript 5.9.2 → 5.9.3 (all workspaces)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Use semantic theme tokens and enable dark mode

Replace hardcoded zinc color classes with semantic design tokens (text-muted-foreground, text-foreground, border, bg-background, bg-border) across the action menu, camera controls, control modes, and view toggles for consistent theming. Update separators and borders to use bg-border/border-border. Add useEffect in the editor root to add/remove the 'dark' class on document.body and apply 'dark text-foreground' to the root container so the UI renders in dark mode; also import useEffect.

* Persistable sidebar width & resizer

Introduce a zustand store to persist sidebar width (key: `sidebar-preferences`) and track dragging state. Default width is 288px (18rem) and is clamped between 288 and 800px. Wire the store into SidebarProvider to drive the CSS variable for width and expose a data-dragging attribute. Add a SidebarResizer component that handles pointer events to resize the sidebar, toggles dragging state, updates cursor/user-select, and disables transitions while dragging. Small class and structure adjustments ensure the resizer is rendered and resizing behaves smoothly.

* Editor: floating action menu, selection/phase tweaks

Add a FloatingActionMenu (move/duplicate/delete) that attaches to selected 3D nodes and integrates with editor/viewer state; includes new cursor SVG and layout wrapper to use the custom cursor. Improve selection and phase behavior: auto-select first building+level on scene load (moved/centralized in project scene hook and editor init), add resolveBuildingId helper, and enhance SelectionManager to auto-switch between structure/furnish based on clicked nodes and to preserve building/level context when changing selection. Update sidebar tree node click handlers to switch phases for structural vs item nodes and stop hiding nodes by phase (keep tree items visible across phases). Add keyboard escape behavior to clear selections while keeping building/level context and reset selected reference. Misc: register unified event listeners for selection, position floating menu over objects using three.js Box3, and various small integration fixes.

* Add SceneLoader, loading states & editor fixes

Add a SceneLoader component and associated CSS loader styles and wire it into Editor, Viewer and page-level flows so a loading UI displays while project/scene data loads. Replace useLayoutEffect in editor page with a client-mounted useEffect guard to avoid hydration issues. Introduce isSceneLoading state and setter in the project store and set/clear it in useProjectScene; include sceneGraph when creating a new project and clear the scene beforehand.

Other changes: type-guard moving/duplicating logic in FloatingActionMenu and remove duplicated id on clones; refactor auto-selection logic for site/building/level and auto-select build/wall for empty levels in editor index and useProjectScene; optimize ZoneSystem to run per-frame (useFrame) and reduce unnecessary updates to visibility/label positions; add animated active background for layer toggle (motion) in site panel; add keyboard shortcuts to jump between levels (Ctrl/Cmd+ArrowUp/Down); simplify community-hub project-created handler to navigate straight to editor. These changes improve UX during load, enforce safer node operations, and optimize runtime rendering.

* Improve selection logic and refine UI components

Multiple editor and viewer updates:

- Selection: enhance selection-manager to support modifier (Meta/Ctrl) multi-select, compute next selection logic, track modifier keys, prevent grid deselect races, and add debug logs. Adapted selection handlers throughout scene/editor components to pass native events and modifier state.

- Sidebar / Site panel: refactor site panel to inline a LevelReferences UI (replacing the removed references dialog). Add upload flow for scan (.glb/.gltf) and guide images, handling file size/type checks, project asset upload/delete calls, and per-level reference lists. Add MultiSelectionBadge for showing/clearing multi-selection and animated expand/collapse for levels. Several tree-node components now use a shared handleTreeSelection helper and propagate click events properly.

- UI polish & icons: change dark theme color tokens for better contrast; increase button sizes and icon sizes across action menus; swap some lucide icons for image assets (rotate, topview, select, build, mesh, floorplan, level, etc.) and add new public icons.

- PascalRadio: replace popover with a framer-motion expandable panel, add outside-click handling, animated transitions, and minor UI tweaks.

- Other: minor viewer hook/selection-manager updates and tweaks to control modes and view toggles to support image icons and consistent sizing.

These changes improve multi-select reliability, user interactions in the sidebar, and overall visual polish with new icons and animations.

* Fix TypeScript build errors in selection-manager and scene-loader

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 22:09:40 -05:00
441517424d Feat/ux polish round2 (#123)
* Polish editor UI, radio, and state logic

Multiple UI and state updates across the editor and viewer:

- PascalRadio: Move radio play state into audio store (isRadioPlaying), update icons/behaviors (Volume2/VolumeX), remove autoplay UI, ensure pause/resume respects muted and radio playing state.
- use-audio: Add isRadioPlaying, setRadioPlaying and toggleRadioPlaying to store; initialize state accordingly.
- Action menu: Add layout/motion to container, refine transition, only show furnish/structure rows in build mode, tweak transition classes and hover/opacity behavior.
- Furnish/Structure tools: Simplify inactive styling, change click behavior to only select tools (no direct deselect), remove "click to deselect" tooltip text.
- Sidebar/Icon rail: Update logo link styling and image sizing; AppSidebar: add inline editable project title (optimistic local update + server update via updateProjectName), keyboard handling, and minor header layout changes.
- Site panel: Add visual tree/branch lines, replace some icons, reorganize levels list and provide an Add level button, adjust spacing and layout for property/levels sections.
- InlineRenameInput: Small height/spacing adjustments for inline inputs.
- use-editor: Reset mode to 'select' when switching phases, ensure reasonable default tools when entering build mode, simplify setStructureLayer to reset mode/tool and viewer selection.
- use-viewer: Improve selection hierarchy guard so children are only reset when not explicitly provided in updates.

These changes improve UX consistency, state predictability when switching modes, and add inline project renaming with optimistic update.

* Introduce isEditor mode and editor UX updates

Add an isEditor flag (Viewer prop + store) and wire it from the Editor to enable editor-specific behaviors. Ceiling system: show ceiling grids per-level (or when ceiling tool active) by walking node ancestry and respecting active level/selection. Zone renderer: only show site edge labels in editor and add inline editable zone names (with hover/edit UI and save/escape handling). Auto-name new walls/doors/windows (incremental counts scoped by level) and simplify default names shown in various panels/tree nodes. Sidebar/site-panel: reverse level rendering, adjust tree-line styling, auto-expand parents when descendants are selected, and refactor zone row actions (camera view/capture/clear). UI polish: updated action-menu button styles and ensure keyboard shortcut 'b' switches to build mode. Misc: various tree node and item selection/hover improvements and minor refactors to support the above.

* Fix sidebar flex layout and scrolling

Adjust sidebar panel flexbox classes to ensure headers/controls don't collapse and content areas scroll correctly. Changes include adding shrink-0, flex-1 and min-h-0 to BuildingItem and buildings list containers, restructuring the active building panel so LevelsSection/LayerToggle are fixed height while ContentSection gets an overflow-y-auto scroll area, and making the site header non-shrinking with conditional overflow for the main panel when phase === "site". Uses the cn helper for conditional classes.

* Fix TypeScript build errors with AnyNodeId indexing and type narrowing

Cast string-typed node IDs and parentIds to AnyNodeId when indexing
into the nodes Record, fix motion transition type literal, and remove
redundant mode check in setMode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 01:05:34 -05:00
Wassim SAMADandGitHub 7681e79d59 Merge pull request #122 from pascalorg/fix/scale-not-defined
fix scale not defined
2026-02-26 13:16:59 +09:00
wass08 01d4a28e56 fix scale not defined 2026-02-26 13:14:52 +09:00
Wassim SAMADandGitHub bb2757f769 Merge pull request #121 from pascalorg/fix/pass-issues-and-polish
Fix/pass issues and polish
2026-02-26 12:23:32 +09:00
wass08 552beb1194 select by default first level / building & structure 2026-02-26 12:21:03 +09:00
wass08 8345e42119 removed non logged in editor 2026-02-26 12:04:12 +09:00
wass08 48d84e5cd9 redirect to project 2026-02-26 09:56:50 +09:00
wass08 c77381a59a fix deletion of assets on delete ref and delete proj 2026-02-26 09:56:50 +09:00
wass08 b167702bca store reference assets on supabase 2026-02-26 09:56:50 +09:00
wass08 1117e0cb5f prevent 0m long wall creation #103 2026-02-26 09:56:50 +09:00
09e212ad40 feat: Esc exits build mode back to select mode (#120)
When in build mode, pressing Escape now switches back to select mode
in addition to canceling any in-progress tool operation.

Requested by Julien.

Co-authored-by: Anton Pascal <anton-pascal@users.noreply.github.com>
2026-02-25 18:25:12 -05:00
48d5091bb3 UX polish: selection behavior, styling, and site panel improvements (#119)
* Remove .env.local guard; add portless dep

Remove the check that blocked a local .env.local in apps/editor's dev script and simplify the dev startup to source the root .env. Add portless@^0.4.2 to the project dependencies in package.json. Lockfile updated accordingly.

* Improve tool cursors, previews, and contextual tools

Revamp editor tool visuals and behaviour: replace mesh cursors with a new CursorSphere Group (adds ground marker, vertical indicator and optional tool icon tooltip), unify preview colors to #818cf8, add ground-level previews and ghost lines for ceiling and roof tools, and update slab/zone/wall visuals to match. Add automatic build-mode switching and contextual highlighting for structure tools via a new useContextualTools hook, and relax action-menu visibility checks so tool rows are shown even when not in build mode. Minor typing/import adjustments and small opacity/placement tweaks across multiple tool components.

* Keep tools active and refine action-menu styles

Stop auto-deactivating tools in RoofTool and ZoneTool by removing setTool(null) (and setMode('select') in roof). Add hasActiveTool checks and small layout padding to FurnishTools and StructureTools, and update button classes to improve visual emphasis: smoother transitions, stronger active rings/scale, and dimming/grayscale of non-active tools when another tool is active. These changes improve UX by keeping the selected tool active and giving clearer visual feedback in the action menu.

* Improve selection behavior and refresh UI styling

SelectionManager: add global enter/leave/double-click handlers to support cross-phase hovering and auto-switching into structure/furnish on double-click; normalize click handling (explicitly coalesce shiftKey). Remove per-strategy enter/leave listeners.

UI panels & controls: unify and modernize styles across many panels (ceiling, door, item, reference, roof, slab, wall, window) and action buttons — rounded-md, neutral borders, subtle shadows, translucent headers and consistent hover/focus states. Update view toggles icons and toggle styling.

NumberInput: integrate @number-flow/react NumberFlow for formatted value display, add visual drag progress indicator and refine input/label interactions and styling.

Sidebar: replace rename-popover with inline-rename-input and update tree nodes to use inline editing. Add slider-demo and tweak slider implementation. Update package.json accordingly.

* Use Barlow font across editor UI

Add the Google Barlow font and expose it as a CSS variable, update theme font variables in globals.css, and apply the new font across the editor UI. Imports: add Barlow in app/layout.tsx and include its variable on <html>, set body to use font-sans. Apply font-barlow or font-mono classes to headings, labels, numeric readouts and buttons across multiple panels and primitives to standardize typography. Also update button base variant to include font-barlow. Remove the PhaseSwitcher component and its import/usage from the action menu.

* Replace button wrapper with div in LevelItem

Replace the outer <button> around the LevelItem content with a <div> to avoid nesting interactive button elements (and the resulting invalid HTML/interaction issues). Preserves the original classes and onClick/onDoubleClick handlers so behavior remains the same and allows the PopoverTrigger/button children to function correctly.

* Refine site panel list styles and spacing

Update the SitePanel and TreeNode UI to use compact, border-bottom list rows instead of rounded, card-like items. Simplified active/hover states to use bg-accent variants and reduced shadow/ring styles for a cleaner look. Adjusted paddings (pl/px/py) and container layouts (many sections switched to flex-col) and increased tree node indent/paddingRight for consistent alignment. These changes unify spacing and visual hierarchy across levels, buildings, zones and tree nodes.

* Add auto-scroll to selected items and refine icon styles

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 18:05:02 -05:00
94e5f37983 fix: create project-thumbnails bucket in instrumentation.ts (#118)
The thumbnail upload (uploadProjectThumbnail) writes to a
'project-thumbnails' storage bucket, but instrumentation.ts only
bootstrapped the 'avatars' bucket.  This caused:

  Upload failed: Bucket not found

Add the missing bucket creation with matching constraints (public,
10 MB limit, image/png only).  Also refactor the bucket-exists check
to use a Set so it scales cleanly as more buckets are added.

Co-authored-by: Anton Pascal <anton-pascal@users.noreply.github.com>
2026-02-25 12:22:10 -05:00
Wassim SAMADandGitHub 157b323c0d Merge pull request #117 from pascalorg/feat/polish-editing-experience
Feat/polish editing experience
2026-02-25 16:13:20 +09:00
wass08 d3ef5fc08a door panel 2026-02-25 16:10:21 +09:00
wass08 ced76b0475 fix placement 2026-02-25 15:21:19 +09:00
wass08 b114e60df7 fix hinge + materials 2026-02-25 14:50:17 +09:00
wass08 7608cad748 nice progress on doors 2026-02-25 14:05:32 +09:00
wass08 27e4afb757 draft custom door 2026-02-25 13:28:42 +09:00
wass08 d9317bfba2 automated thumbnail + position enhancement 2026-02-25 12:43:14 +09:00
wass08 4be3291d64 vertical line ceiling 2026-02-25 10:46:41 +09:00
wass08 53ed21ba0b fixed ceiling item not selectable in viewer 2026-02-25 09:33:31 +09:00
wass08 8a0c7d31cc default scale top grid ceiling for viewer 2026-02-25 09:28:47 +09:00
wass08 31927da543 event handlers for ceiling 2026-02-25 09:25:00 +09:00
wass08 c53f1f9679 ceiling system + reveal/hide 2026-02-25 08:59:04 +09:00
wass08 9b9398c5ff remove ceiling from depthcalc 2026-02-25 07:35:03 +09:00
Wassim SAMADandGitHub 2182fe535d Merge pull request #116 from pascalorg/fix/community-feedback-pass-3
Fix/community feedback pass 3
2026-02-24 16:17:44 +09:00
wass08 aee8ac5e76 fix build 2026-02-24 16:16:07 +09:00
wass08 63cf407cac persist viewer preferences 2026-02-24 16:13:37 +09:00
wass08 14708c041a fix tools visibility 2026-02-24 16:09:03 +09:00
wass08 81ede241d5 save site + camera build position 2026-02-24 14:48:59 +09:00
Aymeric RabotandGitHub db05c86120 Add scene graph viewer and persist migration (#115)
Render an interactive Scene Graph in the Settings panel using @visual-json/react. Introduces SceneNode/SceneGraphNode types and buildSceneGraphValue to build a tree (handles missing nodes and cycles), and adds handlers to block drag/drop/context/delete mutations inside the viewer. Adds @visual-json/react to apps/editor package.json and updates the dev script to forbid .env.local and source the root .env instead. Also adds a persistence migration in use-scene to preserve existing nodes and rootNodeIds when the persist version changes.
2026-02-24 00:40:18 -05:00