Commit Graph
7 Commits
Author SHA1 Message Date
David Lechner 8ac77560fb editor: add tabs for controlling open/active files 2022-04-07 21:17:09 -05:00
David Lechner b9dbaaa5cb fileStorage: implement file locks
This breaks down reading and writing into low-level and high level sagas.

Opening now takes a lock on the file so that it can only have one writer
or have multiple readers. The low-level read and write sagas use the
file descriptor to determine if the file is still open before actually
performing the action.

Since we are using the web locks api, these locks should work across
browser tabs/windows.

The high-level read/write sagas perform the low-level open, read/write,
close operations in a single call.

The high-level delete and rename sagas are also updated to take locks
on the files while performing the respective operations and will fail
if the file is already being used somewhere else.
2022-04-04 15:24:08 -05:00
David Lechner 1515e5ae4f fileStorage: add file handles
This changes how files work. There is now an open function that
translates a path to a file handle (id). Then this handle is used
to perform other actions on the file. The file contents are moved
to a separate table so that the actual file storage is independent
of the database (e.g. in the future, we may use File Access API).

We store a hash of the file contents in the metadata file so we can
detect file changes without having to compare file contents.

We also separate the change and add actions.
2022-04-01 13:41:10 -05:00
David Lechner d1090d01d6 licenses: replace sagas/reducers with useFetch hook 2022-03-15 18:37:06 -05:00
David Lechner 6cfc37b947 settings: use react hook for showDocs setting
The moves the setting from redux state to a react hook.
2022-03-15 15:35:45 -05:00
David Lechner c3851e7139 tests: use matchMedia polyfill
This makes testing code that uses window.matchMedia() work better since
it mocks it globally.
2021-07-02 20:59:09 -05:00
David Lechner e208a99a14 Initialize project using Create React App 2020-04-07 23:02:47 -05:00