Skip to content

Work on N-74 - #31

Open
ayyshim wants to merge 15 commits into
mainfrom
canopy/work-on-n-74
Open

ayyshim wants to merge 15 commits into
mainfrom
canopy/work-on-n-74

Conversation

@ayyshim

@ayyshim ayyshim commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Handover: 3D office prototype (G-33, from N-74)

1. What was asked

N-74 asked for a small test page, separate from the Canopy app, that shows agents as moving blobs in a 3D office. It was to be built with Three.js.

  • One room with 3 to 5 desks, a manager's desk set apart, and a water cooler.
  • Each agent is a wobbling blob with its own colour and a name above it.
  • Five states you can switch for each agent: Working, Waiting on a person, Asleep, Error and Idle.
  • Clicking a blob shows its name, role and current task.
  • The page must stay under about 2 MB, stop drawing when the tab is hidden, and show a plain message if the browser can't do 3D.
  • Only free (CC0) models or simple shapes, with a list of licences.
  • A short note that maps the board's live session statuses to the five states and estimates how much it would add to the app's download size.

The plan is in N-75. Tommy built the page (T-218) and Trevor took the screenshots and wrote the note (T-219).

2. What changed and where

All the work is in one new folder: docs/design/office-3d/. Nothing in the real app (frontend/ or hub/) was changed. The branch has 15 commits.

Everything N-74 asked for is done:

  • The five states look clearly different and can be switched for each agent.
  • Clicking a blob opens a card. Drawing stops when the tab is hidden. A plain message shows if 3D isn't available.
  • No model files are used. Everything is drawn in code. The only outside code is Three.js, which uses the MIT licence. README.md lists it.
  • There is one screenshot per state in screenshots/.
  • NOTES.md maps all nine session statuses to the five states and says to show agents with no session as Asleep. It estimates about 170 to 220 KB (compressed) added to the app, loaded only on its own page, and names the app files a real build would change.
  • The page loads about 898 KB (233 KB compressed), well under the 2 MB limit.

The team built much more than N-74 asked for, mostly after review feedback:

  • A room for each workspace (three sample ones), an "All rooms" overview, and side panels for every board area: goals, notes, jobs, computers, folders, hiring and chat.
  • Rooms add a desk when someone is hired and there is no free desk.
  • A shared common area with table tennis, a coffee machine and a bathroom. Idle agents go there.
  • A space background with stars, the Earth and the Moon. Walls and ceilings on every room. Glossy "liquid" blobs with a workspace logo pin.
  • The W A S D keys move the camera (Q and E move it up and down).
  • Sounds: alerts for errors, questions and finished goals, all made in code. A "Music" button plays a track from YouTube.

Main files: index.html (the page), main.js (the scene), room.js and lounge.js (rooms and common area), sim.js and lounge-brain.js (the sample board and its logic, with tests), ui.js and panels.js (cards and panels), audio.js (sounds), workspaces.json (sample data), README.md and NOTES.md.

3. How to check it

  1. Open the folder and start a small local server. You can't just double-click the file.
    cd docs/design/office-3d
    python3 -m http.server 8765
    
  2. Open http://localhost:8765/ in a browser.
  3. Click a blob to see its card. Use the panel to switch each agent through all five states.
  4. Look at screenshots/ and read NOTES.md for the status mapping and size figures.
  5. To run the logic tests: node --test sim.test.mjs lounge-brain.test.mjs. I ran them today and all 31 passed.

4. What isn't done or is risky

  • A browser profile was committed by mistake. This must be fixed before merging. The last commit (16a54f4) added a hidden folder, docs/design/office-3d/.prof/. It holds 585 files and about 67 MB, including one 36 MB file. It is the leftover Chrome profile from taking screenshots. I checked it: it has no cookies and no saved passwords, and its only history entry is the local prototype page. So nothing private leaked. But it would add 67 MB of junk to the repository. Even if a later commit deletes the folder, the files stay in the history unless the branch is squashed when merged or that commit is rewritten.
  • The YouTube music has no confirmed licence. It only plays from YouTube's own player when someone presses Music, and nothing was downloaded. That is fine for a local test page, but it should not go into the real app as it is. It also needs an internet connection.
  • Sound and music were never tested. The checks ran in a headless browser, which can't play sound.
  • Only tested at one window size (1440 x 900), using slow software drawing. Nobody has checked it on a real laptop screen or a phone.
  • Much bigger than the brief. The extra features make the page richer, but they also mean more code to move into the app later (main.js alone is about 1,000 lines). The size estimate in NOTES.md covers the whole thing, so it is still a safe upper limit.
  • Sample data only. The page uses made-up workspaces in workspaces.json. It is not connected to the live board yet. That was planned and expected.

5. What you need to decide

  1. How to remove the browser profile folder. My suggestion: have Tommy delete .prof/ in a new commit, add it to the ignore list, and squash the branch when merging so the 67 MB never reaches main. The other option is to rewrite the last commit, which changes the branch history.
  2. Whether to build it into the real app. If yes, it becomes a new goal. NOTES.md already lists the files to change and the size cost.
  3. How much of it to take into the app. Options: the simple version N-74 asked for (one view, five states, click card), or the full version with panels, hiring, chat, the common area and the space scene. The simple version is quicker and cheaper to maintain.
  4. Music and sounds. Drop the YouTube music, or provide a track you hold the rights to. Keep the code-made alert sounds or turn them off. If you want custom sounds, licensed audio files can be set in audio.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant