Commit graph

131 commits

Author SHA1 Message Date
Jonatan Kłosko f91c71bf3a
Migrate the Evaluator process from GenServer to a regular process (#502)
* Migrate the Evaluator process from GenServer to a regular process

* Update CHANGELOG

* Attach reference to every evaluator and pass in internal messages

* Use start_supervised/2 in tests

* Apply review comments
2021-08-19 13:56:59 +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 f22bf2a21d
Keep inline Markdown unchanged when importing/exporting (#487)
* Merge: [WIP] Make Markdown formatter math-safe #447

* Keep inline Markdown unchanged when importing/exporting
2021-08-02 18:39:50 +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 37b6a1aa40
Remove untyped metadata (#484) 2021-07-30 13:04:07 +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 afe06517d7
Convert Elixir columns range to JavaScript (#472) 2021-07-27 16:50:05 +02:00
Jonatan Kłosko ee51411299
Rewrite hover details using Code.Fragment.surround_context (#471) 2021-07-27 12:32:53 +02:00
Jonatan Kłosko 7dd80489a3
Preserve subsequent Markdown cells in .livemd (#469)
* Add import/export tests

* Implement live markdown annotation for breaking Markdown cells
2021-07-26 13:35:37 +02:00
Jonatan Kłosko af50646a8e
Convert JavaScript string column to Elixir (#467)
* Fix column/index wording

* Convert JavaScript string column to Elixir
2021-07-26 11:57:51 +02:00
Jonatan Kłosko f9ec058e43
Fix completion crash on higher unicode characters (#466)
* Fix completion crash on higher unicode characters

* Safely rescue from intellisense errors
2021-07-26 11:34:22 +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 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