Commit graph

285 commits

Author SHA1 Message Date
Milo Lee 20bcac1184
Make textarea resizable (#970) 2022-02-02 14:12:50 +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 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
José Valim 372f086044 Move from Helpers to Utils and add doctests 2022-01-29 10:39:26 +01:00
Sam 420284006a
Add url arg to the CLI (#947) 2022-01-29 10:36:32 +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 7fc8f24d2c
Fix image uploads in Markdown cells (#945)
* Fix call to consume_uploaded_entries to match changes in LV

* Escape reserved characters when inserting image in a Markdown cell
2022-01-27 15:47:04 +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
Joe Martinez 961581bfc7
bump phoenix_live_view to 0.17.6 (#919)
* bump phoenix_live_view to 0.17.6

* revert change to static dir

* fix deprecation warning
2022-01-24 11:30:07 +01:00
Cristine Guadelupe 4f197698ae
Favicon as png to work on Safari (#920) 2022-01-22 18:15:06 -03:00
Cristine Guadelupe c2feceba37
Redesign the memory info chart on home (#918) 2022-01-22 17:46:53 -03:00
José Valim c58ab447e5 Compute memory information on every session list render 2022-01-22 18:30:37 +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
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
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
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
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
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