Commit graph

711 commits

Author SHA1 Message Date
Jonatan Kłosko 433cd43894
Secret improvements (#2051)
Co-authored-by: José Valim <jose.valim@dashbit.co>
2023-07-10 21:29:21 +02:00
Jonatan Kłosko d3f7cfa665
Pass notebook files when deploying apps (#2045) 2023-07-07 20:31:54 +02:00
Alexandre de Souza f4365e44d2
Enforce Hub when deploying notebooks from LIVEBOOK_APPS_PATH (#2039) 2023-07-07 15:27:07 -03:00
Jonatan Kłosko c02eb984f8
Support reading file entry content from the runtime (#2044) 2023-07-07 16:20:19 +02:00
Jonatan Kłosko 62a74eb660 Fix livemd import test on Windows 2023-07-05 20:44:59 +02:00
Jonatan Kłosko 8f276d2f1e Use more strict assertion 2023-07-05 20:33:46 +02:00
Jonatan Kłosko be32b94475 Improve tests 2023-07-05 20:26:39 +02:00
Jonatan Kłosko ede80fc074
Implement file management (#2022)
Co-authored-by: José Valim <jose.valim@dashbit.co>
2023-07-05 20:01:12 +02:00
Jonatan Kłosko cae17cc144
Add support for reading app info from the runtime (#2038) 2023-07-05 15:58:46 +02:00
Jonatan Kłosko fb9148acf7
Change new notebook button to link (#2036) 2023-07-04 14:46:19 +02:00
Jonatan Kłosko 477036f64d
Properly close app sessions (#2034) 2023-07-04 00:53:04 +02:00
Alexandre de Souza bcfb6d46ea
Add Team hub from environment variables (#2020) 2023-06-30 19:11:31 -03:00
Jonatan Kłosko 9541eb91c8
Fix smart cell editor initialization (#2017) 2023-06-28 22:39:24 +02:00
ByeongUk Choi ebab482b7e
Improve error message when deploying notebooks without settings (#2008) 2023-06-25 09:44:36 +02:00
Alexandre de Souza 05d691d407
Redirect to Hub page to update or delete a secret (#2005) 2023-06-23 17:54:13 -03:00
Alexandre de Souza 0a190729ec
Allow Livebook to update and delete Team hub secrets (#1995) 2023-06-21 15:37:28 -03:00
Jonatan Kłosko 1443c472ce
Don't emit diagnostic for module compilation error (#2000) 2023-06-21 11:11:01 +02:00
Cristine Guadelupe efb28fbdf0
Support Zero Trust authentication (#1938)
Co-authored-by: José Valim <jose.valim@gmail.com>
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2023-06-21 00:25:25 +02:00
Jonatan Kłosko 9c831d3e7f
Update dependencies (#1994) 2023-06-20 17:33:38 +02:00
Wojtek Mach 74caae1da1
Merge pull request from GHSA-564w-97r7-c6p9 2023-06-20 13:13:38 +02:00
Jonatan Kłosko 20e13e01db
Bump to Elixir 1.15 (#1989) 2023-06-19 18:21:55 +02:00
Alexandre de Souza 7f9ba6989f
Allow secret creation from Livebook for Team Hubs (#1978) 2023-06-15 17:33:22 -03:00
Jonatan Kłosko d5f9aaf14e
Don't run doctests for generated functions (#1966) 2023-06-13 16:01:45 +02:00
awerment b4e4c64820
Show more details in type completion items (#1975) 2023-06-12 22:45:47 +02:00
awerment 7691324a4e
Add on-hover details for types (#1974) 2023-06-12 14:17:25 +02:00
Jonatan Kłosko a72629cfe3
Implement stamping for teams hub (#1973)
Co-authored-by: José Valim <jose.valim@dashbit.co>
2023-06-09 20:59:04 +02:00
Jonatan Kłosko ad7c1549e8 Adjust hub integration tests 2023-06-09 18:15:50 +02:00
Jonatan Kłosko 80423adcdf Remove unreliable test 2023-06-09 15:51:01 +02:00
Jonatan Kłosko c383c7aaff
Ignore code server error logs when checking for modules (#1971) 2023-06-09 01:04:51 +02:00
Jonatan Kłosko 683f6c8f3b
Use different html name for output inputs (#1970) 2023-06-08 23:27:13 +02:00
Jonatan Kłosko 9059049d29
Add hub id to hubs pubsub messages (#1968) 2023-06-08 17:32:29 +02:00
Jannik Becher dbceb99f79
Fix on-hover docs for erlang modules with type names in signature (#1957)
Co-authored-by: José Valim <jose.valim@gmail.com>
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2023-06-07 12:30:52 +02:00
Benedikt Reinartz 377b677a6e
Erlang error improvements (#1960) 2023-06-06 13:52:50 +02:00
Jonatan Kłosko 75614e7885
Show notifications for new app version and import warnings (#1955) 2023-06-02 21:32:44 +02:00
Benedikt Reinartz fb9193b8ab
Add support for Erlang code cells (#1892)
Co-authored-by: José Valim <jose.valim@gmail.com>
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2023-06-02 14:49:06 +02:00
Alexandre de Souza 14dd6d925f
Implement TeamClient with Teams WebSocket communication (#1951) 2023-06-01 12:01:43 -03:00
Jonatan Kłosko 2399395bfd Improve tests 2023-06-01 13:49:09 +02:00
Jonatan Kłosko 8f71ad700b
Use registry to identify IO proxy in log handler (#1952) 2023-06-01 00:32:47 +02:00
Jonatan Kłosko 04efa5932f
Restore code markers and doctest indicators on refresh (#1949) 2023-05-31 15:52:08 +02:00
Jonatan Kłosko 0b73752803 Await file deletion without sleeping in tests 2023-05-30 23:17:33 +02:00
Jonatan Kłosko 4145121ba9 Fix more race conditions in tests 2023-05-30 22:42:59 +02:00
Jonatan Kłosko cf3d0ee16e Improve uncertain test 2023-05-30 22:20:49 +02:00
Jonatan Kłosko 3c56b87154
Doctest updates (#1944) 2023-05-30 22:03:20 +02:00
José Valim 2d265541f0 Skip multiple assertions tests until latest Elixir 2023-05-30 20:29:44 +02:00
José Valim 294bf69c8d Handle doctests reports when there are multiple assertions at once 2023-05-30 19:34:04 +02:00
José Valim 3e1067f4b5 Use range 41xx for teams ports 2023-05-30 12:21:06 +02:00
Jonatan Kłosko d2988f985d
Changes for Elixir 1.15 (#1918) 2023-05-30 12:06:59 +02:00
José Valim 265a1dec6e
Overlay doctest results (#1936) 2023-05-30 11:30:57 +02:00
Jonatan Kłosko 6b139c95ce Refactor tests 2023-05-29 17:13:28 +02:00
Alexandre de Souza 76015e3009
Improve Add Hub and Edit Hub pages (#1929) 2023-05-26 15:40:45 -03:00
Jonatan Kłosko 34ffb8f3d5
Automatically reevaluate app sessions and support interrupt (#1928) 2023-05-26 13:12:41 +02:00
José Valim 705f122b75 Pass device code to teams server 2023-05-25 17:17:57 +02:00
José Valim 30a87e8803 Fix tests 2023-05-25 17:01:51 +02:00
José Valim 74b4d7124b Use 5053 by default for Livebook 2023-05-24 10:54:40 +02:00
Alexandre de Souza 070c0599b5
Implement users to join an organization (#1912) 2023-05-23 17:18:10 -03:00
Jonatan Kłosko 8e4f3067da
Fix intellisense crash when hovering over bitstring modifiers (#1917) 2023-05-23 00:21:44 +02:00
Jonatan Kłosko d1ba07e0ea
Move app settings to a modal and add explanations (#1914)
Co-authored-by: José Valim <jose.valim@dashbit.co>
2023-05-21 21:21:10 +02:00
Jonatan Kłosko 52df405aca
Add support for multi-instance apps (#1913) 2023-05-19 19:40:56 +02:00
Jonatan Kłosko 4760c5d7e5 Add signature test 2023-05-19 01:23:09 +02:00
Alexandre de Souza 3a63e30e89
Implement new Add Hub page (#1909) 2023-05-18 13:45:32 -03:00
Alexandre de Souza 932e43ac65
Implement Livebook Teams API (#1904) 2023-05-16 13:21:49 -03:00
Jonatan Kłosko 022f395bce
Add output type setting to apps (#1905) 2023-05-11 14:07:19 +02:00
Jonatan Kłosko f262b9c0c9
Rebuild confirmation modal system (#1903) 2023-05-10 18:23:08 +02:00
ByeongUk Choi 6dd19a8dc9
Add Form to "+ Block" (#1750)
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2023-05-09 16:49:02 +02:00
ByeongUk Choi 6061901ee9
Add info about empty Kino outputs (#1899) 2023-05-08 11:26:21 +02:00
Jonatan Kłosko 9d6b247115
Hydrate updated smart cell source digest before reevaluation (#1886) 2023-04-27 18:27:43 +02:00
Jonatan Kłosko a6a56ff30c
Use shorter name for doctests module (#1874)
Co-authored-by: José Valim <jose.valim@dashbit.co>
2023-04-27 16:34:20 +02:00
Jonatan Kłosko 4933807a58 Improve star button styling 2023-04-18 12:56:32 +02:00
José Valim a8c7af5519
Move star below menu (#1870) 2023-04-18 12:46:54 +02:00
Jonatan Kłosko f9efd2079c
Persist show-source app option (#1859) 2023-04-13 17:02:03 +02:00
Jonatan Kłosko 4d46b03cc8
Fix smart cell indicator when source changes on start (#1851) 2023-04-08 10:49:34 +02:00
José Valim 58a3d1fa20 Add missing test file 2023-03-30 17:09:46 +02:00
José Valim f52ff1e9ec
Purge cookies once they exceed 24kB, closes #1832 (#1833) 2023-03-28 17:11:44 +02:00
José Valim 6d91320441 mix format 2023-03-25 22:12:25 +01:00
José Valim 6ef803f95b Fix 404 rendering, closes #1826 2023-03-25 21:52:18 +01:00
José Valim 4f92ef8d02 Remove unused test file 2023-03-25 21:49:47 +01:00
Jonatan Kłosko 32987558be
Add support for clients-only outputs (#1810) 2023-03-21 20:32:22 +01:00
Jonatan Kłosko eba8bcac59
Simplify communication with evaluation group leader (#1816) 2023-03-21 20:31:55 +01:00
Jonatan Kłosko 753de9f65b Add data tests for :set_secret and :unset_secret 2023-03-21 18:15:54 +01:00
Jonatan Kłosko de310c0c36
Support gzip compression of JS view assets (#1813) 2023-03-21 17:45:27 +01:00
Jonatan Kłosko 7de7911d32 Fix tests on windows 2023-03-15 18:37:04 +01:00
Jonatan Kłosko fb9c8df7ea Fix tests on windows 2023-03-15 18:18:33 +01:00
Jonatan Kłosko 2ec24732bd
Automatically evaluate changed parent cells (#1786) 2023-03-14 23:48:07 +01:00
José Valim 764d775ed3 Initial revamp of notebooks
Deployment and introduction to Kino
still need to be rewritten.
2023-03-14 15:29:09 +01:00
Jonatan Kłosko 07fab99353
Don't garbage collect input values when converting smart cell to code (#1781) 2023-03-13 18:31:31 +01:00
Jonatan Kłosko 6e4c81edae
Fix attribute replacement in storage (#1778) 2023-03-13 16:27:25 +01:00
Jonatan Kłosko 42bc98a42d
Remove storage abstraction (#1777) 2023-03-13 14:44:33 +01:00
Jonatan Kłosko deacb1a4a4
Explicitly track which secrets come from the hub (#1769) 2023-03-11 12:51:06 +01:00
Jonatan Kłosko 7f71f2fe9f
Add stamp to notebook source and persist allowed hub secrets (#1768) 2023-03-10 22:36:51 +01:00
Alexandre de Souza 753f6fffaa
Update to Livebook Teams (#1765) 2023-03-09 17:04:29 -03:00
José Valim 5c106e81fa
Small changes (#1764) 2023-03-09 17:41:40 +01:00
Alexandre de Souza 3b41e87876
Add hub secrets list to Personal Hub page (#1763) 2023-03-09 12:04:47 -03:00
Jonatan Kłosko b5730b17aa Increase assertion timeout on windows 2023-03-08 14:05:41 +01:00
Alexandre de Souza 8754bc0d5a
Shows only the secrets from selected hub (#1747) 2023-03-07 15:24:07 -03:00
Jonatan Kłosko 5fd17ca958 Fix tests on Windows 2023-03-06 21:37:27 +01:00
Jonatan Kłosko b9237dd7f0
Add new notebook action to the file select (#1754) 2023-03-06 21:24:48 +01:00
Jonatan Kłosko 429a89b1aa
Handle assertion errors in doctests (#1752) 2023-03-06 19:36:54 +01:00
Jonatan Kłosko 503f8df76a
Add star/unstar to the session page menu (#1753) 2023-03-06 19:36:45 +01:00
ByeongUk Choi 4db39078bd
Add open page and track starred/recent notebooks (#1639)
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2023-03-06 18:14:33 +01:00
Alexandre de Souza e73af96b86
Allow users to select the notebook's hub (#1744) 2023-03-02 18:10:38 -03:00
Jonatan Kłosko dd5e1af23b
Persist app settings and support deployment from directory (#1741)
Co-authored-by: José Valim <jose.valim@dashbit.co>
2023-02-28 21:37:43 +01:00
Jonatan Kłosko a90e9193f4 Update app tests 2023-02-28 17:28:10 +01:00
Jonatan Kłosko 1676d5469e
Add page listing apps (#1733) 2023-02-28 15:08:49 +01:00
Alexandre de Souza 5d48ffd051
Remove entire app secrets implementation (#1734) 2023-02-28 10:55:52 -03:00
Alexandre de Souza bfcf82f06b
Implements Secrets features inside hub's Provider (#1712) 2023-02-27 13:45:14 -03:00
Jonatan Kłosko be033b9074
Refactor secrets form (#1721) 2023-02-23 10:40:32 +01:00
Jonatan Kłosko 5b5593a54b
Update to Phoenix 1.7 (#1720) 2023-02-22 19:34:54 +01:00
Kevin 0d058152cd
Fix erlang module docs in Intellisense (#1719) 2023-02-21 15:51:15 +01:00
Jonatan Kłosko 4334e8a58e
Add access control to apps (#1715)
Co-authored-by: José Valim <jose.valim@dashbit.co>
2023-02-18 01:16:42 +01:00
Jonatan Kłosko 40c5044a60
Add initial support for apps (#1709) 2023-02-16 13:47:46 +01:00
Alexandre de Souza 5c1d6f082f
Update Local hub to Personal hub and makes it editable (#1708) 2023-02-13 17:18:06 -03:00
Alexandre de Souza d0e83dc288
Implements delete hub button (#1705) 2023-02-13 01:52:25 -03:00
Alexandre de Souza e58213b000
More improvements for Secrets and Hubs (#1693) 2023-02-06 20:37:11 -03:00
Jonatan Kłosko c8dd1151f0
Fix assets fetching for client-specific outputs (#1692) 2023-02-06 15:50:48 +01:00
José Valim bf1dceacba Fix typo 2023-02-04 21:49:03 +01:00
Jonatan Kłosko 597d9fff3f
Cancel scheduled evaluation on error (#1688) 2023-02-03 21:04:13 +01:00
Jonatan Kłosko e622ef4f96
Fix dialyzer warnings (#1691) 2023-02-03 18:30:41 +01:00
Alexandre de Souza 5f6e7176fc
Allow hub secret toggling (#1675) 2023-02-03 13:15:46 -03:00
Zach Allaun 8f92661918
Support setting node and distribution using environment vars (#1672) 2023-02-01 21:22:49 +01:00
Jonatan Kłosko 25b4043dc7 Bump assertion timeout 2023-02-01 20:27:54 +01:00
Jonatan Kłosko 50c23d0e4c
Tag file input id (#1674) 2023-02-01 19:59:26 +01:00
Jonatan Kłosko 69df6e0ad4
Rework file input to consider multiple clients (#1673) 2023-02-01 18:49:12 +01:00
Alexandre de Souza 887d423007
Improve hubs provider API (#1670) 2023-02-01 13:33:41 -03:00
Alexandre de Souza dd2b7fa0e6
Minor improvements (#1669) 2023-01-31 20:37:04 -03:00
Alexandre de Souza d70764517f
Implements :origin field to Secret struct (#1667) 2023-01-31 19:17:05 -03:00
Jonatan Kłosko 86bf972c0d
Add support for sending frame updates to a specific client (#1662) 2023-01-28 00:34:31 +01:00
Wojtek Mach 0df2fe4fd1
Hub fixes (#1657) 2023-01-25 20:40:14 +01:00
Alexandre de Souza ae3a5661a8
Implement emojis instead of colors (#1636) 2023-01-12 17:37:12 -03:00
Jonatan Kłosko 57e1df74f3
Allow specifying S3 region explicitly (#1638) 2023-01-12 13:32:08 +01:00
Alexandre de Souza 3b2ea3c8ce
Update Connection life-cycle and implement ChangesetError message (#1633) 2023-01-10 17:12:35 -03:00
Jonatan Kłosko d6f758661b
Make automatic reevaluation more accessible (#1628) 2023-01-07 15:18:31 +01:00
Alexandre de Souza b82e360df9
Implement Enterprise secret creation from Session (#1612) 2023-01-06 16:14:44 -03:00
Jonatan Kłosko 089cee395f Fix test on windows 2023-01-05 16:48:27 +01:00
Jonatan Kłosko b60428c94d
Improve tests (#1627) 2023-01-05 16:12:45 +01:00
Jonatan Kłosko 35b8bb73df Trigger input garbage collection after cell deletion 2023-01-05 12:34:32 +01:00
Jonatan Kłosko f1deaead34 Update inputs garbage collection test 2023-01-04 21:54:39 +01:00
Jonatan Kłosko 17ab1ae472
Add support for file input (#1622) 2023-01-04 21:44:04 +01:00
Alexandre de Souza d4bda6042c
Load LB_ env vars as app secrets (#1615) 2023-01-04 11:10:33 -03:00
Jonatan Kłosko 2e230c9deb
Add an option to run setup with no cache (#1616) 2023-01-03 12:24:22 +01:00
Alexandre de Souza 9ff84f204f
Implement event handling from WebSocket (#1608) 2022-12-26 21:16:47 -03:00
Alexandre de Souza f9fb5194fa
Implement EnterpriseClient and improvements to WebSocket Connection (#1601) 2022-12-23 12:56:00 -03:00
Jonatan Kłosko 82d748a1ff
Don't track :rand and :random keys in process dictionary (#1599) 2022-12-22 11:38:43 +01:00
Alexandre de Souza 3e11023925
Migrate WebSocket GenServer (Server) to Connection (#1585) 2022-12-21 11:28:27 -03:00
Jonatan Kłosko ae7fbca0ba
Cleanup modules when evaluator terminates (#1582) 2022-12-13 20:19:29 +01:00
José Valim 190a4cffd3
Do not crash when giving token to password and vice-versa (#1574) 2022-12-12 11:52:45 +01:00
Jonatan Kłosko 52d6835388
Support config updates when adding smart cell deps to Mix.install/2 (#1560) 2022-12-03 16:23:43 +01:00
Alexandre de Souza 60bc7194ed
Improve Enterprise integration with real data (#1548) 2022-11-28 20:47:25 -03:00
José Valim b335e1c9cb
More doctests (#1544) 2022-11-23 15:06:08 +01:00
Jonatan Kłosko c0fa414593 Fix default chunks info 2022-11-17 20:46:17 +01:00
Jonatan Kłosko 16d473685a
Fix input value lookup for nested inputs (#1537) 2022-11-17 15:15:54 +01:00
Jonatan Kłosko ce93015a0d
Add support for multi-chunk smart cell source (#1536) 2022-11-17 12:36:06 +01:00
Jonatan Kłosko 42d2386a2d
Fix reading inputs rendered in the same evaluation (#1531) 2022-11-15 15:13:05 +01:00
Jonatan Kłosko 9c9c54de65
Delete defined modules if evaluation fails (#1528) 2022-11-12 19:39:59 +01:00
Jonatan Kłosko 81fccfd436
Automatically run doctests when a module is defined (#1525) 2022-11-11 21:49:51 +01:00
Alexandre de Souza e30213bc83
Update WebSocket error responses (#1524) 2022-11-11 12:00:47 -03:00
Jonatan Kłosko 31c119a633
Persist modules bytecode to disk (#1521) 2022-11-10 16:37:57 +01:00
Jonatan Kłosko 936146e52c
Improve reproducability of module definitions (#1518) 2022-11-09 18:22:27 +01:00
Jonatan Kłosko 484e47142a
Track evaluation dependencies and cache results (#1517) 2022-11-09 14:40:44 +01:00
Alexandre de Souza 7b1addb7eb
Use WebSocket and Protobuf instead of GraphQL with Livebook Enterprise (#1504) 2022-11-03 13:49:07 -03:00
Alexandre de Souza 19773a0e36
Add Enterprise Hub (#1449) 2022-10-11 11:27:27 -03:00
José Valim 5c053a9573
Always sync livebook secrets with session (#1477) 2022-10-11 16:12:14 +02:00
José Valim 950982304d
Final touchups to secrets (#1464)
* Use font-mono on secret names
* Unify error handling with changesets
* Unify put_env/delete_env as set_env/unset_env
* Review text and descriptions
2022-10-06 21:44:04 +02:00
José Valim cf7ad7f17a
Provide shared facade in Storage module (#1463) 2022-10-06 19:53:37 +02:00
Cristine Guadelupe 4c83317453
Notebook secrets (#1457)
* Store secrets in the notebook

* Automatically grants access to secrets

* Put notebook secrets on session

* Shows secrets as a list

* Grant access message box

* Grant access confirmation on select

* Applying suggestions - grant access confirmation

* Handles unavailable secrets

* Toggle secrets

* Session only secrets

* Sync secrets

* Fix delete runtime secret

* Clean up

* Component helpers

* Does not store secrets in notebooks

* Store Livebook secrets

* Fix sync secrets

* Tests for secrets

* Doesn't refetch livebook_secrets

* Removes unused function

* More test for secrets

* Livebook secrets as maps

* Fix secret tests

* Applying suggestions

* All secrets as a map

* Shows grant access for missing secret errors

* Unifies grant access

* Fix set_runtime_secrets

* Applying suggestions

* Updates sync secrets tests

* Fix active secret

* Unifies prefill secret name
2022-10-06 13:41:26 -03:00
José Valim e9149dc343
Require fewer clicks to save a notebook (#1458) 2022-10-04 10:56:11 +02:00
José Valim 6da00daffd
Update to LV 0.18 (#1426) 2022-10-04 08:46:55 +02:00
Jonatan Kłosko 964f4b04d1
Keep stacktrace if all of it is pruned (#1455) 2022-10-03 13:49:19 +02:00
Jonatan Kłosko 12f77daa68
Fix Markdown formatting of narrow table columns (#1430) 2022-09-22 21:10:51 +02:00
Jonatan Kłosko b20ac022a8
Attempt to load a flat remote URL as a relative path fallback (#1428) 2022-09-22 15:11:29 +02:00
Paulo Valim 285bc923b7
Rename the Explore section to Learn (#1424)
Co-authored-by: José Valim <jose.valim@gmail.com>
2022-09-21 12:06:22 +02:00
Jonatan Kłosko b5e8cd9b00 Fix PATH test on Windows 2022-09-19 21:05:08 +02:00
Cristine Guadelupe 52f7d7419b
Changes secrets wording form label to name (#1419) 2022-09-18 18:40:09 -03:00
Alexandre de Souza 2766cf3256
Final adjustments to env vars (#1418) 2022-09-16 20:37:01 -03:00
Alexandre de Souza 12f1cc0c3f
Load persisted environment variables from settings into session's runtime (#1409) 2022-09-16 14:22:27 -03:00
Alexandre de Souza e539661189
Unify styling environment variables forms (#1403) 2022-09-14 13:24:32 -03:00
Jonatan Kłosko 9434cf57b4
Normalize newlines in initial smart cell editor content (#1400) 2022-09-13 11:15:25 +02:00
Alexandre de Souza 0b9f53a122
Implement global Environment Variables from Settings page (#1387) 2022-09-12 11:34:39 -03:00
José Valim b6e28c5b43 Fix Fly Hub suite 2022-09-07 11:37:45 +02:00
José Valim be862173a3
Unify several forms in the application (#1392)
* Define .input_wrapper and .hex_color_input components

* Define Tailwind variants from Phoenix v1.6 to help styling

* Make sure single-action modals redirect on save

* Add pill to session secrets in the "Secrets" session sidebar

* Fix alignments of "Users" in the session sidebar
2022-09-05 23:59:13 +02:00
Jonatan Kłosko eeadb0811b
Wait for processes to be garbage collected before evaluation (#1385) 2022-09-02 23:45:58 +02:00
Cristine Guadelupe 97efef52cc
Fix secrets form (#1379)
* Fix secrets form

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

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

* Applying suggestions

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-09-02 15:04:41 -03:00
Alexandre de Souza ac71d08771
Add and Fetch secrets from Fly applications (#1361) 2022-09-02 12:54:28 -03:00
Jonatan Kłosko ab9ad0369c
Show a message when a smart cell crashes and allow restarts (#1381) 2022-09-02 15:50:13 +02:00
Cristine Guadelupe 443ff8bf9f
Unavailable secret error (#1371)
* Show an Add Secret button for System.EnvError

* Extracts render_formatted

* Rewrite the env error message

* Renames the env error type

* Applying suggestions

* Applying suggestions (live patch)

* Test for unavailable secrets

* Bump to rc.1

* Applying suggestions (error message)

* New error message

* Prefill the secret value

* Applying suggestions (error message output)

* Update test/livebook_web/live/session_live_test.exs

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

* Update lib/livebook/runtime.ex

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

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-08-31 20:45:55 -03:00
Alexandre de Souza 2cbd81eaf5
Migrate HubLive to Phoenix format (#1373) 2022-08-30 11:32:48 -03:00
José Valim 608979471d
Remove Mix standalone runtime, closes #1345 (#1370)
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-08-29 14:20:24 +02:00
ByeongUk Choi 648edf23e7
Add completion for bitstring modifiers (#1291)
Co-authored-by: José Valim <jose.valim@gmail.com>
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-08-29 13:14:13 +02:00
José Valim 895373e08b
Log the reason a runtime node goes down (#1368)
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-08-29 11:12:25 +02:00
José Valim ed9c0e5a1e Revamp explore section 2022-08-28 19:08:43 +02:00
Jonatan Kłosko 1e324b4f75
Add support for getting evaluation file during evaluation (#1362) 2022-08-28 09:28:19 +02:00
Cristine Guadelupe afcb2ff834
Livebook secrets (#1348)
* Add secrets to the sidebar

* Get and put secrets (naive)

* Secrets list - shortcut

* Validates secret name

* Livebook secrets as environment variables

* Restores secrets when necessary

* Minor adjustments

* Implements add_system_envs for NoopRuntime

* Moves secrets to session data

* Granular operations for secrets

* Minor adjustments

* Applying suggestions

* Test for add secrets

* Type for secret

* Applying suggestions

* Prevents duplicates

* Refactor to live_render

* Update lib/livebook/session/data.ex

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

* Sort secrets

* Applying suggestions

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-08-25 17:24:24 -03:00
Alexandre de Souza 3a085a5d30
Minor Hub improvements (#1357) 2022-08-24 12:35:28 -03:00
Jonatan Kłosko 2c28d1a0ca
List an exact match first in package search (#1355) 2022-08-24 10:59:26 +02:00
Alexandre de Souza 77c8804d62
User and Hub forms with Changeset validations and input errors (#1347) 2022-08-22 18:12:54 -03:00
Alexandre de Souza 5c050e640f
Add Livebook Hub with Fly.IO integration (#1319) 2022-08-18 10:34:27 -03:00
José Valim b9b2f7514e
Support more recent Elixir versions too (#1344) 2022-08-12 19:04:15 +02:00
Jonatan Kłosko 3d5c7c3fad
Require Elixir 1.14 (#1342) 2022-08-11 20:13:57 +02:00
Jonatan Kłosko d0338be513 Improve assertion of the session creation timestamp 2022-08-11 13:42:33 +02:00
Jonatan Kłosko d24cb8a838
Queue cells on ctrl+shift+enter even when a cells is evaluating (#1334) 2022-08-05 22:19:50 +02:00
Jonatan Kłosko 218bce5a63
Use binary ids for session clients (#1333) 2022-08-05 14:43:41 +02:00
Jonatan Kłosko c68df08849
Handle direct event messages in JS view channel (#1332) 2022-08-04 23:01:09 +02:00
Jonatan Kłosko 194e31e2d9
Add support for layout outputs (#1326) 2022-08-04 00:24:15 +02:00
Jonatan Kłosko 920f70817e
Fix ignored output (#1323) 2022-08-02 19:33:43 +02:00
Jonatan Kłosko 36ce11c211
Fix signature completion and signature types in older Erlang docs (#1318) 2022-08-02 11:29:45 +02:00
Jonatan Kłosko 75e47aa593
Reflect input change when clicking the reevaluate button (#1269) 2022-07-11 14:35:05 +02:00
Jonatan Kłosko 1757e21bca
Fix user profile edits to not crash on the homepage (#1268) 2022-07-10 20:16:55 +02:00
Jonatan Kłosko 5c0ad7ba1d
Fix nested frame updates (#1251) 2022-06-29 22:04:27 +02:00
Jonatan Kłosko a7d7e6332d
Change text inputs to apply change on blur (#1243) 2022-06-24 12:00:23 +02:00
ByeongUk Choi 8f4cafe264
Add link to Hexdocs in hover docs (#1221)
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-06-14 01:21:42 +02:00
Kian-Meng Ang b18a93af93
Fix typos (#1222) 2022-06-12 18:10:37 +02:00
Jonatan Kłosko 2bec50d910
Fix tests on OTP 25 (#1204) 2022-05-27 17:32:56 +02:00
José Valim 49492771f3 Ignore asset directories if they are empty
macOS removes files from the temporary directory but
keeps the directory. This would cause LiveView to
misbehave as it would assume all assets are checked out.
2022-05-13 14:41:06 +02:00
Jonatan Kłosko 9a016e439d
Synchronize smart cell source before evaluation (#1164)
* Synchronize smart cell source before evaluation

* Sync JS view only if present

* Synchronize with smart cell only when started

* Update references to kino packages

* Update the Smart cells notebook

* Rename add dependnecy to add package

* Update changelog
2022-05-03 15:09:37 +02:00
Jonatan Kłosko ba77c18616
Clear cells indicator after erasing outputs (#1160) 2022-05-02 15:37:15 +02:00
Jonatan Kłosko 2a1d937189
Update wording around dependencies and packages (#1151) 2022-04-30 17:14:10 +02:00
Jonatan Kłosko 8e063792ff
Improvements to the smart cells flow (#1150)
* Reword reinstall to restart

* Clarify Smart cell message when dependencies are installing

* Handle universal shortcuts in inside iframe inputs

* Adjust smart cell icons

* Improve wording in the dependency install prompt

* Reevaluate cells after installing smart cell dependencies

* 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-04-30 12:26:03 +02:00
Jonatan Kłosko 8f72d0175e
Update references to kino (#1148)
* Update references to kino

* Update changelog

* Make the Chart cell section branching

* Apply suggestions from code review

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

* Capitalization

* Add link to the Iris dataset

* Pass keys to Process.info/2

Co-authored-by: José Valim <jose.valim@dashbit.co>
2022-04-29 13:45:33 +02:00
Jonatan Kłosko f39699b65e
Update instructions in the Elixir export (#1144) 2022-04-25 13:37:15 +02:00
Jonatan Kłosko 94dc3862a3
Use more specific scope for custom kinos (#1142) 2022-04-25 12:01:48 +02:00
Jonatan Kłosko 5e966bfb68
Add test for appending to Mix install with options (#1137) 2022-04-21 20:09:48 +02:00
Jonatan Kłosko 609409e842
Encapsulate pubsub subscriptions (#1132) 2022-04-19 11:29:38 +02:00
ByeongUk Choi 120eb2d0ef
Redirect after authentication (#1112)
* auth token mode routes /authentication

* redirect after authentication with session

* Apply code review

* Apply suggestions from code review

* Apply suggestions from code review
2022-04-15 14:24:35 +02:00
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
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
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
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
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 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
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 becdda61f7
Support optional reevaluation on smart cell update (#1062) 2022-03-18 19:36:48 +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 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
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
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
José Valim 67e73b6f89 Remove autocompletion to deprecated operator 2021-12-10 23:39:30 +01:00
Stephen Ball 8c4ef89685
Update the vim modeline comment to not error (#774)
The currently suggested vim modeline formatting string to allow .livemd
files to render as markdown on GitHub works, but confuses vim itself.

```
<!-- vim: syntax=markdown -->
```

When opening a .livemd file with the suggested modeline in vim it errors
when it tries to parse `-->` as a modeline option.

e.g.

```
"2021/day2.livemd" 81L, 1616B
Error detected while processing modelines:
line    1:
E518: Unknown option: -->
```

The fix is to replace the suggested vim modeline

```
<!-- vim: syntax=markdown -->
```

With a modeline declaration format that indicates when the modeline
options are complete, allowing vim to ignore the rest of the line.

```
<!-- vim: set syntax=markdown: -->
```

Reference
- vim issue: https://github.com/vim/vim/issues/1648
- especially this comment: https://github.com/vim/vim/issues/1648#issuecomment-296386153

Fixes #773
2021-12-08 16:15:07 +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
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 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
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
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