Skip to content

Commit d4435e3

Browse files
authored
feat: Updated file browser to use single click to navigate (#504)
1 parent c8267da commit d4435e3

File tree

4 files changed

+27
-84
lines changed

4 files changed

+27
-84
lines changed

application/app/javascript/controllers/file_browser_controller.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default class extends Controller {
5555
})
5656
}
5757

58-
handleDoubleClick(event) {
58+
handleClick(event) {
5959
const row = event.currentTarget
6060
const type = row.dataset.entryType
6161
const path = row.dataset.entryPath
@@ -64,9 +64,22 @@ export default class extends Controller {
6464
if (type === "folder") {
6565
this.pathInputTarget.value = path
6666
this.navigate()
67-
} else {
67+
}
68+
}
69+
70+
handleDoubleClick(event) {
71+
const row = event.currentTarget
72+
const type = row.dataset.entryType
73+
const path = row.dataset.entryPath
74+
75+
if (type === "file") {
6876
this.notifyDropTarget(path)
6977
}
78+
79+
if (type === "folder") {
80+
this.pathInputTarget.value = path
81+
this.navigate()
82+
}
7083
}
7184

7285
handleKeydown(event) {

application/app/views/file_browser/_browser.html.erb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
tabindex="0"
1111
data-entry-path="/"
1212
data-entry-type="folder"
13-
data-action="dblclick->file-browser#handleDoubleClick keydown->file-browser#handleKeydown">
13+
data-action="click->file-browser#handleClick">
1414
<i class="bi bi-diagram-3"></i>
1515
</a>
1616
</li>
@@ -25,7 +25,7 @@
2525
tabindex="0"
2626
data-entry-path="<%= accumulated_path %>"
2727
data-entry-type="folder"
28-
data-action="dblclick->file-browser#handleDoubleClick keydown->file-browser#handleKeydown">
28+
data-action="click->file-browser#handleClick keydown->file-browser#handleKeydown">
2929
<i class="bi bi-folder-fill" aria-hidden="true"></i> <%= part %>
3030
</a>
3131
</li>
@@ -71,7 +71,7 @@
7171
data-entry-type="folder"
7272
title="<%= t('.button_home_title') %>"
7373
aria-label="<%= t('.button_home_label') %>"
74-
data-action="click->file-browser#handleDoubleClick">
74+
data-action="click->file-browser#handleClick">
7575
<i class="bi bi-house-door-fill" aria-hidden="true"></i>
7676
<span class="visually-hidden"><%= t('.button_home_text') %></span>
7777
</button>
@@ -95,7 +95,7 @@
9595
data-entry-path="<%= File.expand_path('..', current_path) %>"
9696
data-entry-type="folder"
9797
tabindex="0"
98-
data-action="dblclick->file-browser#handleDoubleClick keydown->file-browser#handleKeydown">
98+
data-action="click->file-browser#handleClick keydown->file-browser#handleKeydown">
9999
<i class="bi bi-arrow-up fs-6"></i>
100100
<span>.. (<%= t('.browser_parent_folder_text') %>)</span>
101101
</li>
@@ -107,7 +107,7 @@
107107
data-entry-type="<%= entry.type %>"
108108
draggable="true"
109109
tabindex="0"
110-
data-action="dragstart->file-browser#handleDragStart dragend->file-browser#handleDragEnd dblclick->file-browser#handleDoubleClick keydown->file-browser#handleKeydown">
110+
data-action="dragstart->file-browser#handleDragStart dragend->file-browser#handleDragEnd click->file-browser#handleClick dblclick->file-browser#handleDoubleClick keydown->file-browser#handleKeydown">
111111

112112
<!-- Icon -->
113113
<i class="bi <%= browser_entry_icon(entry) %> fs-5 text-secondary" aria-hidden="true"></i>

application/yarn.lock

Lines changed: 5 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -2,71 +2,6 @@
22
# yarn lockfile v1
33

44

5-
"@parcel/watcher-android-arm64@2.5.1":
6-
version "2.5.1"
7-
resolved "https://registry.yarnpkg.com/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.1.tgz#507f836d7e2042f798c7d07ad19c3546f9848ac1"
8-
integrity sha512-KF8+j9nNbUN8vzOFDpRMsaKBHZ/mcjEjMToVMJOhTozkDonQFFrRcfdLWn6yWKCmJKmdVxSgHiYvTCef4/qcBA==
9-
10-
"@parcel/watcher-darwin-arm64@2.5.1":
11-
version "2.5.1"
12-
resolved "https://registry.yarnpkg.com/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.1.tgz#3d26dce38de6590ef79c47ec2c55793c06ad4f67"
13-
integrity sha512-eAzPv5osDmZyBhou8PoF4i6RQXAfeKL9tjb3QzYuccXFMQU0ruIc/POh30ePnaOyD1UXdlKguHBmsTs53tVoPw==
14-
15-
"@parcel/watcher-darwin-x64@2.5.1":
16-
version "2.5.1"
17-
resolved "https://registry.yarnpkg.com/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.1.tgz#99f3af3869069ccf774e4ddfccf7e64fd2311ef8"
18-
integrity sha512-1ZXDthrnNmwv10A0/3AJNZ9JGlzrF82i3gNQcWOzd7nJ8aj+ILyW1MTxVk35Db0u91oD5Nlk9MBiujMlwmeXZg==
19-
20-
"@parcel/watcher-freebsd-x64@2.5.1":
21-
version "2.5.1"
22-
resolved "https://registry.yarnpkg.com/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.1.tgz#14d6857741a9f51dfe51d5b08b7c8afdbc73ad9b"
23-
integrity sha512-SI4eljM7Flp9yPuKi8W0ird8TI/JK6CSxju3NojVI6BjHsTyK7zxA9urjVjEKJ5MBYC+bLmMcbAWlZ+rFkLpJQ==
24-
25-
"@parcel/watcher-linux-arm-glibc@2.5.1":
26-
version "2.5.1"
27-
resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.1.tgz#43c3246d6892381db473bb4f663229ad20b609a1"
28-
integrity sha512-RCdZlEyTs8geyBkkcnPWvtXLY44BCeZKmGYRtSgtwwnHR4dxfHRG3gR99XdMEdQ7KeiDdasJwwvNSF5jKtDwdA==
29-
30-
"@parcel/watcher-linux-arm-musl@2.5.1":
31-
version "2.5.1"
32-
resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.1.tgz#663750f7090bb6278d2210de643eb8a3f780d08e"
33-
integrity sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q==
34-
35-
"@parcel/watcher-linux-arm64-glibc@2.5.1":
36-
version "2.5.1"
37-
resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.1.tgz#ba60e1f56977f7e47cd7e31ad65d15fdcbd07e30"
38-
integrity sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w==
39-
40-
"@parcel/watcher-linux-arm64-musl@2.5.1":
41-
version "2.5.1"
42-
resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.1.tgz#f7fbcdff2f04c526f96eac01f97419a6a99855d2"
43-
integrity sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg==
44-
45-
"@parcel/watcher-linux-x64-glibc@2.5.1":
46-
version "2.5.1"
47-
resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.1.tgz#4d2ea0f633eb1917d83d483392ce6181b6a92e4e"
48-
integrity sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A==
49-
50-
"@parcel/watcher-linux-x64-musl@2.5.1":
51-
version "2.5.1"
52-
resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.1.tgz#277b346b05db54f55657301dd77bdf99d63606ee"
53-
integrity sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg==
54-
55-
"@parcel/watcher-win32-arm64@2.5.1":
56-
version "2.5.1"
57-
resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.1.tgz#7e9e02a26784d47503de1d10e8eab6cceb524243"
58-
integrity sha512-RFzklRvmc3PkjKjry3hLF9wD7ppR4AKcWNzH7kXR7GUe0Igb3Nz8fyPwtZCSquGrhU5HhUNDr/mKBqj7tqA2Vw==
59-
60-
"@parcel/watcher-win32-ia32@2.5.1":
61-
version "2.5.1"
62-
resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.1.tgz#2d0f94fa59a873cdc584bf7f6b1dc628ddf976e6"
63-
integrity sha512-c2KkcVN+NJmuA7CGlaGD1qJh1cLfDnQsHjE89E60vUEMlqduHGCdCLJCID5geFVM0dOtA3ZiIO8BoEQmzQVfpQ==
64-
65-
"@parcel/watcher-win32-x64@2.5.1":
66-
version "2.5.1"
67-
resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.1.tgz#ae52693259664ba6f2228fa61d7ee44b64ea0947"
68-
integrity sha512-9lHBdJITeNR++EvSQVUcaZoWupyHfXe1jZvGZ06O/5MflPcuPLtEphScIBL+AiCWBO46tDSHzWyD0uDmmZqsgA==
69-
705
"@parcel/watcher@^2.4.1":
716
version "2.5.1"
727
resolved "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.1.tgz"
@@ -145,7 +80,7 @@ bootstrap-icons@^1.11.3:
14580

14681
bootstrap@^5.3.8:
14782
version "5.3.8"
148-
resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-5.3.8.tgz#6401a10057a22752d21f4e19055508980656aeed"
83+
resolved "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.8.tgz"
14984
integrity sha512-HP1SZDqaLDPwsNiqRqi5NcP0SSXciX2s9E+RyqJIIqGo+vJeN5AJVM98CXmW/Wux0nQ5L7jeWUdplCEf0Ee+tg==
15085

15186
brace-expansion@^1.1.7:
@@ -163,7 +98,7 @@ braces@^3.0.3, braces@~3.0.2:
16398
dependencies:
16499
fill-range "^7.1.1"
165100

166-
browserslist@^4.24.4:
101+
browserslist@^4.24.4, "browserslist@>= 4.21.0":
167102
version "4.24.4"
168103
resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz"
169104
integrity sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==
@@ -284,11 +219,6 @@ fs-extra@^11.0.0:
284219
jsonfile "^6.0.1"
285220
universalify "^2.0.0"
286221

287-
fsevents@~2.3.2:
288-
version "2.3.3"
289-
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
290-
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
291-
292222
get-caller-file@^2.0.5:
293223
version "2.0.5"
294224
resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz"
@@ -435,7 +365,7 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1:
435365
resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz"
436366
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
437367

438-
picomatch@^4.0.2:
368+
"picomatch@^3 || ^4", picomatch@^4.0.2:
439369
version "4.0.2"
440370
resolved "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz"
441371
integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==
@@ -483,7 +413,7 @@ postcss-value-parser@^4.2.0:
483413
resolved "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz"
484414
integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==
485415

486-
postcss@^8.5.6:
416+
postcss@^8.0.0, postcss@^8.1.0, postcss@^8.5.6, postcss@>=8.0.9:
487417
version "8.5.6"
488418
resolved "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz"
489419
integrity sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==
@@ -554,7 +484,7 @@ slash@^5.0.0:
554484
resolved "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz"
555485
integrity sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==
556486

557-
"source-map-js@>=0.6.2 <2.0.0", source-map-js@^1.2.1:
487+
source-map-js@^1.2.1, "source-map-js@>=0.6.2 <2.0.0":
558488
version "1.2.1"
559489
resolved "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz"
560490
integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==

docs/guide/content/user_guide/upload_file_selector.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ The selector temporarily splits the upload bundle tab into two areas:
2121

2222
### Navigating the Filesystem
2323

24-
- Use **double-click** to enter a folder.
24+
- Use **single-click** to enter a folder.
2525
- To go up one level, click the `.. (Parent folder)` entry at the top of the list.
26-
- Use the **breadcrumb path** displayed in the action bar to jump to any parent directory by double clicking on its name.
26+
- Use the **breadcrumb path** displayed in the action bar to jump to any parent directory by clicking on its name.
2727
- Click the **pencil icon** to manually edit the path.
2828
- Click **Home** to return to your home directory.
2929
- Alternatively the user can rely on the keyboard.

0 commit comments

Comments
 (0)