Commit graph

43 commits

Author SHA1 Message Date
Jonatan Kłosko c674a0ec5d
Normalize textarea newlines (#402)
* Normalize textarea newlines

* Add test
2021-06-26 00:53:12 +02:00
Jonatan Kłosko 4ca6f9eb5e
Implement reactive input (#389)
* Implement reactive input

* Store reactive attribute only when truthy

* Polishing
2021-06-24 11:58:13 +02:00
Shavit a104d9d73b
Show the evaluation time next to the cell indicator (#366)
* Display the time in seconds

Show the evaluation time next to the cell indicator

* Test session data

* Send evaluation time to session

Start the evaluation time inside the evaluator, display the time in seconds
or milliseconds.

The output is not a string but a map

* Add metadata to evaluation_response

* Wrap the evaluation indicator in a tooltip

  • Add metadata argument to the evaluation_response message
  • Use a tooltip to display the evaluation time

* Display the toolip below the indicator

* Remove the evaluation start time

* Make the tooltip optional

* Rename finish_cell_evaluation

* Evaluator tests

* Update test to accespt metadata

* Pass the evaluated time as a third argument

* Make status tooltip more generic

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-06-20 14:48:00 +02:00
Jonatan Kłosko 2b2d6c9d50
Show consistent user avatar on initial page load (#349) 2021-06-15 19:33:16 +02:00
Jonatan Kłosko 6274731c8d Make sure session is forked with complete data 2021-06-10 20:03:47 +02:00
Jonatan Kłosko e02bcce0bf
Drop cell source text from data in LV when no longer needed (#342) 2021-06-10 15:41:40 +02:00
Jonatan Kłosko b0bd7540c0
Compute cell source digest on the client (#341) 2021-06-10 14:54:55 +02:00
Jonatan Kłosko 8dea99e600
Support inputs (#328)
* Render basic input

* Make each cell type a separate struct

* Add operation to set input value

* Prototype communication

* Make input name editable

* Refactoring

* Unify cell attribute setters

* IO tests

* Document input communication protocol in Runtime

* Add more tests

* Add persistence

* Fix status update on cell attributes change

* Rework persistence

* Integrate input cell with insert mode

* Add missing users keybinding

* Mimic autofocus for dynamically inserted elements

* Support input type selection

* Support URL input and set up validation

* Convert input error into a more meaningful io error

* Add missing client checks

* Consume every input only once per evaluation

* Fixes
2021-06-08 12:33:50 +02:00
Jonatan Kłosko da64f51589
Show an informative message on completion when there is no runtime (#316) 2021-06-03 19:43:22 +02:00
Jonatan Kłosko c07da9880c
Update LV version and remove deprecations (#312)
* Bump LiveView

* Remove deprecated socket argument to live_component

* Point to an exact LV version
2021-06-03 13:53:03 +02:00
Jonatan Kłosko f70581f255
Introduce an Explore section (#310)
* Add explore page

* Move sidebar to a configurable component

* Fix homepage test

* Add images

* Store example notebooks in files and make explore notebooks linkable

* Fix tests

* Raise on invalid notebook slug

* Keep just the file contents in notebook info

* Move notebook lookup to Explore

* Exclude notebooks in progress
2021-06-02 21:51:43 +02:00
Brian Underwood 8dfe12da68
Change anchor tags for sections to be based on the titles, not randomly generated (#288)
* Change anchor tags for sections to be based on the titles, not randomly generated

* Update lib/livebook_web/helpers.ex

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-05-23 18:22:55 +02:00
Jonatan Kłosko 1a1057153e
Optimise data view recomputation for delta operations (#286)
* Optimise data view recomputation for delta operations

* Use generic access_by_id/1 for nested updates

* Use access_by_id/1 for nested notebook updates

* Use Enum.split_while
2021-05-21 14:56:25 +02:00
Jonatan Kłosko cd80bd7804
Implement user cursor and selection tracking (#260)
* Implement user cursor and selection tracking

* Separate jump-to-user and follow
2021-05-07 16:41:37 +02:00
Jonatan Kłosko 5c8e117800
Setup user profiles (#253)
* Add initial user config modal

* Assign user ids

* Update session data to hold user ids

* Get users list for specific ids

* Render user avatar

* User update

* Refactor user changes

* Subscribe to individual user updates

* Show users in side panel

* Add sidebar to homepage

* Don't generate the same color twice in a row

* Add documentation notes

* Fix tests

* Add tests

* Keep users in session data

* Rename color to hex_color
2021-05-03 20:03:19 +02:00
Jonatan Kłosko 3694576244
Require cookie for connecting to an attached node (#245)
* Require cookie for connecting to an attached node

* Fix modals sizing
2021-04-28 14:28:28 +02:00
Jonatan Kłosko e755ff8122
Restructure settings (#233)
* Force menu items into a single line

* Add shortcut for saving the notebook

* Make the disk icon always show file dialog

* Split runtime and file settings into separate modals

* Add ctrl+s to the shortcuts list

* Add togglable menu to the session page

* Make sure newly saved file appears in the file selector

* Fix path seletor force reloading

* Remove notebook generated in tests

* Add test for file list refresh after save
2021-04-21 23:02:09 +02:00
Jonatan Kłosko 91af8a46ed Make the sidebar floating on small screens 2021-04-21 17:42:03 +02:00
Jonatan Kłosko 700987dc02
Add editor completion to Elixir cells (#208)
* Implement editor completion for Elixir cells

* Add completion tests

* Refactor completion

* Only extract Markdown docs for now

* Fix Elixir version-dependent test

* Fix docs matching

* Use upcoming Code.cursor_context/2

* Start temporary completion processes under a supervisor

* Show Erlang docs in completion items

* Update to latest Code.cursor_context

* Refactor completion

* Fix module completion when alias expands to Erlang module

* Remove tests-generated notebook

* Show variables and map fields differently

* Adjust signatures formatting
2021-04-20 19:34:17 +02:00
Jonatan Kłosko 04edc75181
Scroll to section when moved (#226) 2021-04-20 19:31:23 +02:00
Benjamin Philip 682ee396d0
Allow re-ordering of sections (#221)
* Allow server-side re-ordering of sections

* `Livebook.Notenook.move_section` definition
* Management and implementation of requests
* tests

This commit allows a person to send a request to the server to move a
section. However, the functionality in not yet available in the UI.

* Allow "Move up" and "Move down" functionality for sections

* Rendering of up and down "arrows" at Section's side
* Request from UI on click

This commit enables a user to move a section upwards or downwards, much
like a cell. However, after the section moves, the focus is not changed
to it.

* Apply formatting

* Define a function to update cell status

* Defines a common function for `move_cell` and `move_section` to use to
update cell status.
2021-04-20 12:12:29 +02:00
TED 623c5b3290
Add notbook runtime settings shortcut (#176) 2021-04-14 12:20:51 +02:00
Jonatan Kłosko 2887527dc9
Fix sections sidebar overflow (#171) 2021-04-14 11:35:54 +02:00
Jonatan Kłosko d93b5d8450
Set up image uploads for Markdown content (#132)
* Add cell image upload modal

* Add controller for serving the images and handle this on markdown side

* Use per-session images dir

* Add etag header to session image responses

* Adjust markdown image styling

* Properly manage session images dir

* Add tests

* Set maximum file size for image uploads

* Move images dir specifics to the Session module

* Move images when nonpersistent session becomes persistent

* Update lib/livebook_web/live/session_live.ex

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

* Update lib/livebook_web/live/session_live.ex

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

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

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

* Test that close gets rid of session temporary dir

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-04-04 18:55:51 +02:00
José Valim 5fb753c4d1
Logo and README (#133) 2021-04-04 12:42:46 +02:00
Jonatan Kłosko 9ec80acc63
Design adjustments (#131)
* Add full logo to the homepage

* Update sidebar active icon style

* Update lib/livebook_web/live/home_live.ex

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

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-04-02 14:54:14 +02:00
Jonatan Kłosko cc9d5a8103
Prevent from scrolling to top on modal open (#129)
* Render modal components at the end of live views

* Add error pages

* Restructure web module

* Update lib/livebook_web/templates/error/500.html.eex

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

* Update lib/livebook_web/templates/error/500.html.eex

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

* Update lib/livebook_web/views/error_view.ex

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

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-04-02 14:00:49 +02:00
Jonatan Kłosko 5efd8eb851
Notebook status indicators (#127)
* Add notebook indicators

* Make evaluation status button point to the corresponding cell

* Rename introductory notebook

* Update path highlight when chosen for saving

* Allow specifying nonexistent directories when saving and create those

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

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

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

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

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

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

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

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

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

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

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-04-01 12:56:19 +02:00
Jonatan Kłosko a1bf2d999e
Handle evaluator process failures (#121)
* Handle evaluator process failures

* Add test

* Use Exception.format_exit/1
2021-03-29 19:52:06 +02:00
Jonatan Kłosko e335ecb791
Focus notebook name after creation (#122) 2021-03-29 19:50:46 +02:00
Jonatan Kłosko 143cd5d80f
Optimise rendering and diff by stripping data into view-specific struct (#119)
* Optimise rendering and diff by stripping data into view-specific struct

* Move data to socket.private
2021-03-25 23:29:22 +01:00
Jonatan Kłosko 0983a9df77
Add confirmation for session deletion (#117)
* Update sections panel

* Add deletion confirm and unify buttons

* Align notebook title

* Fix whitespace shrinking in the editor

* Update session deletion route
2021-03-25 17:39:18 +01:00
Jonatan Kłosko fe5dfe3b86
Insert section (#114)
* Add section insertion button

* Add shortcut for inserting section

* Pass buttons to the component

* Add mix alias for running both formatter

* Adjustments

* Make the buttons group component stateless
2021-03-24 18:37:50 +01:00
Jonatan Kłosko a18122cfcb
Further redesign (#112)
* Update logo and favicon

* Tiny updates

* Replace checkbox with switch button

* Build assets

* Move assets/static to priv/static

* Update lib/livebook_web/endpoint.ex

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

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-03-23 17:46:33 +01:00
Jonatan Kłosko 92c34b8718
Add shortcuts for toggling sections panel and showing settings (#110)
* Add shortcuts for toggling sections panel and showing settings

* List new shortcuts
2021-03-23 15:27:03 +01:00
Jonatan Kłosko af79a0fd2f
Improve tab navigation (#109)
* Ignore editor for tab movement

* Improve tab behaviour within notebook

* Highlight focused regular buttons

* Show tooltips on focused elements
2021-03-23 14:10:34 +01:00
Jonatan Kłosko 6d56ef141b
Add tooltips (#107) 2021-03-22 22:15:40 +01:00
Jonatan Kłosko 90e7941fe4
Redesign (#80)
* Update cell actions

* Add new focus indicator

* Update headings typography

* Update cell actions and insert buttons

* Add sidebar menu

* Add settings modal

* Update homepage

* Update settings dialog

* Rename classes

* Add floating menu

* Update icon colors on hover

* Fix homepage tests

* Format assets source

* Update monaco editor

* Fix editor width on resize

* Add more padding to the notebook content

* Update settings dialog title

* Show reevaluate button when the cell is in evaluated state

* Show section actions on focus or hover only

* Pre-fill runtime selector with the current configuration

* Ignore cmd + enter in Markdown cells
2021-03-20 14:10:15 +01:00
Jonatan Kłosko 7fa2b44666
Highlight viewed section within the list (#76)
* Add fallback primary fonts

* Highlight viewed section in the navbar

* Fix moving cells with empty sections

* Reword attribute
2021-03-12 16:40:37 +01:00
Jonatan Kłosko a2d1e2f934
Initial redesign (#75)
* Add Remix icons

* Replace existing icons with Remix icons

* Update fonts

* Redesign homepage

* Redesign shortcuts modal

* Fix tests
2021-03-12 11:57:01 +01:00
Jonatan Kłosko 266bf35bd0
Move focus navigation to the client (#74)
* Show all sections and enable cross-section focus navigation

* Move focus to the client

* Add shortcut for evaluating all cells

* Fix and expand tests

* Make section links scroll to the given section
2021-03-11 15:28:18 +01:00
Jonatan Kłosko ac9b5526fe
Make evaluation linear (#73)
* Evaluate stale cells that the run cell depends on

* Make evaluation linear
2021-03-09 19:35:39 +01:00
Jonatan Kłosko dae6d5c9c3
Rename project (#68)
* Rename references

* Update file and directory names

* Fix homepage tests
2021-03-03 22:56:28 +01:00
Renamed from lib/live_book_web/live/session_live.ex (Browse further)