Commit graph

98 commits

Author SHA1 Message Date
Jonatan Kłosko 4ff1ff0d5a
Use Phoenix.Tracker to keep track of sessions within the cluster (#540)
* Use Phoenix.Tracker to keep track of sessions within the cluster

* Apply review comments

* Cleanup topics and updates

* Update lib/livebook_web/live/session_live.ex
2021-09-04 19:16:01 +02:00
Jonatan Kłosko 2b1cb57a15
Start new notebooks with a focused code cell (#527)
* Start new notebooks with a focused code cell

* Update changelog
2021-08-30 16:33:40 +02:00
Jonatan Kłosko 8e6558a83a
Introduce file system abstraction and an S3 implementation (#492)
* Introduce file system abstraction and an S3 implementation

* Support arbitrary absolute paths and delegate resolution to file system

* Remove accidental notebook file

* Apply suggestions from code review

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

* Apply review comments

* Add missing path assertions

* Apply review comments

* Fix test saving notebook in project root

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-08-13 21:17:43 +02:00
Jonatan Kłosko 634907b49c
Add notebook option for persisting outputs (#485)
* Add notebook option for persisting outputs

* Increase persistence modal spacing
2021-07-30 16:24:46 +02:00
Jonatan Kłosko 42463c7cb1
Add option to export Live Markdown with output (#483)
* Add option to export outputs in Live Markdown

* Add outputs option to Live Markdown export tab

* Adjust import to handle outputs

* Apply review comments
2021-07-29 18:41:34 +02:00
Jonatan Kłosko 1caff24882
Separate ANSI parsing from HTML rendering (#482) 2021-07-29 14:51:40 +02:00
Jonatan Kłosko cfbba9e2ce
Add Elixir source export (#476) 2021-07-28 13:40:36 +02:00
Jonatan Kłosko 6575791bed
Add notebook source preview and export (#457)
* Add notebook source preview and export

* Build live markdown source outside the session process
2021-07-23 01:18:40 +02:00
Jonatan Kłosko ef06e49d18
Show full documentation when hovering over an identifier (#453)
* Show full documentation when hovering over an identifier

* Remove leftover function

* Improve determining subject boundaries
2021-07-20 21:30:53 +02:00
Jonatan Kłosko ee740d4194
Resolve links for imported notebooks (#445)
* Resolve links for imported notebooks

* Clarify error messages
2021-07-10 21:49:50 +02:00
Jonatan Kłosko bd8e06b5ce
Implement relative navigation between notebooks (#441)
* Use live redirect for local links in rendered markdown

* Resolve relative notebook URLs

* Bump LV

* Adds tests

* Handle nested relative path

* Handle child nested paths
2021-07-08 19:35:11 +02:00
Jonatan Kłosko 7203813f8d
Add support for input properties (#440) 2021-07-08 11:35:09 +02:00
Jonatan Kłosko c674a0ec5d
Normalize textarea newlines (#402)
* Normalize textarea newlines

* Add test
2021-06-26 00:53:12 +02:00
Jonatan Kłosko 2b2d6c9d50
Show consistent user avatar on initial page load (#349) 2021-06-15 19:33:16 +02:00
Jonatan Kłosko adb9612fbe
Add link pointing to a new notebook (#347)
* Add link pointing to a new notebook

* Add test
2021-06-14 21:25:18 +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 f70581f255
Introduce an Explore section (#310)
* Add explore page

* Move sidebar to a configurable component

* Fix homepage test

* Add images

* Store example notebooks in files and make explore notebooks linkable

* Fix tests

* Raise on invalid notebook slug

* Keep just the file contents in notebook info

* Move notebook lookup to Explore

* Exclude notebooks in progress
2021-06-02 21:51:43 +02:00
Brian Underwood 8dfe12da68
Change anchor tags for sections to be based on the titles, not randomly generated (#288)
* Change anchor tags for sections to be based on the titles, not randomly generated

* Update lib/livebook_web/helpers.ex

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-05-23 18:22:55 +02:00
Jonatan Kłosko ea93edcc86
Add embedded runtime for evaluating code in the Livebook VM (#266)
* Add embedded runtime for evaluating code in the Livebook VM

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

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

* Use standard error proxy globally in the Livebook node

* Add configuration env variable for setting the default runtime

* Increase evaluation response assertion timeouts

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-05-10 14:37:38 +02:00
Jonatan Kłosko 5c8e117800
Setup user profiles (#253)
* Add initial user config modal

* Assign user ids

* Update session data to hold user ids

* Get users list for specific ids

* Render user avatar

* User update

* Refactor user changes

* Subscribe to individual user updates

* Show users in side panel

* Add sidebar to homepage

* Don't generate the same color twice in a row

* Add documentation notes

* Fix tests

* Add tests

* Keep users in session data

* Rename color to hex_color
2021-05-03 20:03:19 +02:00
Jonatan Kłosko aaba58a933
Set up importing notebook from URL or clipboard (#237)
* Set up importing notebook from URL or clipboard

* Extract loading functions into separate module

* Replace import icon with text

* Add TLS peer verification

* Remove unnecessary tests setup step
2021-04-23 17:40:13 +02:00
Jonatan Kłosko e755ff8122
Restructure settings (#233)
* Force menu items into a single line

* Add shortcut for saving the notebook

* Make the disk icon always show file dialog

* Split runtime and file settings into separate modals

* Add ctrl+s to the shortcuts list

* Add togglable menu to the session page

* Make sure newly saved file appears in the file selector

* Fix path seletor force reloading

* Remove notebook generated in tests

* Add test for file list refresh after save
2021-04-21 23:02:09 +02:00
José Valim 52fc451a45
Remove newline from tests, closes #204 (#231) 2021-04-20 20:17:24 +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
Frank Hunleth b1ceedc220
Ignore RFC 1468 switch to ASCII code sequence (#225)
This ignores "\e(B" which sometimes shows up even when the other RFC
1468 Japanese character set switch codes aren't used. This also updates
defmodifier so that it can be used with non-CSI escape codes (the
ones that start with '[').
2021-04-20 15:05:30 +02:00
Frank Hunleth 0f49351c3b
Handle a short ANSI reset ("\e[m") (#220)
It's legal to omit the 0 in the "\e[0m" sequence to reduce the number of
bytes needed to reset the terminal. See
https://en.wikipedia.org/wiki/ANSI_escape_code#CSI_(Control_Sequence_Introducer)_sequences
and a simple explanation and the cited reference for a more involved
one.
2021-04-20 14:16:21 +02:00
José Valim 57047f9c7f
Unify env variables and change auth to use session (#195) 2021-04-15 15:50:29 +02:00
Jakub Perżyło a9c8e20775
Password access (#187) 2021-04-15 14:15:56 +02:00
Jonatan Kłosko cf35a46ecf Create write-protected file on the fly in tests 2021-04-14 16:48:11 +02:00
Jonatan Kłosko 83b94c6b0b Add test for selecting a write-protected file 2021-04-14 16:39:12 +02:00
Jonatan Kłosko d8213c3f68
Change wording from delete session to close session (#160) 2021-04-12 23:24:26 +02:00
Jonatan Kłosko 5f5ef1d0b6
Improve path selector (#159)
* Synchronously save file when the location is chosen and fix default path

* Handle enter press in the path selector
2021-04-12 22:59:48 +02:00
Jonatan Kłosko c6f9c54f31
Buffer IO evaluation output (#156)
* Buffer IO evaluation output

* Respect CR in IOProxy

* Handle CR when adding cell output rather than during each render

* Optimise CR handling in buffer
2021-04-12 17:56:40 +02:00
Jonatan Kłosko e9766ed7a5
Introduce token auth and add basic cli configuration (#148)
* Add token authentication

* Restructure CLI

* Allow port configuration

* Further refactoring

* Make sure livebook node starts with unique name

* Improve startup error handling

* Further refactoring

* Add authentication tests

* Add authentication view for entering the token

* Fix auth tests

* Always use random Livebook name for distribution

* Don't enable ANSI on Windows

* Define CLI Task behaviour and move generic logic to the main module

* Generalize convertion from cli arguments to configuration

* Randomly generate secret key base

* Update test/livebook_web/plugs/auth_plug_test.exs

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

* Override app config in persistent manner

* Update lib/litebook_cli.ex

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

* Move auth error to ErrorView

* Unify node name configuration and allow it via CLI

* Set all applications configs at once

* Move token generation to application.ex to work outside CLI

* Clean up overriding configuration

* Store auth token in separate cookies

* Update lib/livebook_cli/server.ex

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

* Update lib/livebook_web/endpoint.ex

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

* Update lib/livebook_web/plugs/auth_plug.ex

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

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-04-08 11:41:52 +02:00
Jonatan Kłosko 7d1d1f4d98
Respect CR in cell output (#137)
* Respect CR in cell output

* Update test/livebook_web/helpers_test.exs

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

* Improve rewind implementation

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-04-04 21:22:28 +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 59fefc1980
Highlight results in path selector (#128)
* Highlight results in path selector

* Increase highlight contrast
2021-04-01 15:49:39 +02:00
Jonatan Kłosko 5efd8eb851
Notebook status indicators (#127)
* Add notebook indicators

* Make evaluation status button point to the corresponding cell

* Rename introductory notebook

* Update path highlight when chosen for saving

* Allow specifying nonexistent directories when saving and create those

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

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

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

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

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

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

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

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

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

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

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-04-01 12:56:19 +02:00
Jonatan Kłosko 5c5b4ece26
Add "Hello Livebook" notebook (#123)
* Limit module result to a single line

* Add introductory notebook to get started with

* Don't show tooltip on focused elements

* Update lib/livebook/notebook/hello_livebook.ex

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

* Update lib/livebook/notebook/hello_livebook.ex

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

* Update lib/livebook/notebook/hello_livebook.ex

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

* Update notebook settings reference

* Add note on package authors

* Add tests

* Update Phoenix version to git master

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-03-30 21:42:02 +02:00
Jonatan Kłosko de83020d05
Home tests (#118)
* Test forking existing session

* Test session deletion

* Fix capitalization
2021-03-25 19:04:49 +01:00
Jonatan Kłosko 50db813092
Show reconnect button when connecting to a matching runtime (#113)
* Show reconnect button when connecting to a matching runtime

* Add runtime config test
2021-03-23 19:41:03 +01:00
Jonatan Kłosko 8217fdd118
Don't show explicitly ignored result (#94)
* Don't show explicitly ignored evaluation results

* Fix multiline ANSI formatting with virtualized lines

* Add reference to IEx.Helpers

* Fix typo
2021-03-20 16:48:23 +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 8b37e32e3a
Escript (#77)
* Set up Escript packaging

* Use MD5 digest sa ETAG

* Make sure changes to the static files recompile the relevant module

* Manually start the application in Escript

* Set up basic CLI

* Run formatter

* Start Elixir app before anything else

* Improve version output

* Build Escript to project root directory

* Improve assets handling

* Move plug related modules under plugs directory

* Include bundled assets in the repository

* Use the same plug with different static providers in prod and dev

* Refactor providers

* Rename StaticProvidedPlug to StaticPlug
2021-03-17 01:53:44 +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 0b6e8f7ef2 Update web client title to Livebook 2021-03-03 23:22:53 +01:00
Jonatan Kłosko dae6d5c9c3
Rename project (#68)
* Rename references

* Update file and directory names

* Fix homepage tests
2021-03-03 22:56:28 +01:00