90 Commits

Author SHA1 Message Date
wass08
bc57afb8fa collections + unify color picker 2026-03-06 13:08:23 +01:00
Aymeric Rabot
0edbc65e8d Update polygon-editor.tsx 2026-03-03 16:22:08 -05:00
Aymeric Rabot
48979ec014 fix raycaster layers, polygon drag, slider undo, and grid events
- Enable EDITOR_LAYER on R3F raycaster for proper hit detection
- Fix polygon editor drag using refs and direct position passing
- Handle pointercancel events and fix pointerId access in polygon editor
- Fix slider undo by reverting to start value before resuming temporal state
- Allow grid:move during camera drag so polygon editor works while panning
- Bump better-auth to ^1.5.2 and turbo to ^2.8.12
- Remove explicit return type on createAuth for better inference

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 14:41:19 -05:00
wass08
85232d6b0d hide tools from thumbnail 2026-03-02 10:10:58 +09:00
wass08
0f271985d8 take only building layers to the thumbnail 2026-03-02 10:01:22 +09:00
wass08
8e097537d0 fix duplicate door 2026-03-02 09:09:31 +09: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
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
wass08
1117e0cb5f prevent 0m long wall creation #103 2026-02-26 09:56:50 +09:00
Aymeric Rabot
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
wass08
27e4afb757 draft custom door 2026-02-25 13:28:42 +09:00
wass08
4be3291d64 vertical line ceiling 2026-02-25 10:46:41 +09:00
wass08
c53f1f9679 ceiling system + reveal/hide 2026-02-25 08:59:04 +09:00
wass08
aee8ac5e76 fix build 2026-02-24 16:16:07 +09:00
wass08
14708c041a fix tools visibility 2026-02-24 16:09:03 +09:00
wass08
49c4794ecb fix item scale surface 2026-02-23 12:41:55 +09:00
wass08
6581e25e9f handle better item scales 2026-02-23 11:11:22 +09:00
wass08
d15f601107 item scale 2026-02-23 10:59:42 +09:00
wass08
4555325389 fix wall items wrong level + elevation 2026-02-23 08:43:38 +09:00
wass08
d819249d07 fix level window tools 2026-02-20 18:34:49 +09:00
wass08
ce41228e58 fix level move / create item 2026-02-20 18:30:20 +09:00
wass08
33c81045bb duplicate item 2026-02-20 18:06:59 +09:00
wass08
96865a8ce7 window move tool + duplicate 2026-02-20 17:24:52 +09:00
wass08
e8fcc840d5 surface placement 2026-02-18 16:26:17 +09:00
wass08
c0676f684e item surfaces 2026-02-18 16:06:23 +09:00
wass08
5d61e60f95 free mode for slabs and ceiling 2026-02-18 14:00:28 +09:00
wass08
be013d26e5 window panel 2026-02-18 13:14:55 +09:00
wass08
dd5f63df64 wall tool draft 2026-02-17 16:22:45 +09:00
wass08
101db7b34d free placement 2026-02-17 13:22:17 +09:00
wass08
d833245fbf esc key cancel tool 2026-02-17 12:29:00 +09:00
wass08
e6442ad473 adding missing sounds 2026-02-16 09:31:34 +09:00
wass08
052efea2cb polished placements 2026-02-16 09:12:04 +09:00
wass08
13070a5630 ceiling holes 2026-02-16 08:59:28 +09:00
wass08
29e7fa09ef slab holes 2026-02-12 10:41:37 +09:00
wass08
ae3af4318e better placing tools 2026-02-12 10:17:22 +09:00
wass08
be7e86975e radio & sfx 2026-02-12 08:57:37 +09:00
wass08
80cb039f86 fix elevation for item creation 2026-02-10 13:48:58 +09:00
wass08
6ec6a55b05 fix elevation issue 2026-02-10 10:04:14 +09:00
wass08
9a838ae3c4 fix build 2026-02-09 16:14:39 +09:00
wass08
cba709cb81 bring back site edition + zindex fix 2026-02-09 16:11:50 +09:00
wass08
bfe685b011 fix polygon editor edition + events propagation 2026-02-09 13:38:12 +09:00
wass08
f2c1da1655 simplify poligon editor / boundaries editor 2026-02-09 12:48:35 +09:00
wass08
81f132611e remove custom raycasters 2026-02-09 12:23:38 +09:00
Aymeric Rabot
7a871be792 Add slab polygon editing with drag, add, and delete vertices
Reuse the shared PolygonEditor for slab boundary editing with levelY
and surfaceHeight support. Handles render as 3D cylinders that adapt
to slab thickness. Prevent deselection after drag by suppressing
grid:click propagation, and reset preview state on undo/redo.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 14:49:53 -05:00
Aymeric Rabot
31a560e2c5 Use raycast cursor & level Y fallback
Ceiling and slab tools: switch cursor tracking to per-frame raycasting onto a level plane (useFrame) instead of relying on grid:move events, and memoize Raycaster/Plane to reduce allocations. Update line geometry updates to be performed imperatively from the frame loop, ensure previews only trigger React updates when the snapped display position changes, and keep cursor/preview snapping consistent with user-visible pointer. Add sceneRegistry-based fallback to resolve a level's Y position (used by Grid, CeilingTool and SlabTool) when the level mesh isn't registered yet, computing Y from level node data and viewer levelMode. Misc: import/add necessary three.js types and small refactors to visibility/reset logic.
2026-02-07 11:58:17 -05:00
wass08
74b70b7877 wall snapping to 45° 2026-02-05 15:20:21 +09:00
wass08
40e3ce8d84 site boundary editor 2026-02-05 15:07:49 +09:00
wass08
73dfac795a fix placement 2026-02-02 11:39:38 +09:00
wass08
72a0e3952a slab panel 2026-02-02 11:17:47 +09:00
Aymeric Rabot
6c99851006 Refactor asset types and improve UI primitives
Replaces usage of the Asset type with AssetInput across editor components and hooks for consistency with core types. Adds default dimensions fallback for asset placement logic. Refactors UI primitives (button, sidebar, opacity control) to support forwarding refs and asChild prop, and updates imports for primitives. Updates Radix UI dependencies in package.json and bun.lock.
2026-01-30 22:01:25 -05:00