You are browsing as a guest. Sign up (or log in) to start making projects!

8h 1m 31s logged

holyyy i completely forgot to post any devlogs all week :son-im-crine:


DEMO LIVE AT https://canvasos.ortley.pages.gay/


Changes to the backend

Previously everything was handled by the main App() function, but MouseEvent issues (see below) meant that I had to centralize most of the reactive values of my components. Working with external stores and states was a pain since the standard useSyncExternalStore that React provides to communicate with singletons was just way too slow for any sort of real time read/write. This led to me implementing something like how zustand manages it’s stores. Now the state of a program can be modified from anywhere

screaming at MouseEvent

When dragging apps around by the titlebar, there is a chance that the mouse goes fast enough that it leaves the bounding box of the previous position of the titlebar. This leads to the titlebar not handling the MouseEvent, which was where the window moving logic was implemented. Since the mousemove MouseEvent wasn’t going to the titlebar, it would be going to the background, which wasn’t hooked up to move programs.
This meant that the whole backend had to be refactored to allow both global modifying of the underlying data representation of the position of programs, and also allow the JSX of the programs to react to changes in their linked data structure

Changelog

  • b788c5e786 - feature: add program layering
  • 91aeeec37b - chore: remove program frame
  • de83c2089d - backend: centralised program managemtn
  • 5d3c404924 - feature: add basic program frame with shadow root functionality
  • 5c9e4011b7 - backend: migrate appstate to appstore with useState hooks
  • fae40a30f9 - chore: rename panAnchor to prevMouse to fit new purpose
  • 34057f6f4d - oops: Fixed it after breaking it
  • 6b924a45fc - chore/backend: move Vec2 to common/type and implement appstate singleton
  • e1cd7f506e - chore: refactor with Vec2 class
  • 991dda305f - feature: Vec2 class
  • 5f39b56395 - chore: remove preinstalled stuff

Although a lot of this devlog is me being mad at react, I actually really enjoyed it :yay: and it was really fun to learn how to speak in the same language as react

See the video for a demo of the project

0
4

Comments 1

@ortley

just realised i didnt mute my music on the demo video
:prayer: