Commit graph

224 commits

Author SHA1 Message Date
Jonatan Kłosko
6db36ea7e6
Add support for smart cell editor (#1050)
* Add support for smart cell editor

* Log an error when smart cell fails to start
2022-03-14 22:19:56 +01:00
Jakub Perżyło
4061aa150d
Add autosave path configuration (#1019)
* Added autosave path configuration

* Update settings.ex

* Adjusted to review

* Apply suggestions from code review

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

* Adjusted to review

* Adjusted to review

Co-authored-by: José Valim <jose.valim@gmail.com>
2022-03-13 16:22:52 +01:00
Jonatan Kłosko
ea8b7c2d15
Add support for scanning smart cell evaluation result (#1048)
* Add support for scanning smart cell evaluation result

* Don't allow moving an evaluating cell across sections

* Use consistent naming
2022-03-08 11:10:37 +01:00
Jonatan Kłosko
6b78258713
Add support for scanning evaluation context from smart cells (#1041)
* Add support for scanning evaluation context from smart cells

* Rename prev_locator to base_locator to clarify the meaning

* Adjustments

* Add data tests

* Adjustments

* Test smart cell intearaction with RuntimeServer

* Serialize binding scanning and leave sending to the user

* Monitor the scanning process
2022-03-05 13:19:42 +01:00
Jonatan Kłosko
e27ff5a960
Rename Elixir cell to Code cell (#1035) 2022-03-02 12:48:02 +01:00
Jonatan Kłosko
aaeac6bb95
Add an action converting smart cell to elixir cell (#1030)
* Add an action converting smart cell to elixir cell

* Simplify tests setup

* Add confirmation

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

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

Co-authored-by: José Valim <jose.valim@dashbit.co>
2022-03-02 12:13:44 +01:00
Jonatan Kłosko
f58f9609d2
Fix race conditions in tests (#1031)
* Fix race conditions in tests

* Format

* Increase session import redirect timeout

* Increase intellisense timeout
2022-02-28 22:27:39 +01:00
Jonatan Kłosko
9d7fe44253
Introduce smart cells (#1029)
* Introduce smart cells

* Apply review comments
2022-02-28 13:53:33 +01:00
José Valim
3bc219e5d8
Bring path verification and add normalization (#1016)
* Bring path verification and add normalization

* Normalize user home

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-02-21 13:18:17 +01:00
José Valim
b2d717faee mix format 2022-02-21 09:00:32 +01:00
José Valim
7050180242 Resolve paths instead of raising 2022-02-21 08:08:24 +01:00
José Valim
71319246c4
Write to file out-of-band (#1006)
* Write to file out-of-band

It won't block the immediate write but it may block
a subsequent write. A sync function was added for
testing purposes.

* Update lib/livebook/storage/ets.ex

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

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-02-15 21:17:43 +01:00
Jakub Perżyło
48f72a003a
ETS config file persistence (#1002)
* Added Ets config storage file persistence

* Adjusted to review

* Adjusted to review

* Removed redundant code

* Update lib/livebook/storage/ets.ex

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

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-02-15 19:28:14 +01:00
Jonatan Kłosko
fb0c96fa99
Speed up tests (#996)
* Close sessions created during tests

* Change live_patch to live_redirect where applicable
2022-02-10 15:36:59 +01:00
Jonatan Kłosko
ca27bb157f
Refactoring (#994)
* Group all runtime messages under a common prefix

* Move output specification ot the Runtime protocol

* Update doc comments

* Livebook.Evaluator -> Livebook.Runtime.Evaluator

* Livebook.ContentLoader -> Livebook.Notebook.ContentLoader

* Livebook.UniqueTask -> Livebook.Utils.UniqueTask

* Add import/export delegates to Livebook.LiveMarkdown
2022-02-10 12:15:41 +01:00
Jonatan Kłosko
7f19afe7af
Fastlane JS channel events (#993)
* Fastlane JS channel events

* Abstract fastlaning to separate concerns
2022-02-09 23:15:03 +01:00
Jonatan Kłosko
19b777eb4e
Handle runtime event broadcast in a separate worker process (#992)
* Handle runtime event broadcast in a separate worker process

* Improve wording
2022-02-09 19:47:26 +01:00
Jonatan Kłosko
ccc64876a8
Add support for widget binary payloads (#982)
* Add support for widget binary payloads

* Migrate LV auth to a separate hook

* Properly set user buffer when encoding
2022-02-07 21:03:25 +01:00
gpopides
19f4f17e74
check if section has valid parent when importing notebook (#984)
* check if section has valid parent + tests

* formatting

* apply review feedback

* fix the forgotten test

* apply feedback

* apply feedback

* produce a warning if the section points to itself + tests

* Apply suggestions from code review

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-02-06 12:51:09 +01:00
Benjamin Philip
1a0b9e0f7d
Allow downloading source from sessions list (#980)
* Support downloading source on a per session basis

* Update session_list_component.ex

* Add test

* Update lib/livebook_web/live/home_live/session_list_component.ex

* Update test/livebook_web/live/home_live_test.exs

Co-authored-by: José Valim <jose.valim@gmail.com>
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-02-04 11:36:09 +01:00
Julian Gomez
358bdb3267
Export with title or file name (#870)
* Export file with title or file name

* Export with title or file name

* Add Session.file_name_for_download/1

* Compute the name without calling the server

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-02-03 21:17:30 +01:00
gpopides
be1fce326c
Pass file or directory as open command (#969)
* caputre directory from params

* set file if file parameter is a file

* set file param

* docs

* partial review changes

* apply review changes

* add tests and rename file to path

* formatting

* applied feedback + fixed test

* Apply suggestions from code review

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-02-03 20:26:18 +01:00
Jonatan Kłosko
5538e2e8c0 Fix race condition in notebook import test 2022-02-02 14:04:45 +01:00
en30
731d95e4f0
Skip XML.decode!(body) if body is empty (#956)
* Skip XML.decode!(body) if body is empty

Google Cloud Storage has almost S3 compatible XML API,
but some responses have `content-type: text/html; charset=UTF-8`
and empty body. This change prevents XML decode error and
enables work fine with Google Cloud Storage.

* Handle Google Cloud Storage XML API response

* Rename S3.encode to S3.decode

* Improve a test case description

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

* Make S3.decode/1 let any content type pass

* mix format

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-02-01 12:32:51 +01:00
José Valim
efdbf67f59
Introduce LIVEBOOK_HOME and LIVEBOOK_DATA_PATH (#963)
And move the relevant configurations to settings.
2022-01-31 11:51:57 +01:00
Jakub Perżyło
86e4034f33
Persistent storage (#937)
Start moving filesystems as an initial implementation.
2022-01-30 19:51:03 +01:00
José Valim
d2344a5c3b
Improve memory tracking and address race conditions (#957)
1. Allow multiple sessions to close or disconnect at once,
     and then request the system resources to be updated

  2. Make sure that closing a session happens synchronously,
     otherwise a race condition could still list the closed
     session in a dashboard

  3. Ensure close and disconnect can happen more than once
     (for example if two users click the same button at the
     same time)
2022-01-30 12:47:50 +01:00
Jonatan Kłosko
4d70e5cceb
Test and typing improvements (#949)
* Minimize race condition in the frame update test

* Use defmacrop for building intellisense context

* Remove unnecessary cell view computation

* Fix nested assets resolution

* Fix typing errors

* Add missing async attribute to test suites

* Improve rendering synchronization

* Up
2022-01-29 16:39:41 +01:00
Cristine Guadelupe
4dd28388a5
Bulk actions for sessions (#939)
* Initial implementation to close multiple sessions

* Sessions: bulk actions with components

* Rename Disconnect sessions to Disconnect runtime

* Select all and disabled when nothing is selected

* Styled checkbox

* Renames toggle events

* Warning about not persisted notebooks

* Adds disconnect runtime option for a single session

* Edit sessions on right

* Fix: typos and plural

* Minor adjustments

* Removes the loop for rendering the menu

* Menus with fixed width

* Minor adjustments

* Pluralize as global helper

* Bulk actions form on client side

* Track bulk actions buttons state

* Fix: home live tests

* Doctests for pluralize

* Fix: bulk actions buttons losing state on session update

* Fix: format

* Minor adjustment on toggle_edit

* Review-based adjustments

* Reset the Edit state after single-session actions

* Minor adjustments

* Fixes bulk action events

* Submit the bulk action form directly

* Tests for bulk actions

* Indentation

* Update lib/livebook_web/live/home_live/close_session_component.ex

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

Co-authored-by: José Valim <jose.valim@gmail.com>
2022-01-28 17:45:04 -03:00
Jonatan Kłosko
f8a216f8ee
Highlight code errors on formatting and evaluation (#948) 2022-01-28 21:00:31 +01:00
Jonatan Kłosko
188edfcf07
Handle intellisense during evaluation (#941)
* Handle intellisense during evaluation

* Apply review comments

* Add TODOs
2022-01-27 12:01:02 +01:00
Jonatan Kłosko
00c2cfb31a
Improve errors formatting (#936)
* Use monospaced font and wrapping for errors

* Improve function clause error format
2022-01-25 21:55:24 +01:00
Jonatan Kłosko
6b19f1d71b
Gracefully handle errors in the inspect protocol (#934) 2022-01-25 17:54:02 +01:00
Jonatan Kłosko
928cb5c592
Preserve Markdown modifiers in headings (#933) 2022-01-25 16:38:52 +01:00
José Valim
70a9a95d4e
Improvements to memory tracking (#917)
* Address race condition on cancel timer
* Include memory measurement as part of evaluation metadata
* Move periodic resource computation to a single process
* Have a explicit call out for total memory
2022-01-22 17:17:20 +01:00
Cristine Guadelupe
6180bb1ff2
Track memory usage - visualization (#898)
* Utils to fetch and format system and node memory usage

* Order by memory

* Track memory on session

* Show memory usage on runtime sidebar

* Shows memory usage percentage on home

* Layout adjustments

* Sidebar design adjustments to match Figma

* Home design adjustments to show the memory information

* Move memory calculations to utils

* Shows disconnected notebooks as consuming 0mb on home

* Simplifies the data structure of memory usage

* Node memory tracker on runtime

* Clean up

* Renames node memory to runtime memory

* Standardizes the data structure of memory usage

* Sends evaluation_finished to the runtime to update the memory usage after an evaluation

* Fix: The evalutor does not notify when there is no notify_to option

* Adds a test with the notify_to option to the evaluator

* Documents the notify_to option

* Minor fixes on runtime and runtime_server

* Minor fixes on sessions

* Minor adjustments

* Updates docs and specs on Utils

* Minor adjustments on session_live

* Fix total memory used by sessions on home

* Put duplicated functions on helpers

* Better filter by memory

* Fix the tooltip text for memory information on sidebar

* Minor alignment adjustment on home
2022-01-21 19:24:47 -03:00
Jonatan Kłosko
6aaf1d5b58
Fix output ambiguity in livemd import/export (#892)
* Fix output ambiguity in livemd import/export

* Update test/livebook/live_markdown/import_test.exs

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

Co-authored-by: José Valim <jose.valim@dashbit.co>
2022-01-19 18:27:56 +01:00
Jonatan Kłosko
ae0f083c5c
Fixes (#889)
* Fix title test

* Fix editable element check

* Fix duplicate output ids
2022-01-19 14:43:35 +01:00
Jonatan Kłosko
c57e5448b7
Remove old output formats (#876)
* Remove old outputs

* Remove other occurrences
2022-01-17 13:24:59 +01:00
Jonatan Kłosko
6615422613
Restructure frame output (#857)
* Restructure frame output

* Reboot JSComponent when ref changes

* Prune outputs from LV, handle frame and stdout updates via component messaging

* Keep ANSI modifiers as keyword list

* Don't re-render pruned outputs

* Improve empty frame styling

* Use more specific id

* Add clarification on trailing CR

* Handle output group borders with CSS

* Keep only relevant outputs in memory

* Adjust borders

* Update lib/livebook/live_markdown/import.ex

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

* Apply review comments

Co-authored-by: José Valim <jose.valim@dashbit.co>
2022-01-16 20:37:00 +01:00
Jonatan Kłosko
67952b07be
Fix unique task test race condition (#863) 2022-01-13 12:47:24 +01:00
Milo Lee
8ba0857369
Show deprecated and since doc metadata on mouse over (#852)
* Show deprecated and since doc metadata on mouse over

* Make deprecated indication stronger

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

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-01-11 19:18:47 +01:00
Jonatan Kłosko
118cf05d0a
Introduce broadcast communication from runtime (#845)
* Introduce broadcast communication from runtime

* Return broadcast target from group leader

* Increase timeout

* Make the channel test async

* Decouple base topic and ref
2022-01-10 18:38:08 +01:00
Daniel Kukula
618593158d
Set page name when notebook is renamed (#844)
* override tab name when notebook is renamed

* set page_title in after operation function

* add custom page title to all live pages

* Revert "override tab name when notebook is renamed"

This reverts commit 90303e08a8.

* add test for update
2022-01-06 18:37:55 +01:00
Jonatan Kłosko
19baf013d5
Introduce a dedicated channel for JS widget communication (#843)
* Introduce a dedicated channel for JS widget communication

* Handle payload serialization errors

* Tie channel lifetime to the session

* Catch serialization errors instead of encoding twice

* Merge JS static and dynamic outputs

* Authenticate socket connection from session

* Update JS output format

* Remove unused helper

* Apply review comments
2022-01-06 16:31:26 +01:00
Jonatan Kłosko
6d82e9e53d
Remove output border from dynamic JS widgets (#842)
* Remove output border from dynamic JS widgets

* Show borders on regular text outputs only

* Increase assertion timeout
2022-01-04 13:28:31 +01:00
Jonatan Kłosko
8622ae2ec3
Add support for exporting JS output (#826) 2021-12-27 13:56:55 +01:00
Jonatan Kłosko
844242ba80
Add support for JS output widgets (#818)
* Add support for JS output widgets

* Don't block session when fetching assets and batch calls

* Improve path component sanitisation

* Move fetching check to session caller

* Attach origin to connect and event messages
2021-12-24 14:18:34 +01:00
Jonatan Kłosko
87a17f1fc5 Respect \r in individual stdout results 2021-12-22 15:48:35 +01:00
José Valim
4badf40afc Add TODOs 2021-12-17 23:24:17 +01:00