Text summary:
-
Intro
-
Offline app
-
Multimedia portable document editor
-
Primary developer for a year
-
Gonna walk through my personal major contributions
-
-
Filesystem sync engine
-
Syncs with and watches user’s filesystem
-
Complications:
-
Efficient: only watches directory in the sidebar + mentioned files in open editor
-
Doing the right thing when an unsaved file gets deleted in filesystem
-
Updating mentions when file gets moved in app
-
-
-
Prosemirror integration
-
Building reliable and flexible abstraction to interop between app state and editor state
-
Complications
-
Still have to use prosemirror plugins since plugins can do some things that you can’t do from outside the editor.
-
Command integration with context menu
-
Mentions,
-
You want to access app environment from within prosemirror: ipc calls to node process + app state like recently accessed files.
-
filesystem access while creating
-
moves on renames
-
invalidated when deleted
-
broken mentions suggestions
-
-
-
-
Commands
-
Three ways of triggering: keyboard shortcut, context menu, command prompt
-
Commands can be declared through react component with a hook, automatically unmounted on dismount.
-
Complications
-
focus. Context menu gets triggered, so it’s focused, but you still want to handle the keyboard commands manually.
-
Disabled vs. unregistered
-
-
Mounted into frontend database. Commands can also be mounted but disabled.
-
-
Database
-
Being a rich, interactive app means having a lot of state
-
Client-side reactive database called tuple-database is our state management solution
-
Everything becomes a plugin into the app
-
Complications
-
Very database-y: I have to select right indexes to be efficient
-
Commands have to be mounted and have 3 different indexes so we can retrieve them efficiently in 3 different contexts like keyboard shortcut and command prompt search.
-
-
-
Testing architecture
-
Previous testing harness mounted whole Electron app for each test
- Previous testing harness mounted whole Electron app and connected to mouse drivers for each test, which was slow, flaky, couldn't use my computer while running.
-
Headless, parallel testing with playwright. Testing time came down by a factor of 10! And can run on CI + can use my computer while running.
-
E2e testing dialect
-
-
Autoupdater
-
Lot more that I built, but only covered the major pieces