Commit Graph
30 Commits
Author SHA1 Message Date
Evan SimkowitzandGitHub 936d4bfb30 Migrate websocket eventbus messages to wps (#367)
This migrates all remaining eventbus events sent over the websocket to
use the wps interface. WPS is more flexible for registering events and
callbacks and provides support for more reliable unsubscribes and
resubscribes.
2024-09-11 18:03:55 -07:00
Evan SimkowitzandGitHub debbed7003 Remove WOS dependency from wshrpc (#329)
The frontend wshserver.ts had a weird circuitous dependency on wos.ts,
which was unnecessary. This moves the misplaced functions into wshrpc.ts
and updates the generation logic.
2024-09-05 13:17:35 -07:00
Evan SimkowitzandGitHub e527e2ab77 Add authkey header for requests to the backend (#256)
With this PR, Electron will generate a new authorization key that the Go
backend will look for in any incoming requests. The Electron backend
will inject this header with all requests to the backend to ensure no
additional work is required on the frontend.

This also adds a `fetchutil` abstraction that will use the Electron
`net` module when calls are made from the Electron backend to the Go
backend. When using the `node:fetch` module, Electron can't inject
headers to requests. The Electron `net` module is also faster than the
Node module.

This also breaks out platform functions in emain into their own file so
other emain modules can import them.
2024-08-21 15:04:39 -07:00
Mike SawkaandGitHub 0d8c159101 remote file preview (streaming) working (#248) 2024-08-19 14:37:52 -07:00
sawka 3f37837394 fix term keydown handler 2024-08-19 12:24:08 -07:00
Evan SimkowitzandGitHub e85b0d205e New layout model (#210)
This PR is a large refactoring of the layout code to move as much of the
layout state logic as possible into a unified model class, with atoms
and derived atoms to notify the display logic of changes. It also fixes
some latent bugs in the node resize code, significantly speeds up
response times for resizing and dragging, and sets us up to fully
replace the React-DnD library in the future.
2024-08-14 18:40:41 -07:00
Mike SawkaandGitHub 844451ea0d wsh routing + proxy (#224)
lots of changes, including:
* source/route to rpcmessage
* rpcproxy
* wshrouter
* bug fixing
* wps uses routeids not clients
2024-08-13 16:52:35 -07:00
Evan SimkowitzandGitHub 9e1460b9e1 Remove UUID library in favor of Crypto (#221)
This PR swaps usage of the `uuid` library for the built-in
`crypto.randomUUID` function, which is available in both NodeJS and the
browser. The built-in function is around 12x faster than the `uuid`
library. The strings produced by the built-in function are fully
compatible with the UUIDv4 standard, so it's an easy switch.
2024-08-12 21:20:13 -07:00
Mike SawkaandGitHub c4a0e85d32 update wsh code for easier creation of client servers (for readfile/readdir/fileinfo) (#218) 2024-08-12 10:58:39 -07:00
Evan SimkowitzandGitHub b27d032704 Clean up WOS to reduce code reuse, interface usage (#171)
Removes unused functions, cleans up code reuse.
2024-07-29 15:09:07 -07:00
Evan Simkowitz e6f60ff210 more const crusade 2024-07-23 12:46:29 -07:00
Mike SawkaandGitHub 776ccd7da0 streaming rpc support (backend streams to the frontend) (#120) 2024-07-18 15:56:04 -07:00
Evan Simkowitz 4d29dd5b5f Rename endpoint functions 2024-07-17 18:49:27 -07:00
8971e2feba Set up electron-builder for new app (#113)
Adds electron-builder, which we will use to package and distribute our
application, same as in the existing app.
Replaces explicit port assignments with dynamic ones, which are then
stored into environment variables.
Adds a ~/.w2-dev folder for use when running a dev build.

The build-helper pipeline from the old repo is included here too, but it
is not updated yet so it will fail.

Also removes some redundant utility functions and cleans up some let vs.
const usage.

The packaging can be run using the `package:prod` and `package:dev`
tasks.

---------

Co-authored-by: sawka <mike.sawka@gmail.com>
2024-07-17 18:42:49 -07:00
Mike SawkaandGitHub 01b5d71709 new wshrpc mechanism (#112)
lots of changes. new wshrpc implementation. unify websocket, web,
blockcontroller, domain sockets, and terminal inputs to all use the new
rpc system.

lots of moving files around to deal with circular dependencies

use new wshrpc as a client in wsh cmd
2024-07-17 15:24:43 -07:00
sawka 8a71180f20 implement wscommand using type union interface, send resize events there 2024-06-12 14:18:03 -07:00
sawka 605b9ea048 remove wails deps 2024-06-12 11:58:17 -07:00
Mike SawkaandGitHub 1874d9a252 port to electron (#33) 2024-06-11 17:42:10 -07:00
Evan SimkowitzandGitHub 92dc82967c Replace lets with const where possible (#35) 2024-06-11 13:19:29 -07:00
Evan SimkowitzandGitHub 0a45311f30 Implement outer drop direction, add rudimentary drag preview image rendering (#29)
This PR adds support for Outer variants of each DropDirection.

When calculating the drop direction, the cursor position is calculated
relevant to the box over which it is hovering. The following diagram
shows how drop directions are calculated. The colored in center is
currently not supported, it is assigned to the top, bottom, left, right
direction for now, though it will ultimately be its own distinct
direction.

![IMG_3505](https://github.com/wavetermdev/thenextwave/assets/16651283/a7ea7387-b95d-4831-9e29-d3225b824c97)

When an outer drop direction is provided for a move operation, if the
reference node flexes in the same axis as the drop direction, the new
node will be inserted at the same level as the parent of the reference
node. If the reference node flexes in a different direction or the
reference node does not have a grandparent, the operation will fall back
to its non-Outer variant.

This also removes some chatty debug statements, adds a blur to the
currently-dragging node to indicate that it cannot be dropped onto, and
simplifies the deriving of the layout state atom from the tab atom so
there's no longer another intermediate derived atom for the layout node.

This also adds rudimentary support for rendering custom preview images
for any tile being dragged. Right now, this is a simple block containing
the block ID, but this can be anything. This resolves an issue where
letting React-DnD generate its own previews could take up to a half
second, and would block dragging until complete. For Monaco, this was
outright failing.

It also fixes an issue where the tile layout could animate on first
paint. Now, I use React Suspense to prevent the layout from displaying
until all the children have loaded.
2024-06-11 13:03:41 -07:00
Evan SimkowitzandGitHub f12e246c15 Break layout node into its own Wave Object (#21)
I am updating the layout node setup to write to its own wave object. 

The existing setup requires me to plumb the layout updates through every
time the tab gets updated, which produces a lot of annoying and
unintuitive design patterns. With this new setup, the tab object doesn't
get written to when the layout changes, only the layout object will get
written to. This prevents collisions when both the tab object and the
layout node object are getting updated, such as when a new block is
added or deleted.
2024-06-05 17:21:40 -07:00
c3e71c5c7d Integrate Faraday layout system (#16)
Co-authored-by: Mike Sawka <sawka@users.noreply.github.com>
Co-authored-by: sawka <mike.sawka@gmail.com>
2024-06-04 13:05:44 -07:00
sawka 7a54b79bda added getWaveObjectAtom 2024-05-28 17:17:52 -07:00
sawka 609f2ec85c the useWaveObject() setter now writes back to the DB. make metadata setting generic 2024-05-28 15:41:03 -07:00
sawka 5edb882955 add an updatemetadata call to objectservice 2024-05-28 12:18:26 -07:00