Commit graph

40 commits

Author SHA1 Message Date
José Valim 2dbfb562ea Hardcode font size to 14 for consistency 2021-07-02 16:52:38 +02:00
Jonatan Kłosko b92afcef8e
Highlight matching brackets only in insert mode (#421) 2021-07-01 15:58:18 +02:00
Jonatan Kłosko 86316e9460
Add code formatting integration to Elixir cells (#416) 2021-07-01 11:50:04 +02:00
Jonatan Kłosko 2ff327e742
Implement cells bin (#414)
* Implement cells bin

* Temporarily keep cells source

* Send complete bin entries from session to clients when a cell gets removed

* Polish styles

* Hydrate bin entries on section deletion as well
2021-06-30 17:48:27 +02:00
Jonatan Kłosko 73a79cbdae
Add support for markdown output (#404)
* Add support for markdown output

* Make cell indicator absolute

* Update output typespec

* Move rendering to the client

* Polishing
2021-06-26 16:47:52 +02:00
Jonatan Kłosko 3df6508b56
Disable autoscroll when focusing in insert mode (#355) 2021-06-16 16:16:26 +02:00
Jonatan Kłosko 4657ad17c3
Update Monaco and use the built-in Elixir definition (#345) 2021-06-14 15:57:13 +02:00
Jonatan Kłosko b0bd7540c0
Compute cell source digest on the client (#341) 2021-06-10 14:54:55 +02:00
Jonatan Kłosko 8dea99e600
Support inputs (#328)
* Render basic input

* Make each cell type a separate struct

* Add operation to set input value

* Prototype communication

* Make input name editable

* Refactoring

* Unify cell attribute setters

* IO tests

* Document input communication protocol in Runtime

* Add more tests

* Add persistence

* Fix status update on cell attributes change

* Rework persistence

* Integrate input cell with insert mode

* Add missing users keybinding

* Mimic autofocus for dynamically inserted elements

* Support input type selection

* Support URL input and set up validation

* Convert input error into a more meaningful io error

* Add missing client checks

* Consume every input only once per evaluation

* Fixes
2021-06-08 12:33:50 +02:00
Jonatan Kłosko 7b89e1ec83
Improve markdown links (#315)
* Make sure link/button clicks don't trigger cell focus

* Open external links in new browser tab
2021-06-03 16:31:41 +02:00
Jonatan Kłosko 2e0195f658
Make sure math equations are rendered sequentially (#294) 2021-05-25 14:36:55 +02:00
Jonatan Kłosko cd80bd7804
Implement user cursor and selection tracking (#260)
* Implement user cursor and selection tracking

* Separate jump-to-user and follow
2021-05-07 16:41:37 +02:00
Jonatan Kłosko dc605aa209 Specify editor fallback font 2021-05-04 15:48:26 +02:00
Jonatan Kłosko c498cfb211
Explicitly dispose Monaco editor instance when cell is deleted (#232) 2021-04-21 17:38:48 +02:00
Jonatan Kłosko 700987dc02
Add editor completion to Elixir cells (#208)
* Implement editor completion for Elixir cells

* Add completion tests

* Refactor completion

* Only extract Markdown docs for now

* Fix Elixir version-dependent test

* Fix docs matching

* Use upcoming Code.cursor_context/2

* Start temporary completion processes under a supervisor

* Show Erlang docs in completion items

* Update to latest Code.cursor_context

* Refactor completion

* Fix module completion when alias expands to Erlang module

* Remove tests-generated notebook

* Show variables and map fields differently

* Adjust signatures formatting
2021-04-20 19:34:17 +02:00
José Valim e1bab06168
Fix issue with font-family detection (#157) 2021-04-12 18:31:10 +02:00
José Valim 6cbf4d1fb0 Set alwaysConsumeMouseWheel to false instead of disabling it 2021-04-12 13:04:54 +02:00
Jonatan Kłosko 90fb77b878 Disable do/end autocomplete in case it would move the cursor unexpectedly 2021-04-09 16:25:27 +02:00
Jonatan Kłosko d68c271aae
Add support for math formulas (#151)
* Add support for LaTeX equations

* Mention math support in the introductory notebook
2021-04-08 15:31:46 +02:00
Jonatan Kłosko 121eec784d Properly highlight piping into control flow structures 2021-04-08 12:11:03 +02:00
Jonatan Kłosko 70be004ee0
Make autoscroll behaviour more intuitive (#143)
* Fix editor shift

* Make autoscrolling more intuitive
2021-04-05 15:06:14 +02:00
Jonatan Kłosko d93b5d8450
Set up image uploads for Markdown content (#132)
* Add cell image upload modal

* Add controller for serving the images and handle this on markdown side

* Use per-session images dir

* Add etag header to session image responses

* Adjust markdown image styling

* Properly manage session images dir

* Add tests

* Set maximum file size for image uploads

* Move images dir specifics to the Session module

* Move images when nonpersistent session becomes persistent

* Update lib/livebook_web/live/session_live.ex

Co-authored-by: José Valim <jose.valim@dashbit.co>

* Update lib/livebook_web/live/session_live.ex

Co-authored-by: José Valim <jose.valim@dashbit.co>

* Update lib/livebook_web/live/session_live/cell_upload_component.ex

Co-authored-by: José Valim <jose.valim@dashbit.co>

* Test that close gets rid of session temporary dir

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-04-04 18:55:51 +02:00
Jonatan Kłosko fdadefae32 Fix module attributes tokenization 2021-03-29 18:40:23 +02:00
Jonatan Kłosko 0983a9df77
Add confirmation for session deletion (#117)
* Update sections panel

* Add deletion confirm and unify buttons

* Align notebook title

* Fix whitespace shrinking in the editor

* Update session deletion route
2021-03-25 17:39:18 +01:00
Jonatan Kłosko af79a0fd2f
Improve tab navigation (#109)
* Ignore editor for tab movement

* Improve tab behaviour within notebook

* Highlight focused regular buttons

* Show tooltips on focused elements
2021-03-23 14:10:34 +01:00
Jonatan Kłosko e2cd992b78 Add missing monaco import 2021-03-21 16:48:47 +01:00
Jonatan Kłosko 90e7941fe4
Redesign (#80)
* Update cell actions

* Add new focus indicator

* Update headings typography

* Update cell actions and insert buttons

* Add sidebar menu

* Add settings modal

* Update homepage

* Update settings dialog

* Rename classes

* Add floating menu

* Update icon colors on hover

* Fix homepage tests

* Format assets source

* Update monaco editor

* Fix editor width on resize

* Add more padding to the notebook content

* Update settings dialog title

* Show reevaluate button when the cell is in evaluated state

* Show section actions on focus or hover only

* Pre-fill runtime selector with the current configuration

* Ignore cmd + enter in Markdown cells
2021-03-20 14:10:15 +01:00
Jonatan Kłosko 7fa2b44666
Highlight viewed section within the list (#76)
* Add fallback primary fonts

* Highlight viewed section in the navbar

* Fix moving cells with empty sections

* Reword attribute
2021-03-12 16:40:37 +01:00
Jonatan Kłosko a2d1e2f934
Initial redesign (#75)
* Add Remix icons

* Replace existing icons with Remix icons

* Update fonts

* Redesign homepage

* Redesign shortcuts modal

* Fix tests
2021-03-12 11:57:01 +01:00
Jonatan Kłosko 266bf35bd0
Move focus navigation to the client (#74)
* Show all sections and enable cross-section focus navigation

* Move focus to the client

* Add shortcut for evaluating all cells

* Fix and expand tests

* Make section links scroll to the given section
2021-03-11 15:28:18 +01:00
Jonatan Kłosko 228c279cea
Keep editor focus when cell actions are executed (#65) 2021-03-01 18:48:19 +01:00
Jonatan Kłosko 9fed524ed5
Markdown snippets (#56)
* Extend LiveMarkdown format to support Elixir snippets in Markdown cells

* Highlight Markdown code blocks using Monaco editor API

* Use livebook metadata for forcing markdown as well
2021-02-24 15:41:00 +01:00
Jonatan Kłosko efd58466f2
Purge old deltas (#57)
* Keep track of connected clients in session data

* Add API for confirming and purging deltas

* Send delta confirmation from clients once received

* Update naming

* Fix and extend Data tests

* Update naming
2021-02-23 21:20:46 +01:00
Jonatan Kłosko 48c7f9e707 Tiny tokenizer improvements 2021-02-22 16:33:46 +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 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 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