Commit graph

630 commits

Author SHA1 Message Date
ByeongUk Choi 5606326203
Handle token auth under the same /authenticate route as password (#1104)
* auth token mode routes /authentication

* Update lib/livebook_web/controllers/auth_controller.ex

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-04-13 18:51:28 +02:00
Jonatan Kłosko aafdc12015
Mount Markdown cell editor lazily (#1102) 2022-04-13 12:45:29 +02:00
Jonatan Kłosko 25f09331cc
Update dependencies (#1099)
* Update Elixir deps

* Update JS deps
2022-04-11 21:01:45 +02:00
Howard Su 31b0a9f7d0
Add windows version of ci (#1045)
* Add windows version of ci

Config autocrlf to input on Windows
start epmd in background

* Update .github/workflows/test.yaml

* Update .github/workflows/test.yaml

* Update .github/workflows/test.yaml

* Fix tests

* Fix ownership of cached files

* Fix tests

* Increase timeouts

* Run tests on Windows only on main

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-04-11 20:34:31 +02:00
ByeongUk Choi a2802248ab
Refactoring codes (#1097)
* refactoring codes

* Apply suggestions from code review

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-04-09 15:53:17 +02:00
Jonatan Kłosko 8b17365bf9
Don't show output init timeout message on serialization error (#1096) 2022-04-09 15:48:44 +02:00
Jonatan Kłosko 8b153b9bb0 Fix insert buttons overlapping cell actions 2022-04-05 21:53:30 +02:00
Jonatan Kłosko 0f8ce54187 Fix border on error output 2022-04-05 15:15:13 +02:00
Jonatan Kłosko 05687716d4
Improve smart cell menu visibility while in insert mode (#1091) 2022-04-04 22:28:02 +02:00
Jonatan Kłosko 5117fd6e64
List database types when adding database connection for the first time (#1090)
* List database types when adding database connection for the first time

* Rename classes
2022-04-04 19:48:57 +02:00
Jonatan Kłosko 1cdc9f7f70
Remove restart button on Mix.install/2 error (#1088)
* Remove restart button on Mix.install failure

* Remove unused standalone? check
2022-04-04 12:49:17 +02:00
ByeongUk Choi e3d9c5fa35
allow embedded runtime by env (#1084)
* allow embedded runtime by env

* fix session live test

* This reverts commit f36931d6ef9b..81ca7d

* allow runtime modules

* Apply suggestions from code review
2022-04-04 12:20:36 +02:00
Jonatan Kłosko 902c993098
Adjustments (#1087)
* Fix horizontal scrollbar on smaller screens

* Apply navigation shortcuts without an additional roundtrip

* Shorten the data element selector

* Fix URL in changelog

* Return reference from handle_intellisense
2022-04-04 12:19:11 +02:00
Brooklin Myers 00c913adcc
Enable image upload field when no name provided. Use image name as default value. (#1083) 2022-04-02 01:19:17 +02:00
Jonatan Kłosko 75eb031719
Automate searching and adding new dependencies (#1081)
* Automate searching and adding new dependencies

* Restructure runtime management

* Leave search restrictions up to the runtime

* Support predefined dependencies in Embedded runtime dependency search

* Use the embedded runtime for dependency search test

* Fix typo

* Use module for loading embedded runtime dependencies

* Improve naming
2022-04-01 20:13:37 +02:00
Jonatan Kłosko df765f2dd3
List predefined smart cells and automatically add their dependencies (#1078)
* List predefined smart cells and automatically add their dependencies

* Generalize dependency insertion to multiple entries

* Add runtime setup modal

* Don't evaluate setup when restarting the runtime fails

* Automatically add vega_lite for chart builder

* Improve confirmation modal actions when the action is not destructive
2022-03-30 21:55:50 +02:00
Wojtek Mach 108b40651d More macOS menu bar improvements 2022-03-30 13:57:55 +02:00
Wojtek Mach c5152eb941
Fix warnings (#1077) 2022-03-30 13:33:49 +02:00
Jonatan Kłosko 241ee94cba
Update built-in notebooks to use the setup cell (#1076)
* Teach about the setup cell in the elixir_and_livebook notebook

* Update built-in notebooks to use the setup cell
2022-03-28 22:18:46 +02:00
Jonatan Kłosko 5476fd001d
Introduce a setup cell (#1075)
* Introduce a setup cell

* Don't collapse setup cell when dirty

* Collapse fresh setup cell when empty

* Reword collapsed setup cell text
2022-03-28 21:36:57 +02:00
Jonatan Kłosko 6f6b7e3ee0
Fix browser open when inside WSL (#1074) 2022-03-24 22:10:13 +01:00
Jonatan Kłosko 4369a45bd5
Regroup cell insert buttons (#1073)
* Regroup cell insert buttons

* Add spacing to divider

* Split into two menus

* Remove smart cell icon
2022-03-24 19:02:31 +01:00
Jonatan Kłosko 894ff15419
Use the same local file system instance for all files (#1070)
* Use the same local file system instance for all files

* Add test
2022-03-24 14:09:17 +01:00
ByeongUk Choi 1fab2f54bf
Add LIVEBOOK_FORCE_SSL_HOST env (#1064)
Closes #983.
2022-03-23 18:24:58 +01:00
Jonatan Kłosko 7f39c6be76
Remove non-ascii characters from autogenerated notebook file names (#1068) 2022-03-22 21:54:59 +01:00
Jonatan Kłosko ac5a71bf85
Show a message when JS view data is not available (#1067)
* Multiplex initialization of JS views

* Show timeout message when JS view data fails to load

* Refactor JS view channel

* Update tests
2022-03-22 18:25:42 +01:00
Jonatan Kłosko 01b9ffe731
Keep binding in reversed evaluation order (#1065)
* Keep binding in reversed evaluation order

* Treat rebound names as new

* Add test for the default order

* Optimise binding reorder

* Update lib/livebook/runtime/evaluator.ex

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

* Apply review comments

Co-authored-by: José Valim <jose.valim@dashbit.co>
2022-03-21 19:23:43 +01:00
Jonatan Kłosko 0145d68593
Limit standard output to last 1000 lines (#1063) 2022-03-19 12:22:36 +01:00
Jonatan Kłosko becdda61f7
Support optional reevaluation on smart cell update (#1062) 2022-03-18 19:36:48 +01:00
Jonatan Kłosko 829493822e
Group LV helpers (#1061) 2022-03-17 23:33:18 +01:00
Jonatan Kłosko d72cb5db03
Mark sections as branching in VegaLite introductory notebook (#1059) 2022-03-17 23:33:10 +01:00
Jonatan Kłosko afce2e6047
Prevent smart cell menu from overlapping with insert buttons (#1060) 2022-03-17 21:44:40 +01:00
Wojtek Mach cb7f51726a
Fix macOS menu bar (#1057) 2022-03-17 20:32:59 +01:00
Jonatan Kłosko b3b79afed4
Refactor JS hooks (#1055)
* Restructure hook files

* Simplify app.js

* Refactor hooks

* Implement password toggle with JS commands
2022-03-16 11:33:53 +01:00
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 8bb8160605 Skip padding when encoding the confirmation modal id 2022-03-03 02:13:47 +01:00
Cristine Guadelupe 88747c1790
Typo: report smart cell definitions function name (#1038) 2022-03-02 16:40:16 -03: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
Wojtek Mach 29f0f54bbd
Desktop app packaging for Windows (#1032) 2022-03-02 12:06:30 +01:00
Wojtek Mach 59e4713008 Expand path before opening it (another attempt)
See: 864624ad2c
2022-03-02 11:53:02 +01:00
Wojtek Mach 864624ad2c Expand path before opening it
Say we have this path on Windows: `C:/Users/wojtek/foo.livemd`. Opening
it: (ignore it's not escaped)

    http://localhost:4000/open?path=C:/Users/wojtek/foo.livemd

would have failed with:

    ** (ArgumentError) expected an expanded absolute path, got: "C:/Users/wojtek/foo.livemd"

and that's because absolute paths (in other words, Path expanded) start
with `c:/`, not `C:/`.
2022-03-02 11:37:07 +01:00
Jonatan Kłosko 1dc7c43b70
Simplify user modals (#1034)
* Simplify user modals

* Naming
2022-03-02 00:43:06 +01:00
Jonatan Kłosko d191b7eb9d
Set up confirmation modals (#1033)
* Set up confirmation modals

* Add temporary fix for the global hook remount
2022-03-02 00:26:40 +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 3622d0ee4b
Provide better stacktraces on recent Elixir+OTP versions (#1028) 2022-02-24 19:19:22 +01:00
Jonatan Kłosko f5c99737dd
Simplify the forwarding IO device (#1024) 2022-02-23 20:47:24 +01:00
Jonatan Kłosko 4f61639fba Use System.os_time/0 for ordering file systems 2022-02-22 23:09:54 +01:00
Jakub Perżyło 4fcdeb6bcf
Changed filesystems config manipulation to use ids (#1017)
* Changed filesystems mainpulation to use ids

* Adjusted to review

* Added filesystem ordering

* Apply suggestions from code review

* Format

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-02-22 22:42:54 +01:00
Jonatan Kłosko ca0128d028
Remove leftovers in case assets extraction fails (#1020) 2022-02-22 01:01:04 +01:00
Jonatan Kłosko 0386a032a1
Reinitialize hooks on reconnection (#1018)
* Reinitialize cells on reconnection

* Send initial session data without additional roundtrip
2022-02-21 20:39:29 +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 7050180242 Resolve paths instead of raising 2022-02-21 08:08:24 +01:00
Jonatan Kłosko 797befe28f Fix undesired scrollbar on the homepage 2022-02-19 01:30:08 +01:00
Kevin 4fac98e069
Fix double slashes in URL for new (#1013)
* Fix double slashes in URL for `new`

* Fix formatting

* Rename to append_path/2 to set_path/2
2022-02-18 20:57:03 +01:00
Jonatan Kłosko fb9c4fbef8
Don't open browser after starting the server unless explicitly asked (#1011) 2022-02-18 17:27:36 +01:00
Cristine Guadelupe d775908a48
Adds role button to cell link button (#1010) 2022-02-17 23:39:38 -03:00
Cristine Guadelupe b32b363ed1
Improves cell accessibility (#1009)
* Reads the output after a cell has been evaluated

* Creates SR landmarks when errors happen

* fixes formatting

* Reads a clearer message when a runtime restart is required

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

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

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-02-17 19:37:14 -03:00
Cristine Guadelupe 72da7da3b5
Live region for home page (#1007)
* Live region on home

* Live region: bulk actions

* Live region: ordered by info

* Makes the live region helper global
2022-02-16 15:50:32 -03: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
José Valim a5a1a54f19
Log and use more clearer name for table (#1005) 2022-02-15 20:29:58 +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
José Valim 2c271e2efb
Create home and data_path directories if missing (#1003)
* Create home and data_path directories if missing

* Update lib/livebook/config.ex

* Configure project-local data path for dev and test env

* Expand dev/test paths in compile config

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-02-14 22:19:06 +01:00
Cristine Guadelupe 2f9dd73a7b
New bin modal (#997)
* New empty bin modal

* New bin modal

* Smaller buttons

* Conditional rendering improvements
2022-02-11 09:49:00 -03: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
Wojtek Mach 1d03f59d2e
Switch importing to opening files in the desktop app (#995) 2022-02-10 11:54:42 +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
Adam Lancaster c972b195c5
Increase timeout for connecting via Mix standalone (#846)
* Increase timeout for connecting via Mix standalone

I have hit this timeout when connecting via mix to a fairly large
application. Increasing this fixes it for my use case.

* Update lib/livebook/runtime/standalone_init.ex

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-02-08 15:22:38 +01:00
Jonatan Kłosko e5e13d86c2
Serve iframes from another local port when running on http (#989)
* Serve iframes from another local port when running on http

* Use relative hostname in local iframe URL

* Simplify server start check

* Use random iframe port when Livebook runs on a random port

* Rename space/ to iframe/

* LivebookWeb.IframePlug -> LivebookWeb.IframeEndpoint
2022-02-08 14:45:58 +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
Sam 494ab40ac8
add function to open notebook urls (#986)
* add function to open notebook urls

* Update lib/livebook/utils.ex

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

* Update lib/livebook/utils.ex

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

* open notebook with notebook_open_url/2

* Update server.ex

* format Livebook.Utils

* Update lib/livebook_cli/server.ex

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

* correct function doc

Co-authored-by: José Valim <jose.valim@gmail.com>
2022-02-07 13:39:23 +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
José Valim 270573d2e6
Use lowercase header name 2022-02-04 21:44:56 +01:00
Cristine Guadelupe 904a21a761
Accessibility improvements - home page (#979)
* Accessibility improvements on home page

* Unique ids for file info path buttons

* Improves navigation for screen readers in the session list

* Landmarks navigation for screen readers

* Headings navigation for screen readers

* Group navigation - running sessions list

* Fix typo

* Minor adjustments based on review suggestions
2022-02-04 13:05:38 -03: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
José Valim 37cb549d02 Use guards for checking live action 2022-02-04 00:01:45 +01:00
Jonatan Kłosko 4681f98972
Expand directory path when opened via CLI (#976) 2022-02-03 23:43:47 +01:00
José Valim 995082b9ab
Add data-keep-attribute to reapply attribute on morphdom patch (#978) 2022-02-03 23:25:12 +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 fc8799ef8f
Group public routes under a common prefix (#974) 2022-02-03 17:48:16 +01:00
Milo Lee 20bcac1184
Make textarea resizable (#970) 2022-02-02 14:12:50 +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 aaa4f406bf Do not assume autosave path exists 2022-01-31 12:00:14 +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 849acd87a9
Reorder usage arguments 2022-01-30 18:58:09 +01:00
gpopides 0cae21e9e8
Remove --open-new option when starting server (#960) 2022-01-30 18:36:30 +01:00
Jonatan Kłosko 51db7b482b
Adjust stop reasons for server processes (#958)
* Adjust stop reasons for server processes

* Update lib/livebook/unique_task.ex

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

Co-authored-by: José Valim <jose.valim@dashbit.co>
2022-01-30 13:30:33 +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
Paul Geraghty b81c7f55ec
Fix typos (#955) 2022-01-30 09:44:27 +01:00
Chris Kellendonk 6bae9f3d93
Small fixes to the explore docs (#953)
* Fix Intro to Kino link in chat_app.livemd

* Install Kino before usage in distributed portals exploration
2022-01-29 19:23:18 +01:00
Chris Kellendonk b1b573b5f4
Fix elixir_and_livebook.livemd branch parent (#951) 2022-01-29 17:32:55 +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
José Valim 372f086044 Move from Helpers to Utils and add doctests 2022-01-29 10:39:26 +01:00