Commit graph

118 commits

Author SHA1 Message Date
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 9bbbd4568f
Completion adjustments (#456)
* Fix function arity completion

* Add support for operator completion in Elixir 1.13
2021-07-21 21:09:28 +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 6276aafa72
Compute cells validity based on snapshots (#452) 2021-07-18 19:05:02 +02:00
Jonatan Kłosko aa95d81729
Fix completion crash on module attribute call (#451) 2021-07-16 23:39:51 +02:00
Jonatan Kłosko d55c4a1ccc
Introduce branching sections (#449)
* Introduce branching sections

* parent_index -> branch_parent_index

* Flip the branch icon

* Don't mark branching sections as aborted if the main flow crashes

* Outline more details about branching sections in the Elixir and Livebook notebook

* Add branch indicator to the sections sidebar
2021-07-15 18:19:36 +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 28922b3deb
Update deps (#443)
* Update Elixir deps

* Update JS deps

* Increase assertion timeouts

* Run formatter
2021-07-09 14:13:44 +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 73845e4f6a
Handle backticks in Elixir code when persisting Livemarkdown (#438)
* Handle backticks in Elixir code when persisting Livemarkdown

* Apply suggestions from code review

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

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-07-07 15:10:36 +02:00
Jonatan Kłosko c1654345b7
Migrate to latest LV (#437)
* Update phoenix deps

* Update reference to LiveDashboard encode_pid

* Fix form input id references

* Move to HEEx

* Update back to filesystem LV npm package

* Further HEEx rewrites

* Refactor icons into function components

* .html.leex -> .html.heex

* Further refactoring

* Move render helpers into function components

* Add doctype back

* Further refactoring

* Refactor cell component

* Further refactoring

* Compose sidebar using function components

* Rewrite notebook card component as function component

* Fruther refactoring

* Fix race condition in runtime tests

* Rewrite tooltips into function component

* Update Tailwind purge rules

* Revert "Rewrite tooltips into function component"

This reverts commit bd6ca8f0b5.

* Refactor conditional tooltip
2021-07-07 14:32:49 +02:00
Jonatan Kłosko 9b2f039e29
Restructure remote node processes and allow for multiple connections (#434)
* Restructure remote node processes and allow for multiple connections

* Return proper error from Attached duplicate
2021-07-05 20:01:27 +02:00
Jonatan Kłosko 20ff5c95b8
Suggest restarting runtime on Mix.install error and add restart shortcut (#418)
* Suggest restarting runtime on Mix.install error and add restart shortcut

* Apply review comments
2021-07-01 13:23:07 +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 44dc3d9041
Improve section management (#411)
* Allow inserting section anywhere in the notebook

* Improve section deletion

* Polishing

* Remove section insertion shortcuts
2021-06-28 23:46:50 +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 579fe821ef
Implement :get_until in IOProxy (#401)
* Implement :get_until in IOProxy

* Port get_until tests from StringIO
2021-06-25 14:15:11 +02:00
Jean Carlos fb8c6e695d
Added Textarea Input (#382)
* Add password input

* Save empty string for password in .livemd file

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

* Changed radio button it to select
* Changed radio button it to select
* Moved select it to the top
* Keep the elements in the select ordered

* Update lib/livebook_web/helpers.ex

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>

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

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>

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

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>

* Add textarea input
* Add textarea input
* Added operation in the io_proxy to IO.getn

* Update lib/livebook/evaluator/io_proxy.ex

Co-authored-by: José Valim <jose.valim@gmail.com>

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

Co-authored-by: José Valim <jose.valim@gmail.com>

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

Co-authored-by: José Valim <jose.valim@gmail.com>

* Support for utf8 characters in getn function
* Support for utf8 characters in getn function
* Perform test with special characters

* Accepting latin1 and unicode values

* Update lib/livebook/evaluator/io_proxy.ex

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>

* Added split_at function for better performance

* Update lib/livebook/evaluator/io_proxy.ex

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
Co-authored-by: José Valim <jose.valim@gmail.com>
2021-06-25 10:24:20 +02:00
Jonatan Kłosko 4ca6f9eb5e
Implement reactive input (#389)
* Implement reactive input

* Store reactive attribute only when truthy

* Polishing
2021-06-24 11:58:13 +02:00
Jonatan Kłosko 6d0da78370
Make it possible to mark evaluating cell as stale upfront (#378)
* Make it possible to mark evaluating cell as stale upfront

* Show evaluation time on stale cells as well
2021-06-22 15:06:16 +02:00
Shavit a104d9d73b
Show the evaluation time next to the cell indicator (#366)
* Display the time in seconds

Show the evaluation time next to the cell indicator

* Test session data

* Send evaluation time to session

Start the evaluation time inside the evaluator, display the time in seconds
or milliseconds.

The output is not a string but a map

* Add metadata to evaluation_response

* Wrap the evaluation indicator in a tooltip

  • Add metadata argument to the evaluation_response message
  • Use a tooltip to display the evaluation time

* Display the toolip below the indicator

* Remove the evaluation start time

* Make the tooltip optional

* Rename finish_cell_evaluation

* Evaluator tests

* Update test to accespt metadata

* Pass the evaluated time as a third argument

* Make status tooltip more generic

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-06-20 14:48:00 +02:00
Jean Carlos 511a47e238
Add password input (#357)
* Add password input

* Save empty string for password in .livemd file

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

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-06-17 01:30:39 +02:00
Jonatan Kłosko e75ef5f339
Add numeric input (#352) 2021-06-16 12:28:47 +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 d3b4a8a9e6
Track and garbage collect widgets (#344) 2021-06-11 15:42:41 +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 c4a96bc99c
Add support for Mix runtime as the default one (#334)
* Add support for Mix runtime as a default

* Support default runtime options in the CLI

* Set cell status to queued while runtime is being started

* Clean up tests
2021-06-09 16:24:02 +02:00
Jonatan Kłosko 11246cdb8f
Add an option to preload session images from memory (#329)
* Add an option to preload session images from memory

* Remove images
2021-06-08 13:28:53 +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
José Valim 69890cf43e
Allow errors on boot to be reported (#311)
Because we unregistered standard_error, if there
was an error booting livebook, we would fail to
print the error. This commit makes sure the original
standard error is added back whenever the proxy
process terminates.
2021-06-02 19:01:45 +02:00
Jonatan Kłosko 80bed1aa06
Delegate output formatting rules to Kino (#309)
* Delegate output formatting rules to Kino

* Update naming

* Group output components and views

* Fallback to inspect when Kino.Render.to_output/1 fails

* Update naming

* Add reference to Kino
2021-06-01 17:47:03 +02:00
Jonatan Kłosko ce7adef7e4
Add VegaLite widget integration (#306)
* Add support for LiveWidget.VegaLite

* LiveWidget -> Kino

* Show an error when rendering unsupported Kino widget

* Match on Kino.Widget

* Add catch-all for unknown outputs
2021-05-31 22:48:05 +02:00
Jonatan Kłosko a7e1d8ba9a
Capture logger output (#298)
* Capture logger output

* Add capture integration test
2021-05-26 19:54: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 1a1057153e
Optimise data view recomputation for delta operations (#286)
* Optimise data view recomputation for delta operations

* Use generic access_by_id/1 for nested updates

* Use access_by_id/1 for nested notebook updates

* Use Enum.split_while
2021-05-21 14:56:25 +02:00
Jonatan Kłosko 1e4200e338
Initial release (#279)
* Ensure config is loaded before compiling Escript dependencies

* Update README

* Add CHANGELOG

* Update mix.exs

* Increase timeout for mix standalone test

* Add package info to mix.exs

* Update README.md

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

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-05-19 23:30:53 +02:00
Jonatan Kłosko 889503ad68
Require Elixir v1.12 (#278)
* Require Elixir v1.12

* Update introductory notebook

* Update base Docker images

* Add completion of reserved module attributes

* Move complete_module_attribute/1
2021-05-19 16:46:33 +02:00
Jonatan Kłosko 61a841a6d2
Handle output even after cell finishes evaluation (#272) 2021-05-15 19:55:25 +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
José Valim c7887a57de Remove sleep from tests 2021-05-07 08:57:39 +02:00
Benjamin Philip ec07e4749a
Use a node pool for node names (#256) 2021-05-07 08:43:36 +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
Jonatan Kłosko 44eda43d02
Fix markdown line breaks rendering (#227) 2021-04-20 19:31:02 +02:00