Commit 71d1e09
committed
Resolves #4662 ([FR-1695](https://lablup.atlassian.net/browse/FR-1695))
## Problem & Motivation
Users frequently need to check for updated files in their virtual folders, especially after uploading files or when collaborating with others. Currently, BAIFileExplorer lacks an intuitive manual refresh mechanism, forcing users to close and reopen the modal or navigate away and back to see updated content.
## User Impact
### Before:
- Users cannot easily verify if their file uploads completed successfully
- Collaborators cannot see newly shared files without reopening the folder
- The loading experience feels unresponsive and unclear
- Users are unsure whether the file list is currently updating or showing stale data
### After:
- Users can manually refresh at any time with a single click
- Clear visual feedback shows when data was last updated (e.g., "Last Updated: 2 minutes ago")
- Loading states are optimized: spinner for first load, subtle opacity change for refreshes
- Users maintain context and control over their file browsing experience
## Changes
1. **Refresh Button Integration**: Added BAIFetchKeyButton to ExplorerActionControls with loading state feedback
2. **Loading State Optimization**:
- Spinner loading for initial file list load
- Opacity-based loading for subsequent refreshes
- Distinguish between `isFirstFetching` and `isFetching` states
3. **Component Migration**: Moved BAIFetchKeyButton and useIntervalValue hooks to backend.ai-ui package for reusability
4. **i18n Support**: Added translations in 20+ languages following `comp:ComponentName.Key` pattern
## Test Plan
- [ ] Verify refresh button appears in file explorer
- [ ] Check that clicking refresh updates the file list
- [ ] Confirm "Last Updated" timestamp displays correctly
- [ ] Test initial loading shows spinner
- [ ] Test refresh shows opacity change (not spinner)
- [ ] Verify functionality works after file upload
- [ ] Test in both light and dark themes
[FR-1695]: https://lablup.atlassian.net/browse/FR-1695?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent 1b46ac6 commit 71d1e09
File tree
52 files changed
+193
-80
lines changed- packages/backend.ai-ui/src
- __test__
- components
- baiClient/FileExplorer
- hooks
- locale
- react/src
- components
- pages
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
52 files changed
+193
-80
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
Lines changed: 13 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | | - | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
21 | | - | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| 34 | + | |
| 35 | + | |
32 | 36 | | |
33 | | - | |
34 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
35 | 40 | | |
36 | | - | |
| 41 | + | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
| |||
61 | 66 | | |
62 | 67 | | |
63 | 68 | | |
64 | | - | |
| 69 | + | |
65 | 70 | | |
66 | 71 | | |
67 | 72 | | |
| |||
90 | 95 | | |
91 | 96 | | |
92 | 97 | | |
93 | | - | |
| 98 | + | |
94 | 99 | | |
95 | 100 | | |
96 | 101 | | |
| |||
Lines changed: 17 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| 75 | + | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | 82 | | |
90 | 83 | | |
91 | 84 | | |
| |||
153 | 146 | | |
154 | 147 | | |
155 | 148 | | |
156 | | - | |
| 149 | + | |
157 | 150 | | |
158 | 151 | | |
159 | 152 | | |
| |||
247 | 240 | | |
248 | 241 | | |
249 | 242 | | |
250 | | - | |
251 | 243 | | |
252 | 244 | | |
253 | 245 | | |
| |||
297 | 289 | | |
298 | 290 | | |
299 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
300 | 301 | | |
301 | 302 | | |
302 | 303 | | |
303 | 304 | | |
304 | 305 | | |
305 | 306 | | |
306 | | - | |
| 307 | + | |
307 | 308 | | |
308 | 309 | | |
309 | | - | |
| 310 | + | |
310 | 311 | | |
311 | | - | |
312 | | - | |
313 | | - | |
| 312 | + | |
314 | 313 | | |
315 | 314 | | |
316 | 315 | | |
317 | 316 | | |
318 | 317 | | |
319 | 318 | | |
320 | | - | |
| 319 | + | |
321 | 320 | | |
322 | 321 | | |
323 | 322 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| 51 | + | |
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
| |||
163 | 166 | | |
164 | 167 | | |
165 | 168 | | |
| 169 | + | |
166 | 170 | | |
167 | 171 | | |
168 | 172 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| 65 | + | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
| |||
0 commit comments