Skip to content

Commit 95cfe75

Browse files
authored
Git integration copy/UX refinements (#3074)
1 parent 871a0a0 commit 95cfe75

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

lib/livebook_web/live/hub/file_system_form_component.ex

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ defmodule LivebookWeb.Hub.FileSystemFormComponent do
7373
checked_value={:git}
7474
disabled={@mode == :edit}
7575
>
76-
Configure a read-only Git repository as a Livebook file storage. You will need a valid SSH key to access your Git repository.
76+
Configure a Git repository as a read-only Livebook file storage. You will need a valid SSH key to access your Git repository.
7777
</.radio_card_input>
7878
</div>
7979
</div>
@@ -91,7 +91,11 @@ defmodule LivebookWeb.Hub.FileSystemFormComponent do
9191
<.file_system_form_fields {assigns} />
9292
9393
<div class="flex space-x-2">
94-
<.button type="submit" disabled={@disabled or not @form.source.valid?}>
94+
<.button
95+
type="submit"
96+
disabled={@disabled or not @form.source.valid?}
97+
>
98+
<.spinner class="hidden phx-submit-loading:block mr-1" />
9599
<.remix_icon icon={@button.icon} />
96100
<span class="font-normal">{@button.label}</span>
97101
</.button>
@@ -145,7 +149,7 @@ defmodule LivebookWeb.Hub.FileSystemFormComponent do
145149
<.text_field
146150
field={@form[:repo_url]}
147151
label="Repository URL"
148-
placeholder="git@[provider]:[username]/[repo_name].git"
152+
placeholder="git@[provider_host]:[owner]/[repo_name].git"
149153
/>
150154
<.text_field
151155
field={@form[:branch]}
@@ -154,9 +158,8 @@ defmodule LivebookWeb.Hub.FileSystemFormComponent do
154158
/>
155159
<.password_field field={@form[:key]} label="SSH Private Key" />
156160
<p class="text-xs text-gray-700">
157-
You can use your own SSH Private Key or you can set up the Deploy Key
158-
only for this repository. Check the documentation from your
159-
version control system to create your Deploy Key.
161+
An SSH private key with repository access. You may use a personal key or a deploy key.
162+
See your Git provider’s documentation to create a deploy key.
160163
</p>
161164
</div>
162165
"""

lib/livebook_web/live/open_live/file_component.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ defmodule LivebookWeb.OpenLive.FileComponent do
7171

7272
defp open_button_tooltip_attrs(file, file_info) do
7373
if regular?(file, file_info) and not writable?(file_info) do
74-
[class: "tooltip top", "data-tooltip": "This file is write-protected, please fork instead"]
74+
[
75+
class: "tooltip top",
76+
"data-tooltip": "This file is write-protected, fork to create an editable copy"
77+
]
7578
else
7679
[]
7780
end

test/livebook_web/live/open_live_test.exs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ defmodule LivebookWeb.OpenLiveTest do
9999
|> has_element?()
100100

101101
assert view
102-
|> element(~s{[data-tooltip="This file is write-protected, please fork instead"]})
102+
|> element(
103+
~s{[data-tooltip="This file is write-protected, fork to create an editable copy"]}
104+
)
103105
|> has_element?()
104106
end
105107
end

0 commit comments

Comments
 (0)