Commit graph

614 commits

Author SHA1 Message Date
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
José Valim bd3363acde
Allow LIVEBOOK_PORT to be set to 0 for a random port (#906) 2022-01-21 09:18:02 +01:00
Jonatan Kłosko 5411035937
Remove unnecessary scrollbar in Mix runtime modal (#903) 2022-01-20 11:35:54 +01:00
Jonatan Kłosko a9f9c68cfa
Compute iframe base URL based on page origin (#902)
* Compute iframe base URL based on page origin

* Format
2022-01-20 11:29:45 +01:00
José Valim 112b47908d
Small fixes (#896)
* Hide app builder unless target matches
* Fix compile-time warnings on Elixir v1.14+
2022-01-19 22:20:05 +01:00
Jonatan Kłosko 81c9871802
Release 0.5.0 (#895)
* Update Kino version

* Bump version
2022-01-19 19:58:54 +01:00
Jonatan Kłosko 5c1c61d0f2
Update broadcast_event in Kino.JS.Live guide (#894) 2022-01-19 19:39:57 +01:00
José Valim b9b901648c
Further improvements to pong and custom kino notebooks (#886) 2022-01-19 19:01:27 +01: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 3a0d77d879
Disable keyboard control when an editable element is focused (#885) 2022-01-19 13:05:21 +01:00
Jonatan Kłosko 89ca95be10
Reuse DOM elements when replacing frame outputs (#881)
* Reuse DOM elements when replacing frame outputs

* Keep less persistent indices
2022-01-18 15:13:50 +01:00
Jonatan Kłosko 6e570ed05b
Improve branch selection menu (#882) 2022-01-18 15:12:09 +01:00
Wojtek Mach e8c80bf6a7
Add Mac app release (#865) 2022-01-17 17:34:38 +01:00
José Valim 4d79706c01
Revamp Explorer section for Kino (#879)
Pong and custom Kinos chapters are still pending.
2022-01-17 17:14:25 +01:00
Jonatan Kłosko fe0bf660a2
Remove outputs from the page on erase outputs (#878) 2022-01-17 17:13:29 +01:00
José Valim 0c61f4dec0 Normalize explorer fonts 2022-01-17 17:11:06 +01:00
Jonatan Kłosko d450444f04 Fix global indicator colors 2022-01-17 14:19:20 +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 6d1d4de767
Push cells source to the client on initial render (#875) 2022-01-17 13:20: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
José Valim 68e81356f6
Improvements to theme (#871) 2022-01-16 12:40:14 +01:00
Jonatan Kłosko 35e42d1bad
Keep editor background on rerender (#869) 2022-01-15 23:08:45 +01:00
Cristine Guadelupe 67fa155f3d
High-contrast option for the code editor (#868)
* High-contrast option for the code editor

* Small refactor

* Creates a high-contrast theme from the custom theme

* Refactor to store the theme as a string

* Fix prettier
2022-01-15 18:46:25 -03:00
Cristine Guadelupe 36aab4357c
Adds an option to increase the font size of the editor (#860)
* Adds an option to increase the font size of the editor

* Update lib/livebook_web/live/settings_live.ex

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

* Editor font size options as constants

Co-authored-by: José Valim <jose.valim@gmail.com>
2022-01-13 15:06:50 -03:00
Cristine Guadelupe 9690e2ac51
Minor design improvements (#858)
* Adds the greens and yellows from the custom color palette

* Keeps the cell status indicators with the original bright colors

* Increases icon-button contrast

* Increases labeled_text font-size

* Removes type: button to fix the runtime sidebar buttons style on Safari

* Increases the toggleable menu contrast on hover

* Use the same color for the stale state in the sections sidebar
2022-01-13 15:06:11 -03:00
José Valim dbe4fdeda4
Add shutdown button (#862)
The button only appears on interactive mode because
we assume embedded mode is running inside a release
or similar.
2022-01-13 12:22:34 +01:00
José Valim a1c5521115
Fix about section in settings (#861) 2022-01-13 12:02:06 +01:00
Jonatan Kłosko fc20b662ce Fix dashboard path 2022-01-12 20:16:27 +01:00
Julian Gomez bf94998d83
Add current version section to settings page (#851)
* Add version section to settings

* Add System Settings Version subsection

* Apply suggestions from code review

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-01-12 13:28:10 +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 53869371c2
Update dependencies (#838)
* Update Elixir deps

* Update JS dependencies

* Bump Tailwind to v3

* Update Hex badge color

* Set SameSite for the session cookie
2021-12-29 22:06:19 +01:00
Jonatan Kłosko d5d4e739d1
Improve errors on reconnecting Mix runtime (#837) 2021-12-29 14:04:51 +01:00
Jonatan Kłosko 145f8a6992
Focus fixes (#831) 2021-12-28 19:42:04 +01:00
Jonatan Kłosko 5670e5ccb6
Group Kino notebooks under their own section (#830) 2021-12-27 21:01:31 +01:00
Lee Jarvis 4bacba6b1d
Remove delete prompt for empty sections (#829)
* Remove delete prompt for empty sections

If a section has no cell views or only empty cell views, avoid
prompting the user to delete the section and just go ahead and delete
it.

Closes #800

* Move delete prompt logic to SessionLive

This avoids creating two separate paths in the view for displaying
delete buttons (triggering either a prompt, or deleting the empty
section).

Instead, the `delete_section` callback is always triggered, and the
"display prompt" logic is kept here.

Couple of things I'm unsure about so will discuss on the PR.

See https://github.com/livebook-dev/livebook/pull/829#discussion_r775560671

* Check only against empty cell list in `delete_section`

* Fix indentation

* Handle section not existing on deletion

* Match empty cell list in case expression

Also explicitly set the section and then re-use it. I think this is a
bit nicer than just matching against the empty list since it matches
the following match too
2021-12-27 18:42:27 +01:00
Jonatan Kłosko 8622ae2ec3
Add support for exporting JS output (#826) 2021-12-27 13:56:55 +01:00
Benjamin Philip fc3fad6543
Disable Choose button if draft file is a directory (#823)
* Disable Choose button if draft file is a directory

* Fix warnings

* Decide if choose is disabled on handle info

* Revert "Decide if choose is disabled on handle info"

This reverts commit 43a2cbc5ea.

* Use the disabled attribute
2021-12-24 23:53:48 +01:00
Benjamin Philip 39fedd43ca
Disable Ecto stats in Phoenix Live Dashboard (#824)
Livebook does not use Ecto, so disable Ecto stats.
2021-12-24 19:05:19 +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
Michał Gibowski 10b78973cc
Fix spelling in runtime.ex docs (#822) 2021-12-23 13:20:55 +01:00
Benjamin Philip 1f6a75c4e3
Do not show choose file button if file select component is active (#821) 2021-12-23 12:29:49 +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
José Valim d8833be010 Make app.html consistent with live.html 2021-12-16 20:21:49 +01:00
José Valim 8f25c25c7a
Trigger the GC after evaluation and intellisense (#807)
This reduces memory consumption by the runtime,
especially when using intellisense features which
may generate a lot of garbage.

There is an odd chance this can generate slow downs
in certain cases but, for that to happen, I would
expect the notebook to either have a lot of data
allocated or many users interacting with it and
triggering completion and other features at the same
time.

We don't worry about the second case because the
goal is to move completion to an ephemeral separate
process anyway, which would remove the need for GC
during completion altogether (and allow several
completions to run concurrently). If this happens,
we can consider moving GC out of the evaluator and
have the session explicitly trigger it once it
terminates a chain of evaluation.

It is also worth triggering the GC whenever
we forget an evaluation context.
2021-12-15 12:25:09 +01:00
Jonatan Kłosko 877ab913c8
Display full module name in hover docs (#798)
* Display full module name in hover docs

* Use inspect

* Return atom names from identifier matcher
2021-12-12 21:34:16 +01:00
Max Veytsman 4aa5447e9d
Add completion for struct keys (#793)
* Add completion for struct keys

Largely ported from `IEx.Autocomplete`.

* Add test for __exception__ field in struct

* Fix exception test

* Fix exceptions assetion

* Create `:in_struct_field` identifier

Along with a refactor

* Fix typespecs for `:map_field`

* Address feedback

* Update lib/livebook/intellisense/identifier_matcher.ex

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

* Use markdown snippet for both docs

* Fix tests

Co-authored-by: José Valim <jose.valim@gmail.com>
2021-12-12 21:19:17 +01:00
Jean Carlos aa8f431608
Added margin on copy button (#796)
* fix handleDocumentFocus error

* format correction

* Update assets/js/session/index.js

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

* format correction

* Update assets/js/session/index.js

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

* Move basic view to the top

* Added margin on copy button

* Update lib/livebook_web/live/output/text_component.ex

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

* Update lib/livebook_web/live/output/text_component.ex

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-12-12 20:26:10 +01:00
Jonatan Kłosko b0563d14a6
Fix completion shortcuts (#792)
* Fix completion shortcuts

* Remove shortcut override
2021-12-12 00:10:15 +01:00
Jonatan Kłosko 6f53e3db6a
Add support for form control (#790)
* Add support for form control

* Handle report_changes map

* Assert on input/control events
2021-12-12 00:09:35 +01:00
Thomas Schmidleithner 460668402f
Fix docs after refactoring live_modal to modal (#794) 2021-12-12 00:08:54 +01:00
Jean Carlos 1d6348d7f1
Move basic view in the shortcut pane to the top (#791)
* fix handleDocumentFocus error

* format correction

* Update assets/js/session/index.js

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

* format correction

* Update assets/js/session/index.js

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

* Move basic view to the top

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-12-11 01:57:54 +01:00
José Valim bb27fc9fa8 Remove compile time deps from erl_dist 2021-12-10 23:38:57 +01:00
José Valim 8cb511fb87 Move required cell to autocomplation section for clarity 2021-12-10 16:04:48 +01:00
José Valim 69da78c13a Disable consolidation in distributed notebook, closes #786 2021-12-10 11:30:42 +01:00
Jonatan Kłosko b422e1d98f
Revert to URI.new! (#784) 2021-12-09 20:46:45 +01:00
José Valim c66582f8bb
Include full stacktrace for unexpected exceptions (#781)
* Include full stacktrace for unexpected exceptions

* Update lib/livebook_cli.ex

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-12-09 15:44:23 +01:00
Jonatan Kłosko a133a7070d
Use different icon when output is amplified (#775) 2021-12-08 16:30:52 +01:00
Jonatan Kłosko fef322706f
Revert to URI.parse/1 (#770) 2021-12-08 16:11:04 +01:00
Kevin c9b21f221d
Update file infos then running_files changed (#772) 2021-12-08 13:53:31 +01:00
Kevin feb0ac214e
Fix error on back after closing session (#769)
* Fix error on back after closing session

Clicking the browsers back button after closing a session
resulted in an error since it was trying to close an already closed notebook

* Overwrite back history on section delete
2021-12-08 13:17:50 +01:00
Jonatan Kłosko 89ea67861f
Improve "changed" indicator and batch evaluation shortcuts (#766)
* Make cell status italic when content changed

* Add Ctrl+Shift+Enter for evaluating all cells

* Improve the behaviour of evaluating all cells

* Fix typo
2021-12-07 19:14:32 +01:00
Kyungyeol Kim (Bret) a5cb366c73
Fix class name in import_file_uploader_component (#762) 2021-12-06 12:38:39 +01:00
Jonatan Kłosko b97cde0879
Improve completion (#756)
* Don't show variable value in intellisense

* Don't complete quoted atoms
2021-12-05 16:49:51 +01:00
Jonatan Kłosko be3225fe3a
Bump Kino in explore notebooks (#755) 2021-12-05 16:26:46 +01:00
Jonatan Kłosko d909272746
Improve completion (#747)
* Add keywords to completion

* Fix signature request caching for call without parentheses

* Don't insert parentheses for def* macros

* Don't trigger missing runtime message when auto completion is enabled

* Don't insert parentheses for keyword macros

* Improve completion of env macros

* Apply review comments

* Update locals without parentheses

* Apply suggestions from code review

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

* Format

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-12-05 14:58:30 +01:00
Jonatan Kłosko 4b5ea87b3d
Include notebook name in the autosaved notebook path (#748)
* Include notebook name in the autosaved notebook path

* Add test for persisting unsaved notebooks
2021-12-05 14:58:19 +01:00
Kevin 40e3a61e00
Expand System.tmp_dir!() path by default (#754)
Since System.tmp_dir!/0 returns the path with backslashes instead of
frontslash it is piped to Path.expand/1 to normalize it to frontslashes.
2021-12-05 14:58:07 +01:00
ryg-git 2fe9ca73c7
Fix typo in keyboard shortcuts modal (#751) 2021-12-05 12:50:28 +01:00
Jonatan Kłosko f0606b109d
Automatically back up notebooks without a file (#736)
* Improve file select layout on long paths

* Automatically back up notebooks without a file

* Run formatter

* Add margin when there are no sections

* Add an informative note about autosave directory

* Store autosave path instead of file in the config

* Rename autosave dir to autosave path

* Fix insert mode escape on section headlines

* Show ellipsis on selected file too

* Always create the default directory

* Apply review comments
2021-12-04 16:29:14 +01:00
Jonatan Kłosko 037c425643
Bump Kino version in explore notebooks (#744) 2021-12-04 14:44:53 +01:00
Jonatan Kłosko ab0a237ab6
Completion adjustments (#740)
* Show exceptions at the end of completion list

* Don't complete hidden functions
2021-12-03 23:28:34 +01:00
José Valim 18d8eccc9e
Do not try to accidentally load elixir.beam (#739) 2021-12-03 22:50:45 +01:00
Jonatan Kłosko e2490c0f7f
Implement signature intellisense (#640)
* Remove Code.Fragment backport

* Fix tests compatibility with Elixir 1.13

* Implement signature intellisense

* Don't show signatures on module attributes

* Add tests for calls with do-end block

* Unify spec formatting

* Insert parentheses when completing a function call

* Send all text until cursor in signature request

* Add configuration for completion/signature popups (#693)

* Add editor settings form

* Add configuration for intellisense defaults

* Read fresh settings when editor mounts

* Scope attribute names

* Fix disabled button styling

* Simplify signature box and enable by default

* Split settings into system and user sections

* Update lib/livebook_web/live/settings_live.ex

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

* Update lib/livebook_web/live/settings_live.ex

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

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

* Fix spacing in documentation tests

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-12-03 21:57:21 +01:00
Jonatan Kłosko 47d29cb389
Require Elixir 1.13 (#737)
* Bump required Elixir version to 1.13 and fix TODOs

* Fix tests

* Remove the deprecated URI.parse/1

* Bump Docker base image

* Bump Elixir on CI
2021-12-03 21:47:20 +01:00
Jonatan Kłosko ac6b423e79
Fix frame rendering (#735)
* Fix frame rendering

* Add test for the dynamic frame
2021-12-03 18:59:08 +01:00
Jonatan Kłosko 6de1dd84c2
Fix long section names alignment (#734) 2021-12-03 15:18:48 +01:00
José Valim 2c91de3cd6
Streamline introductory notebooks (#733) 2021-12-03 15:17:09 +01:00
Jonatan Kłosko 04f15f60a3
Add Pong notebook to the explore section (#729) 2021-12-03 15:08:28 +01:00
Jonatan Kłosko 4debf2c1fb
Fix evaluation timer on page refresh (#732) 2021-12-03 14:23:50 +01:00
Jonatan Kłosko 0b6acb9d34
Hide reconnect runtime button once reconnected (#731) 2021-12-03 14:03:06 +01:00
Jonatan Kłosko 264d6c3ff2
Add support for controls output type (#710)
* Add support for controls output type

* Split controls into individual widgets

* Adjust ids

* Improve widget and controls garbage collection

* Allow arbitrary functions as object release hook

* Add type to button and input events

* Add keyboard status event

* Change release hooks into monitor messages

* Rename pointer to reference and return an error on bad monitor
2021-12-02 16:45:00 +01:00
Alexandre de Souza 79d6a9e6a2
Rename restart runtime to reconnect (#721)
* Rename restart runtime to reconnect

* Update lib/livebook_web/live/output.ex

Co-authored-by: José Valim <jose.valim@gmail.com>
2021-12-01 17:21:49 +01:00
Jonatan Kłosko c2636b8220
Migrate inputs to Kino (#714)
* Migrate inputs to Kino

* Update lib/livebook/session/data.ex

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

* Try parsing numbers as integers

* Garbage collect input values

* Adjust tests

* Remove unused variable

* Fix frame rendering

* Wrap inputs in border depending on its type

* Add textarea

* Reorder

* Update tests

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-11-25 18:43:42 +01:00
Jonatan Kłosko f64dd0ea90
Restructure j/k navigation to support headlines (#707)
* Accessibility fixes

* Restructure j/k navigation to support headlines

* Focus modal content when open

* Further focus adjustments

* Fix tests

* Remove unused functions
2021-11-16 21:57:10 +01:00
Jonatan Kłosko 4d92aeba2e
Support file scheme when importing from URL (#706)
* Add test

* Support file scheme when importing from URL
2021-11-12 15:49:22 +01:00
José Valim d78a3cf865
Include reason if we can't start Livebook, closes #703 (#705) 2021-11-12 14:36:02 +01:00
Jonatan Kłosko 247abd8f57
Add section on Kino.animate and bump dependencies (#700)
* Add section on Kino.animate and bump dependencies

* Update lib/livebook/notebook/explore/intro_to_kino.livemd

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

* Update lib/livebook/notebook/explore/intro_to_kino.livemd

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

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-11-10 22:16:42 +01:00
Jonatan Kłosko 7eac7a83ac
Implement clipboard copy with JS commands (#699) 2021-11-10 20:17:32 +01:00
Jonatan Kłosko 3ed5da0106
Implement menu with JS commands and extract into component (#698) 2021-11-10 19:28:09 +01:00
Jonatan Kłosko d81965ee99
Redesign runtime panel and sessions list (#697)
* Redesign runtimes panel

* Redesign session list

* Add session sort

* Move session list to a separate component

* Up
2021-11-10 18:50:39 +01:00
Jonatan Kłosko 54511d5ffc
Add env var for disabling token auth (#696) 2021-11-10 13:54:50 +01:00
Jonatan Kłosko d8d52c9e89
Add runtime info panel (#692)
* Add runtime info panel

* Remove intro from the runtime modal

* Show default runtime in the panel if no runtime is set
2021-11-09 18:37:22 +01:00
José Valim e67428e918
Simplify fun with vm instrospection (#690)
If we want to show process specific information,
we can create branches in the future that receive
a PID input, reach out to the remote node, and
show the data using markdown.
2021-11-09 11:04:18 +01:00
Jonatan Kłosko c473a8c469
Add an option to amplify cell outputs (#689)
* Add an option to amplify cell outputs

* Reorder actions
2021-11-09 10:45:05 +01:00
Jonatan Kłosko 0b30fd02d9
Add support for frame_dynamic output type (#688) 2021-11-08 20:45:30 +01:00
Jonatan Kłosko e72a606dd2
Warn on invalid sequence of notebook comments (#687) 2021-11-08 13:14:55 +01:00
Jonatan Kłosko 6bf2f9cb7a
Revert wording in code formatting configuration (#681) 2021-11-05 20:04:50 +01:00
José Valim 767a12ab77
Show reevaluate true example (#680) 2021-11-05 08:15:14 +01:00
José Valim 49a406b579
Branch from setup on Kino guide (#678) 2021-11-05 08:14:29 +01:00
Jonatan Kłosko 982a345ddc
Improve notebook file locking to work across nodes (#675)
* Improve notebook file locking to work across nodes

* Add node check for local file system opreations

* Replace node with host id

* Refactor process down cleanup

* Scope local file system with node

* local? -> type
2021-11-05 00:29:04 +01:00
Jonatan Kłosko 5e5bc2597a
Document how to render notebooks on GitHub (#677)
* Document how to render notebooks on GitHub

* Keep any comments before the notebook title heading
2021-11-04 18:50:53 +01:00
Cocoa a15ec1ca1d
Save static vegalite plot to livemd (#676)
* save static vegalite plot to livemd

* cleanup debug code

* using `vega-lite` as the type in the fenced code block

* wrap the text output in `{:text, output}` in take_outputs/2

* ignore :vega_lite_static when it is empty

* add import and export tests

* using `spec`

* format code

* keep the test focused

* improve tests for not including outputs

* always dump vage_lite spec

* Apply suggestions from code review

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-11-04 12:17:03 +01:00
Jonatan Kłosko 8c923f7bda
Show new directory section immediately on the client (#674) 2021-11-03 17:16:09 +01:00
Jonatan Kłosko ad4867ddfb
Refactor modals with JS commands (#669)
* Use JS commands for closing the modal with animations

* Refactor modal to render content as slot

* Bump LV
2021-11-02 22:34:44 +01:00
Jonatan Kłosko 3afa81f454
Add configuration for additional explore notebooks (#670)
* Add configuration for additional explore notebooks

* Update config/config.exs

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

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-11-02 22:32:58 +01:00
Jonatan Kłosko fbd03d6725
Update Phoenix LV (#656)
* Wrap live routes in live_session

* Update Phoenix LV

* Migrate to live_component component call

* render_block -> render_slot

* phx-disconnected -> phx-loading

* phx-capture-click -> phx-click-away

* Add hook dealing with current user

* Bump LV

* Bump LV
2021-11-01 19:33:43 +01:00
Jonatan Kłosko 021d6ac42e
Improve icon buttons accessibility and navigation (#667)
* Rename tooltip source attribute

* Add aria-label to icon buttons/links

* Actually focus cell content when navigating around

* Add some descriptions

* Fix dynamically computed tooltips
2021-11-01 18:20:56 +01:00
Jakub Perżyło ace64eab37
Add show/hide button for password inputs #566 (#664)
* Added visibility toggle for password cell

* Formatted code

* Moved password toggle to separate component

* Adjusted to review

* Added password toggle for add filesystem component

* Update lib/livebook_web/helpers.ex

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-11-01 16:04:11 +01:00
Jakub Perżyło fbef386aa8
Allow importing a livebook via file upload #645 (#665) 2021-11-01 13:59:39 +01:00
Jonatan Kłosko 2694007c0e
Compute cell snapshots when an existing notebook is given (#666) 2021-11-01 13:59:04 +01:00
Jean Carlos 421b1c69a1
Show indicators of state on session sidebar (#657)
* Added range input (Slider)
* Added range input (Slider)
* Custom css to range input

* Formatting correction

* Defined min and max values of input range

* Revert "Defined min and max values of input range"

This reverts commit 815167ab0f.

* Added input select

* working with a options like list

* Formatting correction

* swapped li for inputs in input settings

* Removed unused attribute

* Final adjustments

* Improve users connected display

* Update lib/livebook_web/live/session_live.ex

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

* Update lib/livebook_web/live/session_live.ex

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

* Adjust elements

* Change favicon based on notebook status

* Format correction

* "operation" is unused

* Improvements for better functioning of icons

* Renamed icons files

* Update favicons

* Update changelog

* Show indicators of state on session sidebar

* Changes to status colors

* Improve spacing

* Scroll to cell on status click

* global_evaluation_status -> global_status

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-11-01 13:15:21 +01:00
Kian Meng Ang e16c8a5dab
Fix typos (#654) 2021-10-31 07:14:35 +01:00
Jonatan Kłosko dbccadfdcf
Redesign save to file modal (#663)
* Redesign save to file

* Always show Save when a file is present

* Fix indentation
2021-10-30 12:02:26 +02:00
Jonatan Kłosko 529339c8a2
Remove configuration env vars on boot (#662)
* Remove configuration env vars on boot

* Update lib/livebook/application.ex

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

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-10-29 20:49:25 +02:00
Jonatan Kłosko ac1a4a5ffb Add action for clearing evaluation and outputs (#661)
* Move notebook export menu item

* Add action for clearing evaluation and outputs

* Test data operation

* Update wording

* Update wording

* Reorder menu items
2021-10-29 16:34:44 +02:00
José Valim 8a0d218cbe The first address for a shortname must be the one that matches 2021-10-29 16:29:27 +02:00
Jonatan Kłosko 4493a60380
Improve runtimes UI (#655)
* Show reconnect for all runtime types when applicable

* Make it clear which runtime is the default

* Show Mix.install restart suggestion only for standalone runtimes

* Fix tests not to rely on the default runtime tab
2021-10-28 19:41:07 +02:00
José Valim 8fe8d27d3d Allow any address we might be listening on 2021-10-27 17:27:52 +02:00
Jonatan Kłosko 386fe5b531 Redesign flash message snackbars 2021-10-27 17:04:33 +02:00
Jonatan Kłosko 394c6daef1
Improve validity check when input changes during evaluation (#651) 2021-10-27 15:36:50 +02:00
Jonatan Kłosko 6ba5d0017a
Allowapplication/octet-stream content type for import (#650) 2021-10-27 13:49:03 +02:00
Jonatan Kłosko c1a6bc1aa8
Remove reactive inputs (#649) 2021-10-27 13:35:24 +02:00
gpopides 5c0267b547
Added automatic cell evaluation (#637)
* Added automatic evaluation

* apply review changes

* persist reevaluate_automatically and update test

* test for automatic reevaluation

* formatting

* Add import test

* Always show if a cell automatically reevaluates and link to settings

* Evaluate automatically reevaluating cells after queuing

* Always show evaluate button when cell is fresh

* Update icon

* Add test ensuring that fresh cells don't evaluate automatically

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-10-26 20:38:30 +02:00
Wojtek Mach 453eabb6d4
Fix urls on Elixir master (#647)
Before Elixir master, empty path is represented as `nil`:

    ~% asdf shell elixir 1.12.3-otp-24 ; elixir -e 'IO.inspect URI.parse("http://localhost")'
    %URI{
      authority: "localhost",
      fragment: nil,
      host: "localhost",
      path: nil,
      port: 80,
      query: nil,
      scheme: "http",
      userinfo: nil
    }

On Elixir master, it is an empty string:

    ~% asdf shell elixir git ; elixir -e 'IO.inspect URI.parse("http://localhost")'
    %URI{
      authority: "localhost",
      fragment: nil,
      host: "localhost",
      path: "",
      port: 80,
      query: nil,
      scheme: "http",
      userinfo: nil
    }

The new default, the empty string, caused a bug on this line:

    Map.update!(:path, &((&1 || "/") <> path))

because we never prepended the leading `/` and thus we ended up with
path `"health"`, not `"/health"`, which now on Elixir master crashes:

    iex> URI.parse("http://localhost") |> Map.replace!(:path, "health") |> to_string()
    ** (ArgumentError) :path in URI must be empty or an absolute path if URL has a :host, got: %URI{authority: "localhost", fragment: nil, host: "localhost", path: "health", port: 80, query: nil, scheme: "http", userinfo: nil}
        (elixir 1.13.0-dev) lib/uri.ex:863: String.Chars.URI.to_string/1
2021-10-26 16:48:17 +02:00
Jonatan Kłosko 9da44fd541
Fix root directory listing on S3 when empty (#646) 2021-10-26 15:39:24 +02:00
Owen Bickford b6793d6630
Type1fool-smooth-scrolling (#638)
* add scroll behavior to html, body, & notebook elems

* don't append base url or set target on intra-page links

* add back-to-top link, class autosorting/formatting

* add convert global style to `.scroll-smooth` util

* add `isPageAnchor` function

* remove `go-to-top` link

* use `isAbsoluteUrl` and add a semicolon ;)
2021-10-24 19:38:57 +02:00
Matheus Cumpian c6d7c81ee9
New import info flash (#630)
* adding a new info flash on imported notebooks

* changing the imported notebook error flashes to warning level

* Update lib/livebook_web/live/session_helpers.ex

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

* adding unit tests for the flash messages and fixing put_import_flash/1 call location

* changing name of put_import_flash_messages/2 to put_import_warnings

* Update lib/livebook_web/live/home_live.ex

* formating code

Co-authored-by: José Valim <jose.valim@gmail.com>
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-10-21 23:21:54 +02:00
Matheus Cumpian 887a4ad0d1
adding a new message to close session modal (#629)
* adding a new message to close session modal when the session has a file attached to it

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

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

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-10-21 15:01:45 +02:00
Jonatan Kłosko e2e9c95880
Update hostname resolution check (#628) 2021-10-21 12:45:07 +02:00
José Valim b930d8620a
Prepare to make Explore section extensible (#626) 2021-10-20 22:27:00 +02:00
José Valim 3ab2a56924
Fix shortnames not pointing to 127.0.0.1 (#625)
Someone reported an issue where their shortname
host was not pointing to 127.0.0.1, which caused
connections to fail. Therefore we also check and
detect this case.
2021-10-20 22:02:25 +02:00
Matheus Cumpian f6d31a7d86
adding a disabled delete button for sections that have branches (#624)
* adding a disabled delete button for sections that have branches

* Apply suggestions from code review

* Update assets/css/components.css

* Apply suggestions from code review

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-10-20 18:10:11 +02:00
Jonatan Kłosko aefe8d03c8
Fix intermediate output ids to not change on finished evaluation (#622) 2021-10-20 00:32:48 +02:00
Matheus Cumpian fe77823685
Removing "Evaluate All Below" shortcut functionality (#621) 2021-10-19 23:36:44 +02:00
Matheus Cumpian 7094433b5d
Change color for aborted and queued status (#620) 2021-10-19 20:32:00 +02:00
José Valim 0b6f416bbc Improvements to notebooks that rely on distribution 2021-10-19 19:19:25 +02:00
Jonatan Kłosko 05490b43cb
Open standalone runtime ports in binary mode (#608) 2021-10-19 14:27:38 +02:00
Jonatan Kłosko 06f83def3d
Normalize session tmp directory path (#604) 2021-10-18 22:35:51 +02:00
Jonatan Kłosko a41dda9c7c
Keep static files outside priv (#602)
* Keep static files outside priv

* Override generated assets on the CI
2021-10-18 22:32:09 +02:00
Jonatan Kłosko 3a8c11cb10
Remove version from the health endpoint (#601) 2021-10-18 18:28:19 +02:00
Jonatan Kłosko 5131a9e683
Enable CORS for health check (#600) 2021-10-18 18:07:18 +02:00
José Valim 861fc3110b Remove paragraph leading to other notebooks 2021-10-16 20:53:52 +02:00
Jean Carlos 238635a6be
Changed favicon with base on notebook status (#594)
* Change favicon based on notebook status

* Format correction

* "operation" is unused

* Improvements for better functioning of icons

* Renamed icons files

* Update favicons

* Update changelog

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-10-16 12:24:19 +02:00
Jonatan Kłosko 3ae67ede33
Add support for importing notebook from URL query parameter (#598)
* Add support for importing notebook from URL query

* Update desc

* Update URL and redirect to import form on error

* Update tests

* Remove URL scope
2021-10-16 12:23:08 +02:00
Jonatan Kłosko 06822b6e7e
Prefix base64 encoded cookie (#597) 2021-10-13 23:07:50 +02:00
Jonatan Kłosko 5dea204fc9
Fix intermittent test failures (#596)
* Bump Elixir on the CI

* Start permanent node manager in tests

* Adjust timeouts

* Make sure random node cookies are alphanumeric
2021-10-13 22:25:33 +02:00
gpopides d2cdf0a2cb
Display creation date of a session in home (#593)
* add created_at to Session struct

* test + doc enhcncement

* change format creation date function name

* use helper function to format created_at

* use mix format

* apply review suggested  changes and 2 more tests

* Store creation time in session state and sort by date by default

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-10-10 12:29:45 +02:00
Jean Carlos a13e691e44
Improvement users connected display (#591)
* Improve users connected display

* Update lib/livebook_web/live/session_live.ex

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

* Update lib/livebook_web/live/session_live.ex

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

* Adjust elements

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-10-10 12:15:15 +02:00
Dimitris Zorbas 6391b65060
Fix doc typo in cell_component.ex (#592) 2021-10-09 20:20:13 +02:00
José Valim d8a7af62e7
Increase the default stack for dirty io threads (cuda requires it) (#585)
Closes #579.
2021-10-05 18:23:50 +02:00
Frank Hunleth b3df13dd77
Fix typo (#578) 2021-10-05 07:30:03 +02:00
José Valim 354aae9467
Encapsulate compile and runtime configuration (#577) 2021-10-05 00:49:01 +02:00
Jonatan Kłosko ac60aba2fb
Make it possible to configure custom plug for all requests (#576)
* Make it possible to configure custom plug for all requests

* Apply review comments

* Use fetch_env!
2021-10-05 00:44:27 +02:00
Jonatan Kłosko 25d90eabf1
Add public function for converting .livemd to .exs (#573) 2021-10-05 00:26:41 +02:00
Jonatan Kłosko a57927ec2a
Extend ANSI code parser to handle multiple arguments (#569)
* Extend ANSI code parser to handle multiple arguments

* Update changelog
2021-09-30 17:57:14 +02:00
José Valim 026945e669 Remove breaks to improve readability 2021-09-25 20:54:27 +02:00
José Valim cd2c3bd5a8 Format 2021-09-25 20:35:06 +02:00
José Valim 36682edbe7 Include Intro to Nx in the homepage 2021-09-25 20:33:39 +02:00
Bruce Tate 54692ca509
Initial notebook for intro_to_nx.livemd (#528) 2021-09-25 20:29:13 +02:00
Jonatan Kłosko fad9301ad4
Fix branching section evaluation when the parent section is empty (#560)
* Fix branching section evaluation when the parent section is empty

* Update changelog
2021-09-23 13:20:49 +02:00
Jonatan Kłosko 47dcc808e8
Fix PageHelpers.title/1 example (#555) 2021-09-18 23:51:16 +02:00
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 f83e51409a
Add reference to the Kino notebook (#539)
* Add reference to the Kino notebook

* Update lib/livebook/notebook/explore/elixir_and_livebook.livemd

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

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-09-03 13:25:22 +02:00
José Valim bbd7cc79f5
Use Kino as example instead of Jason (#538) 2021-09-03 12:34:37 +02:00
Jonatan Kłosko 6bf0a6ba7c
Further adjust branching tooltip (#537) 2021-09-03 12:09:48 +02:00
Jonatan Kłosko f5827d11b0
Squeeze tooltip in the sections panel (#536) 2021-09-02 14:53:44 +02:00
Jonatan Kłosko 1dbdd47b90
Add scrollbar to the sections side panel (#534) 2021-09-01 12:45:27 +02:00
Jonatan Kłosko cfb719cbb0 Fix dialyzer warnings 2021-08-31 22:19:52 +02:00
Jonatan Kłosko 671c9b679e
Ensure upload path is normalized (#532)
* Ensure upload path is normalized

* Add TODO
2021-08-31 13:17:38 +02:00
Jonatan Kłosko 2a338b6b83
Detect if Livebook or another application is running on the given port (#530)
* Detect if Livebook or another application is running on the given port

* Use json/2

* Print error when the port is taken
2021-08-30 23:23:05 +02:00
Wojtek Mach 01c079a697
livebook server: Add --open-new flag (#529)
* livebook server: Add `--open-new` flag

* Update lib/livebook_cli/server.ex

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

* Update lib/livebook_cli/server.ex

* Update changelog

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-08-30 20:52:08 +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 071ac63cd4
Improve input type parsing (#517)
* Improve input type parsing

* Move type parsing to Cell.Input

* Add info comment
2021-08-25 12:38:30 +02:00
Jonatan Kłosko acd100f3d3
Improve intellisense to handle structs and sigils (#513)
* Update Code.Fragment backport

* Support structs completion and show module subtype

* Support sigil completion

* Update changelog

* Don't show completion items for hidden modules

* Update Code.Fragment backport
2021-08-23 10:42:18 +02:00
Jonatan Kłosko ab30f84548
Improve error message when attaching to a remote node with different ERTS version (#511)
* Improve error message when attaching to a remote node with different ERTS version

* Make the error more specific

* Update lib/livebook/runtime/erl_dist.ex

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

* Update lib/livebook/runtime/erl_dist.ex

* Update lib/livebook/runtime/erl_dist.ex

* Update lib/livebook/runtime/erl_dist.ex

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-08-22 00:52:19 +02:00
Jonatan Kłosko 87b6f6160e
Fix identifier details on local calls (#509) 2021-08-21 01:24:44 +02:00
Jonatan Kłosko f9e67d27c0
Add a keyboard shortcut for triggering on-hover docs (#508)
* Add a keyboard shortcut for triggering on-hover docs

* Update changelog
2021-08-20 23:25:18 +02:00
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 9822735bcf Update GitHub org references from elixir-nx to livebook-dev 2021-08-18 15:55:07 +02:00
Jonatan Kłosko bf05fb0a50
Add support for configuring file systems using env variables (#498)
* Add support for configuring file systems using env variables

* Add UI for copying file systems env configuration
2021-08-18 14:41:57 +02:00
nathanbegbie 1afcd7030e
fix typo in Intro To Livebook (#499) 2021-08-18 14:36:09 +02:00
Jonatan Kłosko 8802fd50f3
Sign S3 requests using aws_signature (#497)
* Sign S3 requests using aws_signature

* escape_key -> encode_key

* Update lib/livebook/file_system/s3.ex

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

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-08-17 21:43:58 +02:00
Wojtek Mach 8776ccdf31
Fix warning on Elixir master (#496) 2021-08-16 21:42:51 +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 3216727858
Keep original source when highlighting (#480) 2021-07-28 19:35:36 +02:00
Jonatan Kłosko e8eee5c495
Update Kino references to the latest version (#479) 2021-07-28 15:52:33 +02:00
Jonatan Kłosko 917e59c57d
Optimise string building with iodata (#478) 2021-07-28 14:27:11 +02:00
Jonatan Kłosko cfbba9e2ce
Add Elixir source export (#476) 2021-07-28 13:40:36 +02:00