58 Commits

Author SHA1 Message Date
L'électron rare a4a4f16641 feat: 3d part previews in parts bar
Context: the parts bin showed flat coloured glyphs for each piece,
unlike the vanilla builder which previews the real LDraw geometry.

Approach: add a single shared offscreen WebGLRenderer in ldraw.js
(renderPartThumbnail) that reuses the cached LDraw template via
buildPartObject, renders the piece once into a 96x96 canvas from a
3/4 view with soft lighting, and exports a PNG data URL cached per
part key. No live mini-scene, one render per type.

Changes:
- ldraw.js: shared offscreen renderer/scene/camera built lazily,
  per-type data-URL cache, throwaway-object disposal, and a
  disposeThumbnailRenderer teardown. Degrades to null on failure.
- PartsBar: fetch thumbnails on mount, show <img> when ready, keep
  the glyph as fallback, dispose the renderer on unmount.
- styles.css: .PartThumb sizing inside the part card.

Impact: each piece now shows a real 3D preview; names and the active
border are preserved; no WebGL leak on unmount; graceful fallback
when WebGL is unavailable.
2026-06-13 18:56:55 +02:00
L'électron rare e31c9095e7 i18n: french color label
Translate the remaining English "Color" label in the edit panel's
colour picker to "Couleur", matching the already-French controls
("Tourner", "Créer"/"Modifier").
2026-06-13 18:56:44 +02:00
L'électron rare e3594c9ea2 feat: undo redo object history
Restore working undo/redo after the liveblocks removal left
room.history as a no-op.

- Add a client-local past/future stack in the store. recordHistory()
  snapshots bricks before each user mutation (place / delete / colour);
  undo/redo rewrite bricks, so the result fans out to peers through the
  normal storage sync. History is capped to avoid unbounded growth.
- Wire the BottomBar undo/redo buttons and Ctrl+Z / Ctrl+R shortcuts.
- Import DEFAULT_PART and friends from the leaf util modules instead of
  the ../utils barrel: the barrel also pulls in hooks.js, which imports
  the store back, and that cycle let the store body run before ldraw.js
  finished initialising, throwing "Cannot access 'DEFAULT_PART' before
  initialization" in the built bundle.
2026-06-13 18:43:52 +02:00
L'électron rare 529e74c1a6 feat: ldraw lego parts in builder
Add the real LDraw LEGO parts (LeoCAD-style) as the posable objects.

- Vendor the curated 15-part LDraw closure under public/ldraw so it is
  served at /blocs-pro/ldraw/ after build (CC BY 4.0, credits kept).
- src/utils/ldraw.js loads each part via three's LDrawLoader, caches the
  geometry per type, applies the LDU->world scale and Y flip to match the
  existing grid, and tints surfaces with the active colour.
- A LeoCAD-style PartsBar (colour row + category tabs + part grid) picks
  the active part; Create mode places it at the grid cell and stores a
  JSON-only brick { uID, type, color, position/dimensions, rotation } so
  the piece syncs to peers like any other brick.
- Brick.jsx renders the cached LDraw clone for typed bricks and keeps the
  parametric box as a fallback. Edit-mode tooling (select / move / colour
  / delete) walks up to the brick group so it works on multi-mesh pieces;
  selection is shown with an emissive tint instead of the stud wireframe.
2026-06-13 18:43:44 +02:00
L'électron rare ca1c5749cc feat: french kid-friendly room entry
Replace the English Name + Room ID form with two big, no-keyboard
buttons aimed at a 6-year-old:

- "Construire tout seul" joins a unique solo room (solo-<random>).
- "Construire a plusieurs" joins a fixed shared room ("lisael") so two
  kids who tap it land together without typing anything.
- An auto name ("Constructeur NNN") keeps self.name non-empty for the
  people list.
- A small "Salle perso" link reveals an optional room field for adults.

Also francise the visible chrome: Creer / Modifier modes, the rotate
toggle, the empty-room people label, and the help dialog (which no
longer auto-opens so the builder is playable immediately).
2026-06-13 18:43:34 +02:00
L'électron rare 17a6012423 chore: dockerfile for realtime relay 2026-06-13 18:06:59 +02:00
L'électron rare c8dff33836 chore: drop liveblocks dependency
Remove @liveblocks/client and @liveblocks/zustand; add ws and a
server npm script. Update README (fork attribution preserved, WS
backend usage), .env.example (VITE_RT_URL), and pin the /blocs-pro/
base in vite.config.
2026-06-13 18:04:28 +02:00
L'électron rare 8a34b1d333 feat: room sync zustand middleware
roomSync() replicates the @liveblocks/zustand surface
(state.liveblocks.{enterRoom,leaveRoom,status,others,room}) over the
self-hosted relay. Storage fan-out is debounced and guarded against
remote echo; presence maps the self key; room exposes broadcastEvent,
subscribe and no-op history stubs. Falls back to a degraded solo mode
if the socket never opens so the Loader never blocks. Dev-only store
hook on window for debugging (stripped in production).
2026-06-13 18:04:22 +02:00
L'électron rare 60fc17819c feat: self-hosted websocket realtime server
Standalone Node WebSocket relay (ws) replacing the Liveblocks SaaS.
Per-room storage snapshot ({bricks, cursorColors}) plus presence
roster; JSON protocol with init/join/leave/presence/storage/event.
Ephemeral events relayed to peers only; rooms cleaned up when empty.
2026-06-13 18:04:15 +02:00
Bhushan Wagh 8f32fb2509 Create LICENSE 2023-08-16 17:21:12 +05:30
bhushan6 f41a880cf1 adds readme 2023-08-16 17:13:53 +05:30
bhushan6 293266d621 updates : info dialog panel 2023-08-15 04:26:22 +05:30
bhushan6 0ad3cbeb0f adds undo, redo shortcuts 2023-08-15 04:24:09 +05:30
bhushan6 fd7470ff66 minor fixes 2023-08-15 03:57:13 +05:30
bhushan6 b1c8228b00 removes unused code 2023-08-15 03:51:48 +05:30
bhushan6 3f41135b9e minor fixes 2023-08-15 03:51:33 +05:30
bhushan6 4c5e8e65aa fixes unsynced position of outline 2023-08-15 03:51:16 +05:30
bhushan6 ea14c48ef5 adds shortcut for anchoring 2023-08-15 03:50:43 +05:30
bhushan6 aa84c597dd fixes : pointer event issue 2023-08-15 02:50:49 +05:30
bhushan6 c6282656a1 fixes : minor styling issues 2023-08-15 02:50:32 +05:30
bhushan6 26551e4585 fixes : bottom bar style 2023-08-15 02:21:03 +05:30
bhushan6 b96bfbbbd7 fixes UI layering 2023-08-15 02:18:50 +05:30
bhushan6 7a049228ba adds animated loader 2023-08-15 02:01:01 +05:30
bhushan6 6c85e117c0 updates : icon and doc title 2023-08-15 01:39:45 +05:30
bhushan6 939b3c272f removes unused packages 2023-08-15 01:27:03 +05:30
bhushan6 0da002128e adds online people number indicator 2023-08-15 01:24:18 +05:30
bhushan6 ac7c635239 adds room join form 2023-08-15 00:18:11 +05:30
bhushan6 fae9c8ae1a adds ui for collaborators 2023-08-14 21:40:55 +05:30
bhushan6 f5b3ed6756 adds live cursor 2023-08-14 13:45:04 +05:30
bhushan6 fe58e5c01f sets up liveblock for collaboration feat 2023-08-14 04:33:19 +05:30
bhushan6 c960f1786a removes logs 2023-08-13 21:18:26 +05:30
bhushan6 ea7a01b634 adds : bottom bar 2023-08-13 21:11:06 +05:30
bhushan6 2c961e18c2 adds : global state 2023-08-13 21:10:35 +05:30
bhushan6 4784eea0ac created stroke plane 2023-08-13 19:13:08 +05:30
bhushan6 48d4ffaf91 updates UI 2023-08-13 14:25:42 +05:30
bhushan6 14852144f1 adds : adaptive grid size 2023-08-12 12:21:42 +05:30
bhushan6 015bfa07a7 fix : linting 2023-08-12 11:26:06 +05:30
bhushan6 4e889a8f80 adds : size adaptive grid 2023-08-12 01:29:58 +05:30
bhushan6 9a13335a17 migrates to vite 2023-08-12 00:33:12 +05:30
bhushan6 42837ccb90 migrates to vite 2023-08-12 00:25:42 +05:30
bhushan6 844074d31a added : edit color feature 2023-06-21 11:29:42 +05:30
bhushan6 4cc6a149cc added : manual modal default open 2023-06-18 12:18:30 +05:30
bhushan6 701edcdfe2 added : manual 2023-06-18 11:32:31 +05:30
bhushan6 1b86891ff0 updated : selection on edit mode only 2023-06-18 10:09:40 +05:30
bhushan6 61b3c2f84b added : Delete Feature 2023-06-16 08:29:56 +05:30
bhushan6 64eff2272b added : undo button and selection 2023-06-15 23:28:35 +05:30
Bhushan Wagh 28e296fe62 Merge pull request #1 from bhushan6/brick-anchor
Brick anchor
2023-04-29 21:57:53 +05:30
bhushan6 7e44491823 removed: liveblock 2023-04-29 21:56:09 +05:30
bhushan6 cff8473403 added: changable anchoring for lego brick 2023-03-14 10:56:03 +05:30
bhushan6 91c4d6aec0 added : info panel 2023-03-05 21:58:43 +05:30