81 Commits

Author SHA1 Message Date
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
wass08
fe4ca47193 fix furnish node 2026-01-30 10:13:14 +09:00
wass08
9501971c80 fix drag zone issue 2026-01-29 13:25:16 +09:00
wass08
f1a61350c7 roof 2026-01-29 12:52:35 +09:00
wass08
f4125db6a8 control bar 2026-01-29 10:14:40 +09:00
wass08
247180ebf9 push item when placing 2026-01-29 07:27:07 +09:00
wass08
10ef50f186 fix attach items 2026-01-29 07:17:25 +09:00
wass08
3b690038d7 move tool undo stack 2026-01-28 11:43:35 +09:00
wass08
82a18de88c move + item corrections 2026-01-28 10:54:12 +09:00
wass08
f50f7d105b fix undo / redo for item tool 2026-01-28 09:21:08 +09:00