From 95cfe753f3245fc99a24b87491a3d981d8677e7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Bara=C3=BAna?= Date: Wed, 1 Oct 2025 16:00:30 -0300 Subject: [PATCH] Git integration copy/UX refinements (#3074) --- .../live/hub/file_system_form_component.ex | 15 +++++++++------ lib/livebook_web/live/open_live/file_component.ex | 5 ++++- test/livebook_web/live/open_live_test.exs | 4 +++- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/lib/livebook_web/live/hub/file_system_form_component.ex b/lib/livebook_web/live/hub/file_system_form_component.ex index d01525802..df11a387b 100644 --- a/lib/livebook_web/live/hub/file_system_form_component.ex +++ b/lib/livebook_web/live/hub/file_system_form_component.ex @@ -73,7 +73,7 @@ defmodule LivebookWeb.Hub.FileSystemFormComponent do checked_value={:git} disabled={@mode == :edit} > - Configure a read-only Git repository as a Livebook file storage. You will need a valid SSH key to access your Git repository. + Configure a Git repository as a read-only Livebook file storage. You will need a valid SSH key to access your Git repository. @@ -91,7 +91,11 @@ defmodule LivebookWeb.Hub.FileSystemFormComponent do <.file_system_form_fields {assigns} />
- <.button type="submit" disabled={@disabled or not @form.source.valid?}> + <.button + type="submit" + disabled={@disabled or not @form.source.valid?} + > + <.spinner class="hidden phx-submit-loading:block mr-1" /> <.remix_icon icon={@button.icon} /> {@button.label} @@ -145,7 +149,7 @@ defmodule LivebookWeb.Hub.FileSystemFormComponent do <.text_field field={@form[:repo_url]} label="Repository URL" - placeholder="git@[provider]:[username]/[repo_name].git" + placeholder="git@[provider_host]:[owner]/[repo_name].git" /> <.text_field field={@form[:branch]} @@ -154,9 +158,8 @@ defmodule LivebookWeb.Hub.FileSystemFormComponent do /> <.password_field field={@form[:key]} label="SSH Private Key" />

- You can use your own SSH Private Key or you can set up the Deploy Key - only for this repository. Check the documentation from your - version control system to create your Deploy Key. + An SSH private key with repository access. You may use a personal key or a deploy key. + See your Git provider’s documentation to create a deploy key.

""" diff --git a/lib/livebook_web/live/open_live/file_component.ex b/lib/livebook_web/live/open_live/file_component.ex index e56d9f135..22f42346f 100644 --- a/lib/livebook_web/live/open_live/file_component.ex +++ b/lib/livebook_web/live/open_live/file_component.ex @@ -71,7 +71,10 @@ defmodule LivebookWeb.OpenLive.FileComponent do defp open_button_tooltip_attrs(file, file_info) do if regular?(file, file_info) and not writable?(file_info) do - [class: "tooltip top", "data-tooltip": "This file is write-protected, please fork instead"] + [ + class: "tooltip top", + "data-tooltip": "This file is write-protected, fork to create an editable copy" + ] else [] end diff --git a/test/livebook_web/live/open_live_test.exs b/test/livebook_web/live/open_live_test.exs index 73c3500b8..9403b12ec 100644 --- a/test/livebook_web/live/open_live_test.exs +++ b/test/livebook_web/live/open_live_test.exs @@ -99,7 +99,9 @@ defmodule LivebookWeb.OpenLiveTest do |> has_element?() assert view - |> element(~s{[data-tooltip="This file is write-protected, please fork instead"]}) + |> element( + ~s{[data-tooltip="This file is write-protected, fork to create an editable copy"]} + ) |> has_element?() end end