Commit graph

223 commits

Author SHA1 Message Date
Jonatan Kłosko 48c7f9e707 Tiny tokenizer improvements 2021-02-22 16:33:46 +01:00
Jonatan Kłosko dc1930634f
Add UI for cancelling evaluation (#51)
* Add icon for cancelling cell evaluation

* Add shortcut for cancelling evaluation

* Test cancellation
2021-02-22 14:21:28 +01:00
Jonatan Kłosko 0925ec77cd
Implement notebook persistence and import (#44)
* Basic filesystem navigation

* Add file picker modal

* Implement autosave when dirty and show the status

* Add hompage link in the session view

* Improve file picker and use in both places

* Move session list to homepage

* Some refactoring

* Show import messages if any

* Fix and extend tests

* Show a message when there are no sessions running

* Rename import to fork and make that clear in notebook name

* Fix old route

* Show info when no file is connected to the given session

* Show runtime type next to filename

* Show button for joining session when a running path is selected

* Move modal components to SessionLive namespace

* Add FileGuard to lock files used for notebook persistence

* Use radio for specifying persistence type

* Don't lock nil path

* Simplify FileGuard implementation

* Test notebook persistence

* Fix typo

* Further simplify FileGuard

* Improve file listing

* Don't show parent dir when there's a basename being typed

* Add path component tests
2021-02-21 16:54:44 +01:00
Jonatan Kłosko 77675ad61e
UI polishing (#43)
* Tiny UI improvements

* Add icon for entering insert mode on a markdown cell

* Highlight selected section

* Improve contenteditable elements

* Highlight notebook/section name while editing
2021-02-18 15:11:24 +01:00
Jonatan Kłosko 0b77fd4279
Add keyboard shortcuts help modal (#41)
* Update keybindings and add help modal

* Add more evaluation shortcuts

* Add shortcut to the help modal

* Show appropriate shortcuts depending on the user system

* Handle missing user-agent header

* Conditionally render shortcut based on user agent

* Implement vim-style navigation

* Remove warning

* Determine platform based on socket on mount

* Improve shortcuts list UI
2021-02-18 13:14:09 +01:00
Jonatan Kłosko 13f9b2b509
Sanitize HTML rendered from Markdown (#39) 2021-02-17 17:16:16 +01:00
Jonatan Kłosko f2f121a63b Set up CI 2021-02-16 23:37:10 +01:00
Jonatan Kłosko 6ac7f94897
Define notebook file format (#27)
* Initial file import/export

* Add renderer tests

* Refactor renderer

* Depend only on EarmarkParser

* Add test for export

* Add import tests

* Improve import

* Document the ExMd file format

* Rename ExMd to ExMarkdown

* Rename ExMarkdown to LiveMarkdown

* Build iodata when exporting a notebook

* Persist metadata as a single JSON object

* Move Markdown to LiveMarkdown.MarkdownHelpers

* Make LiveMarkdown private

* Always move primary heading to the top during import

* Hint the user not to use heading 1 and 2

* Return a list of messages from the import function

* Update headings warning

* Add import and export test for non-elixir snippets

* Merge markdown renderer into MarkdownHelpers

* Add import messages on AST rewrites
2021-02-16 18:39:52 +01:00
Jonatan Kłosko 9d3a2ae264
Some cleanups (#25)
* Remove old js files

* Cleanup styles

* Update page title

* Unify elements rounding

* Fix indentation

* Rename component modules

* Add actions to routes for better helpers
2021-02-11 16:35:32 +01:00
Jonatan Kłosko 79e5c432b3
Move evaluation to a separate Elixir runtime (#20)
* Isolate evaluation in separate node for each session

* Start new remote upon first evaluation and handle nodedown

* Add UI for managing evaluation node, improve naming and structure

* Show runtime initialization errors and some fixes

* Improve standalone node initialization

* Correctly handle multiple sessions connecting to the same node

* Fix session tests concerning evaluation

* Documentation and some refactoring

* Various improvements

* Configure schedulers to get to sleep immediately after evaluation

* Move EvaluatorSpervisor into the Remote namespace

* Fix evaluators cleanup

* Add tests

* Improve flash messages

* Introduce remote genserver taking care of cleanup

* Redefine the Runtime protocol to serve as an interface for evaluation

* Cleanup operations

* Use reference for communication with a standalone node

* Use shortnames for distribution by default

* Update node configuration and make sure epmd is running

* Rename Remote to ErlDist
2021-02-11 12:42:17 +01:00
Jonatan Kłosko 8acb483bcd
Improve keyboard navigation and focus (#19)
* Adjust result length

* Add more keyboard navigation actions

* Improve inserted/deleted cells focus and add some tests

* Some refactoring

* Run formatter
2021-02-04 16:01:59 +01:00
Jonatan Kłosko a8b5227dd6
Use inspect to highlight cell result (#18)
* Use inspect to highlight cell result

* Use invalid UTF-8 byte for color separation

* Match editor typography in cell output
2021-02-03 13:13:56 +01:00
Jonatan Kłosko 77b60c8110
Integrate evaluation into UI (#17)
* Render evaluation outputs and result

* Fix auto-scrolling to not be interrupted by editor focus

* Add cell output tests

* Run formatter

* Show cell status

* Apply review suggestions

* Change EEx strings to Live EEx
2021-02-02 19:58:06 +01:00
Jonatan Kłosko 936d0af5fb
Set up markdown rendering (#16)
* Set up markdown rendering, update theme.

* Improve focus and handle expanding for markdown cells

* Add keybindings for expanding/navigating cells

* Improve editor autofocus when navigating with shortcuts

* Add tests

* Render markdown on the client

* Don't render cell initial data and make a request instead
2021-01-30 00:33:04 +01:00
Wojtek Mach ca36e22af0
Add defn to monarch_language.js (#15)
* Add defn

* Update monarch_language.js

* Update monarch_language.js
2021-01-26 13:52:28 +01:00
Jonatan Kłosko 479b0379d8
Implement Elixir lexer for the Monaco editor (#14)
* Implement Elixir lexer for the Monaco editor

* Tokenize function calls
2021-01-26 13:14:58 +01:00
Jonatan Kłosko 8e4b4af60c
Add Elixir language support to the editor (#13) 2021-01-22 23:27:25 +01:00
Jonatan Kłosko b8df31e1ae
Clear undo/redo stack upon receiving a concurrent delta (#12) 2021-01-22 20:43:56 +01:00
Jonatan Kłosko 3e6a4adce2
Implement collaborative text editing (#10)
* Set up editor and client side delta handling

* Synchronize deltas on the server

* Document the client code, add more tests

* Implement delta on the server, use compact representation when transmitting changes

* Simplify transformation implementation and add documentation

* Add session and data tests

* Add more delta tests

* Clean up evaluator tests wait timeout
2021-01-21 13:11:45 +01:00
Jonatan Kłosko 80cd651b0f
Setup initial session UI (#9)
* Sync session data within LV client

* Add basic session UI

* Add operations for setting notebook and section name

* Update notebook and section name from the UI

* Some cleanup

* Return current data upon client registartion to avoid race conditions

* Small fixes
2021-01-17 22:03:03 +01:00
Jonatan Kłosko 5877180934
Set up assets and layout (#2) 2021-01-07 22:13:17 +01:00
José Valim 2dd88ec017 Add LiveView 2021-01-07 21:16:54 +01:00
José Valim 79792777a7 Initial commit 2021-01-07 20:56:24 +01:00