forge
Explore
Log in

Don't you dare go Hollow

One explorer-style list, search left, no em-dash copy

Browse files at this commit

1eb1a69f23bee711346cf35dd004f7d730ea4d85Ahmet Kaan GümüşParent: 2b5e0c8
  • feat
    • one explorer-style list, search left, no em-dash copy
Show full message
feat(ui): one explorer-style list, search left, no em-dash copy

Folders and Files stop being separate panels: the drive is one list,
folders first then files, like a file manager — one compact panel, no
heads or chips, one empty state ("This folder is empty. Press + to
create or upload, or drop files on this page."). Search results merge
the same way. File rows follow the folder edit-mode pattern (Rename
link swaps the row into its pre-filled rename form via ?edit=) instead
of a permanent inline input, and row actions pack onto one line.

The search box moves to the left of the bar, next to +.

User-visible copy no longer uses em dashes anywhere: welcome title,
empty states, link-once notice, view-only label, upload refusals.
crates/in-web/src/drive.rsmodified+62 -81
@@ -8,7 +8,7 @@
8 //! itself is refused. Anything naming another owner's tree answers 404,8 //! itself is refused. Anything naming another owner's tree answers 404,
9 //! never 403.9 //! never 403.
10 //!10 //!
11-//! `GET /drive?q=<text>` keeps the same page and swaps the folder panels11+//! `GET /drive?q=<text>` keeps the same page and swaps the folder list
12 //! for library-wide name hits — the filterbar's search box, submitted as a12 //! for library-wide name hits — the filterbar's search box, submitted as a
13 //! plain GET form. The old `GET /search?q=` address 303s here, so old links13 //! plain GET form. The old `GET /search?q=` address 303s here, so old links
14 //! keep working.14 //! keep working.
@@ -250,7 +250,6 @@ async fn drive(cx: &Cx) -> Result {
250 </nav>250 </nav>
251 }251 }
252 }252 }
253- <div class="spacer"></div>
254 <form class="field-box-search" method="get" action="/drive">253 <form class="field-box-search" method="get" action="/drive">
255 <input254 <input
256 class="field-input"255 class="field-input"
@@ -284,44 +283,38 @@ async fn drive(cx: &Cx) -> Result {
284 </div>283 </div>
285 </section>284 </section>
286 }285 }
286+ // The upload control sits outside the list so the + menu's
287+ // "Upload files" label and the page-wide drop handler find it on
288+ // every drive view, folder or search. The input stays hidden via
289+ // the file-upload-input rule.
290+ <form id="upload-form" class="file-upload" method="post" action="/files"
291+ enctype="multipart/form-data" data-hard="" data-failed-label=(t(language, Key::UploadFailed))>
292+ <input type="hidden" name="folder_id" value=(current_id.clone())>
293+ <input id="drive-upload-input" class="file-upload-input" type="file" name="file" multiple="">
294+ </form>
287 if let Some(hits) = hits {295 if let Some(hits) = hits {
288 if hits.folders.is_empty() && hits.files.is_empty() {296 if hits.folders.is_empty() && hits.files.is_empty() {
289 <p class="detail-quiet">(t(language, Key::NoResults))</p>297 <p class="detail-quiet">(t(language, Key::NoResults))</p>
290- }298+ } else {
291- if !hits.folders.is_empty() {299+ <section class="panel">
292- <section class="panel">300+ <div class="panel-body">
293- <div class="panel-head">301+ for folder in &hits.folders {
294- <h2 class="panel-title">(t(language, Key::FoldersHeading))</h2>302+ <div class="dep-row">
295- <span class="chip">(format!("{}", hits.folders.len()))</span>303+ <a class="dep-link" href=(format!("/drive?folder={}", folder.id))>(folder.name.clone())</a>
296- </div>304+ </div>
297- <div class="panel-body">305+ }
298- for folder in &hits.folders {306+ for file in &hits.files {
299- <p><a href=(format!("/drive?folder={}", folder.id))>(folder.name.clone())</a></p>307+ <div class="dep-row">
300- }308+ <a class="dep-link" href=(format!("/file/{}", file.id))>(file.name.clone())</a>
301- </div>309+ </div>
302- </section>310+ }
303- }311+ </div>
304- if !hits.files.is_empty() {312+ </section>
305- <section class="panel">
306- <div class="panel-head">
307- <h2 class="panel-title">(t(language, Key::FilesHeading))</h2>
308- <span class="chip">(format!("{}", hits.files.len()))</span>
309- </div>
310- <div class="panel-body">
311- for file in &hits.files {
312- <p><a href=(format!("/file/{}", file.id))>(file.name.clone())</a></p>
313- }
314- </div>
315- </section>
316 }313 }
317 } else {314 } else {
318 <section class="panel">315 <section class="panel">
319- <div class="panel-head">
320- <h2 class="panel-title">(t(language, Key::FoldersHeading))</h2>
321- <span class="chip">(format!("{}", listing.folders.len()))</span>
322- </div>
323 <div class="panel-body">316 <div class="panel-body">
324- if listing.folders.is_empty() {317+ if listing.folders.is_empty() && listing.files.is_empty() {
325 <p class="detail-quiet">(t(language, Key::EmptyFolder))</p>318 <p class="detail-quiet">(t(language, Key::EmptyFolder))</p>
326 }319 }
327 for folder in listing.folders.iter() {320 for folder in listing.folders.iter() {
@@ -359,59 +352,47 @@ async fn drive(cx: &Cx) -> Result {
359 }352 }
360 </div>353 </div>
361 }354 }
362- </div>355+ for file in listing.files.iter() {
363- </section>356+ <div class="dep-row">
364- <section class="panel">357+ if file.thumb_state == ThumbState::Ready {
365- <div class="panel-head">358+ <img class="file-chip" src=(format!("/thumb/{}", file.id)) alt="">
366- <h2 class="panel-title">(t(language, Key::FilesHeading))</h2>359+ } else {
367- <span class="chip">(format!("{}", listing.files.len()))</span>360+ <span class="file-chip" aria-hidden="true">"▦"</span>
368- </div>361+ }
369- <div class="panel-body">362+ if edit_id.as_deref() == Some(file.id.as_str()) {
370- <form id="upload-form" class="file-upload" method="post" action="/files"
371- enctype="multipart/form-data" data-hard="" data-failed-label=(t(language, Key::UploadFailed))>
372- <input type="hidden" name="folder_id" value=(current_id.clone())>
373- // No visible chooser here: the + menu's "Upload files"
374- // label targets this input. It stays in the DOM, display-
375- // none via the file-upload-input rule.
376- <input id="drive-upload-input" class="file-upload-input" type="file" name="file" multiple="">
377- </form>
378- if listing.files.is_empty() {
379- <p class="detail-quiet">(t(language, Key::EmptyFiles))</p>
380- }
381- <div class="file-list">
382- for file in listing.files.iter() {
383- <div class="dep-row">
384- if file.thumb_state == ThumbState::Ready {
385- <img class="file-chip" src=(format!("/thumb/{}", file.id)) alt="">
386- } else {
387- <span class="file-chip" aria-hidden="true">"▦"</span>
388- }
389- <a class="dep-link" href=(format!("/file/{}", file.id))>(file.name.clone())</a>
390- <span class="file-chip-size">(human_size(file.size_bytes))</span>
391- <div class="spacer"></div>
392 <form class="pop-row-form" method="post" action="/api/file/rename">363 <form class="pop-row-form" method="post" action="/api/file/rename">
393 <input type="hidden" name="id" value=(file.id.clone())>364 <input type="hidden" name="id" value=(file.id.clone())>
394 <input class="field-input" type="text" name="name" maxlength="255"365 <input class="field-input" type="text" name="name" maxlength="255"
395- value=(file.name.clone()) required="" aria-label=(t(language, Key::RenameFile))>366+ value=(file.name.clone()) required="" data-edit-focus=""
367+ aria-label=(t(language, Key::RenameFile))>
396 <button class="quiet" type="submit">(t(language, Key::Rename))</button>368 <button class="quiet" type="submit">(t(language, Key::Rename))</button>
369+ <a class="quiet" href=(here.clone())>(t(language, Key::Cancel))</a>
397 </form>370 </form>
398- <form class="pop-row-form" method="post" action="/api/file/move">371+ } else {
399- <input type="hidden" name="id" value=(file.id.clone())>372+ <a class="dep-link" href=(format!("/file/{}", file.id))>(file.name.clone())</a>
400- <select class="field-input" name="folder_id" aria-label=(t(language, Key::MoveFile))>373+ }
401- <option value="">(t(language, Key::Drive))</option>374+ <span class="file-chip-size">(human_size(file.size_bytes))</span>
402- for dest in destinations.iter() {375+ <div class="spacer"></div>
403- <option value=(dest.0.clone())>(dest.1.clone())</option>376+ if edit_id.as_deref() != Some(file.id.as_str()) {
404- }377+ <a class="quiet" href=(format!("{here}{edit_sep}edit={}", file.id))
405- </select>378+ aria-label=(t(language, Key::RenameFile))>(t(language, Key::Rename))</a>
406- <button class="quiet" type="submit">(t(language, Key::Move))</button>379+ <form class="pop-row-form" method="post" action="/api/file/move">
407- </form>380+ <input type="hidden" name="id" value=(file.id.clone())>
408- <form class="detail-delete-form" method="post" action="/api/file/delete">381+ <select class="field-input" name="folder_id" aria-label=(t(language, Key::MoveFile))>
409- <input type="hidden" name="id" value=(file.id.clone())>382+ <option value="">(t(language, Key::Drive))</option>
410- <button class="quiet" type="submit">(t(language, Key::Delete))</button>383+ for dest in destinations.iter() {
411- </form>384+ <option value=(dest.0.clone())>(dest.1.clone())</option>
412- </div>385+ }
413- }386+ </select>
414- </div>387+ <button class="quiet" type="submit">(t(language, Key::Move))</button>
388+ </form>
389+ <form class="detail-delete-form" method="post" action="/api/file/delete">
390+ <input type="hidden" name="id" value=(file.id.clone())>
391+ <button class="quiet" type="submit">(t(language, Key::Delete))</button>
392+ </form>
393+ }
394+ </div>
395+ }
415 </div>396 </div>
416 </section>397 </section>
417 }398 }
crates/in-web/src/i18n.rsmodified+8 -11
@@ -105,7 +105,6 @@ pub enum Key {
105 MoveFolder,105 MoveFolder,
106 DeleteFolder,106 DeleteFolder,
107 EmptyFolder,107 EmptyFolder,
108- EmptyFiles,
109 FoldersHeading,108 FoldersHeading,
110 FilesHeading,109 FilesHeading,
111 NameColumn,110 NameColumn,
@@ -199,7 +198,7 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
199 SomethingWentWrong => "Something went wrong.",198 SomethingWentWrong => "Something went wrong.",
200 NothingAtThisAddress => "There is nothing at this address.",199 NothingAtThisAddress => "There is nothing at this address.",
201 BackToDrive => "Back to the drive",200 BackToDrive => "Back to the drive",
202- WelcomeTitle => "In — your files",201+ WelcomeTitle => "In: your files",
203 WelcomeBlurb => "Your folders and files, shared on your terms.",202 WelcomeBlurb => "Your folders and files, shared on your terms.",
204 SignIn => "Sign in",203 SignIn => "Sign in",
205 NavDrive => "Drive",204 NavDrive => "Drive",
@@ -217,8 +216,7 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
217 RenameFolder => "Rename folder",216 RenameFolder => "Rename folder",
218 MoveFolder => "Move folder",217 MoveFolder => "Move folder",
219 DeleteFolder => "Delete folder",218 DeleteFolder => "Delete folder",
220- EmptyFolder => "This folder is empty.",219+ EmptyFolder => "This folder is empty. Press + to create or upload, or drop files on this page.",
221- EmptyFiles => "Nothing here yet — press + to upload, or drop files on this page.",
222 FoldersHeading => "Folders",220 FoldersHeading => "Folders",
223 FilesHeading => "Files",221 FilesHeading => "Files",
224 NameColumn => "Name",222 NameColumn => "Name",
@@ -273,10 +271,10 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
273 EnableUser => "Enable",271 EnableUser => "Enable",
274 DisabledBadge => "disabled",272 DisabledBadge => "disabled",
275 LinkCreated => "Link created.",273 LinkCreated => "Link created.",
276- CopyLinkOnce => "Copy it now — it is shown once and never again.",274+ CopyLinkOnce => "Copy it now. It is shown once and never again.",
277 ExpiresLabel => "Expires",275 ExpiresLabel => "Expires",
278 NeverExpires => "Never",276 NeverExpires => "Never",
279- ViewOnly => "View only — preview, no downloads",277+ ViewOnly => "View only: preview, no downloads",
280 NoLinks => "No share links yet.",278 NoLinks => "No share links yet.",
281 ManageLinks => "Share links",279 ManageLinks => "Share links",
282 UiLabel => "Interface",280 UiLabel => "Interface",
@@ -301,7 +299,7 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
301 SomethingWentWrong => "Bir şeyler ters gitti.",299 SomethingWentWrong => "Bir şeyler ters gitti.",
302 NothingAtThisAddress => "Bu adreste bir şey yok.",300 NothingAtThisAddress => "Bu adreste bir şey yok.",
303 BackToDrive => "Sürücüye dön",301 BackToDrive => "Sürücüye dön",
304- WelcomeTitle => "In — dosyaların",302+ WelcomeTitle => "In: dosyaların",
305 WelcomeBlurb => "Klasörlerin ve dosyaların, senin kurallarınla.",303 WelcomeBlurb => "Klasörlerin ve dosyaların, senin kurallarınla.",
306 SignIn => "Oturum aç",304 SignIn => "Oturum aç",
307 NavDrive => "Sürücü",305 NavDrive => "Sürücü",
@@ -319,8 +317,7 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
319 RenameFolder => "Klasörü yeniden adlandır",317 RenameFolder => "Klasörü yeniden adlandır",
320 MoveFolder => "Klasörü taşı",318 MoveFolder => "Klasörü taşı",
321 DeleteFolder => "Klasörü sil",319 DeleteFolder => "Klasörü sil",
322- EmptyFolder => "Bu klasör boş.",320+ EmptyFolder => "Bu klasör boş. + ile oluştur ya da yükle, ya da dosyaları bu sayfaya bırak.",
323- EmptyFiles => "Henüz bir şey yok — + ile yükle ya da dosyaları bu sayfaya bırak.",
324 FoldersHeading => "Klasörler",321 FoldersHeading => "Klasörler",
325 FilesHeading => "Dosyalar",322 FilesHeading => "Dosyalar",
326 NameColumn => "Ad",323 NameColumn => "Ad",
@@ -375,10 +372,10 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
375 EnableUser => "Etkinleştir",372 EnableUser => "Etkinleştir",
376 DisabledBadge => "devre dışı",373 DisabledBadge => "devre dışı",
377 LinkCreated => "Bağlantı oluşturuldu.",374 LinkCreated => "Bağlantı oluşturuldu.",
378- CopyLinkOnce => "Şimdi kopyala — bir kez gösterilir, bir daha gösterilmez.",375+ CopyLinkOnce => "Şimdi kopyala. Bir kez gösterilir, bir daha gösterilmez.",
379 ExpiresLabel => "Bitiş",376 ExpiresLabel => "Bitiş",
380 NeverExpires => "Süresiz",377 NeverExpires => "Süresiz",
381- ViewOnly => "Yalnızca görüntüleme — önizleme, indirme yok",378+ ViewOnly => "Yalnızca görüntüleme: önizleme, indirme yok",
382 NoLinks => "Henüz paylaşım bağlantısı yok.",379 NoLinks => "Henüz paylaşım bağlantısı yok.",
383 ManageLinks => "Paylaşım bağlantıları",380 ManageLinks => "Paylaşım bağlantıları",
384 UiLabel => "Arayüz",381 UiLabel => "Arayüz",
crates/in-web/src/server.rsmodified+4 -4
@@ -234,8 +234,8 @@ impl Refusal {
234 // the target exists.234 // the target exists.
235 Refusal::CrossOwner => "No such file or folder.".to_string(),235 Refusal::CrossOwner => "No such file or folder.".to_string(),
236 Refusal::ShareRevoked => "This link no longer works.".to_string(),236 Refusal::ShareRevoked => "This link no longer works.".to_string(),
237- Refusal::UploadExpired => "This upload expired — start it again.".to_string(),237+ Refusal::UploadExpired => "This upload expired. Start it again.".to_string(),
238- Refusal::BadChunk => "That piece arrived damaged — send it again.".to_string(),238+ Refusal::BadChunk => "That piece arrived damaged. Send it again.".to_string(),
239 Refusal::AncestorTrashed => "Restore the folder it is in first.".to_string(),239 Refusal::AncestorTrashed => "Restore the folder it is in first.".to_string(),
240 Refusal::Unavailable => "Something went wrong.".to_string(),240 Refusal::Unavailable => "Something went wrong.".to_string(),
241 Refusal::BadUi => "That interface choice is not offered.".to_string(),241 Refusal::BadUi => "That interface choice is not offered.".to_string(),
@@ -259,8 +259,8 @@ impl Refusal {
259 Refusal::FolderNotEmpty => "Bu klasörde hâlâ dosyalar var.".to_string(),259 Refusal::FolderNotEmpty => "Bu klasörde hâlâ dosyalar var.".to_string(),
260 Refusal::CrossOwner => "Böyle bir dosya ya da klasör yok.".to_string(),260 Refusal::CrossOwner => "Böyle bir dosya ya da klasör yok.".to_string(),
261 Refusal::ShareRevoked => "Bu bağlantı artık çalışmıyor.".to_string(),261 Refusal::ShareRevoked => "Bu bağlantı artık çalışmıyor.".to_string(),
262- Refusal::UploadExpired => "Bu yüklemenin süresi doldu — yeniden başlat.".to_string(),262+ Refusal::UploadExpired => "Bu yüklemenin süresi doldu. Yeniden başlat.".to_string(),
263- Refusal::BadChunk => "Bu parça bozuk geldi — yeniden gönder.".to_string(),263+ Refusal::BadChunk => "Bu parça bozuk geldi. Yeniden gönder.".to_string(),
264 Refusal::Unavailable => "Bir şeyler ters gitti.".to_string(),264 Refusal::Unavailable => "Bir şeyler ters gitti.".to_string(),
265 Refusal::AncestorTrashed => "Önce içinde olduğu klasörü geri yükle.".to_string(),265 Refusal::AncestorTrashed => "Önce içinde olduğu klasörü geri yükle.".to_string(),
266 Refusal::BadUi => "Bu arayüz seçeneği sunulmuyor.".to_string(),266 Refusal::BadUi => "Bu arayüz seçeneği sunulmuyor.".to_string(),
crates/in-web/tests/http.rsmodified+71 -14
@@ -1539,7 +1539,7 @@ async fn search_scopes_to_owner_and_hides_trashed() {
1539 }1539 }
1540 1540
1541 #[tokio::test]1541 #[tokio::test]
1542-async fn drive_search_results_replace_the_folder_panels() {1542+async fn drive_search_results_merge_into_one_panel() {
1543 let app = TestApp::build().await;1543 let app = TestApp::build().await;
1544 let cookie = app.sign_in("sub-search-in-place", "inplace@in.test", "InPlace").await;1544 let cookie = app.sign_in("sub-search-in-place", "inplace@in.test", "InPlace").await;
1545 let owner = owner_of(&app, "sub-search-in-place").await;1545 let owner = owner_of(&app, "sub-search-in-place").await;
@@ -1557,21 +1557,30 @@ async fn drive_search_results_replace_the_folder_panels() {
1557 let page = app.get("/drive?q=holiday", Some(&cookie)).await;1557 let page = app.get("/drive?q=holiday", Some(&cookie)).await;
1558 assert_eq!(page.status, StatusCode::OK, "{}", page.text());1558 assert_eq!(page.status, StatusCode::OK, "{}", page.text());
1559 let body = page.text();1559 let body = page.text();
1560- // Both hits render in place on the drive, wired to their surfaces.1560+ // Both hits render in one shared list, folders first, wired to their surfaces.
1561 assert!(body.contains("holiday photos"), "{body}");1561 assert!(body.contains("holiday photos"), "{body}");
1562 assert!(body.contains("holiday report.txt"), "{body}");1562 assert!(body.contains("holiday report.txt"), "{body}");
1563 assert!(body.contains(&format!("/drive?folder={folder}")), "{body}");1563 assert!(body.contains(&format!("/drive?folder={folder}")), "{body}");
1564 assert!(body.contains(&format!("/file/{file}")), "{body}");1564 assert!(body.contains(&format!("/file/{file}")), "{body}");
1565- // One chip per list, like the folder panels they replace.1565+ let folder_at = body.find("holiday photos").expect("no folder hit");
1566- assert_eq!(body.matches("<span class=\"chip\">1</span>").count(), 2, "{body}");1566+ let file_at = body.find("holiday report.txt").expect("no file hit");
1567+ assert!(folder_at < file_at, "file hit precedes folder hit: {body}");
1568+ // One panel, no heads or chips.
1569+ assert_eq!(body.matches("<section class=\"panel\">").count(), 1, "{body}");
1570+ assert!(!body.contains("panel-head"), "{body}");
1571+ assert!(!body.contains("class=\"chip\""), "{body}");
1572+ assert!(!body.contains(">Folders</h2>"), "{body}");
1573+ assert!(!body.contains(">Files</h2>"), "{body}");
1567 // The caption names the query and the box keeps it.1574 // The caption names the query and the box keeps it.
1568 assert!(body.contains("Search results"), "{body}");1575 assert!(body.contains("Search results"), "{body}");
1569 assert!(body.contains("holiday"), "{body}");1576 assert!(body.contains("holiday"), "{body}");
1570 assert!(body.contains("value=\"holiday\""), "{body}");1577 assert!(body.contains("value=\"holiday\""), "{body}");
1571 assert!(body.contains("name=\"q\""), "{body}");1578 assert!(body.contains("name=\"q\""), "{body}");
1572- // The folder view is gone: no crumbs, no upload, no row mutations.1579+ // The upload control stays in the DOM for the + menu and the drop handler.
1580+ assert!(body.contains("id=\"upload-form\""), "{body}");
1581+ assert!(body.contains("id=\"drive-upload-input\""), "{body}");
1582+ // The folder view is gone: no crumbs, no row mutations.
1573 assert!(!body.contains("detail-crumbs"), "{body}");1583 assert!(!body.contains("detail-crumbs"), "{body}");
1574- assert!(!body.contains("id=\"upload-form\""), "{body}");
1575 assert!(!body.contains("action=\"/api/folder/rename\""), "{body}");1584 assert!(!body.contains("action=\"/api/folder/rename\""), "{body}");
1576 }1585 }
1577 1586
@@ -2380,7 +2389,7 @@ async fn trash_panels_nest_inside_the_stage() {
2380 }2389 }
2381 2390
2382 #[tokio::test]2391 #[tokio::test]
2383-async fn drive_search_panels_nest_inside_the_stage() {2392+async fn drive_search_panel_nests_inside_the_stage() {
2384 let app = TestApp::build().await;2393 let app = TestApp::build().await;
2385 let admin = app.sign_in("sub-stage-search", "stagesearch@in.test", "StageSearch").await;2394 let admin = app.sign_in("sub-stage-search", "stagesearch@in.test", "StageSearch").await;
2386 let owner = owner_of(&app, "sub-stage-search").await;2395 let owner = owner_of(&app, "sub-stage-search").await;
@@ -2389,7 +2398,7 @@ async fn drive_search_panels_nest_inside_the_stage() {
2389 assert_eq!(page.status, StatusCode::OK, "{}", page.text());2398 assert_eq!(page.status, StatusCode::OK, "{}", page.text());
2390 assert_stage_nests(2399 assert_stage_nests(
2391 &page.text(),2400 &page.text(),
2392- &["panel-head", "name=\"q\"", "staged-report.txt"],2401+ &["panel-body", "name=\"q\"", "staged-report.txt"],
2393 );2402 );
2394 }2403 }
2395 2404
@@ -2705,16 +2714,64 @@ async fn drive_edit_row_renders_the_rename_form() {
2705 }2714 }
2706 2715
2707 #[tokio::test]2716 #[tokio::test]
2708-async fn an_empty_files_panel_says_how_to_fill_it() {2717+async fn drive_lists_folders_before_files_in_one_panel() {
2718+ let app = TestApp::build().await;
2719+ let cookie = app.sign_in("sub-merged", "merged@in.test", "Merged").await;
2720+ let owner = owner_of(&app, "sub-merged").await;
2721+ // The file's name sorts first alphabetically, so order proves folders lead.
2722+ let file_id = file_id(&app, &owner, "aaa file.txt", b"a").await;
2723+ let answer = app
2724+ .post("/api/folder/create", Some(&cookie), &[("parent_id", ""), ("name", "mmm folder")])
2725+ .await;
2726+ assert!(answer.accepted(), "setup create refused: {:?}", answer.location);
2727+
2728+ let page = app.get("/drive", Some(&cookie)).await;
2729+ assert_eq!(page.status, StatusCode::OK, "{}", page.text());
2730+ let body = page.text();
2731+ // One panel, no heads or chips — just the merged list.
2732+ assert_eq!(body.matches("<section class=\"panel\">").count(), 1, "{body}");
2733+ assert!(!body.contains("panel-head"), "{body}");
2734+ assert!(!body.contains("class=\"chip\""), "{body}");
2735+ assert!(!body.contains(">Folders</h2>"), "{body}");
2736+ assert!(!body.contains(">Files</h2>"), "{body}");
2737+ // Folders first, then files, each wired to its surface.
2738+ let folder_at = body.find("mmm folder").expect("no folder row");
2739+ let file_at = body.find("aaa file.txt").expect("no file row");
2740+ assert!(folder_at < file_at, "file row precedes folder row: {body}");
2741+ assert!(body.contains("action=\"/api/folder/move\""), "{body}");
2742+ // File rename follows the folder pattern: an edit link on the plain
2743+ // view, the form only on the edit view.
2744+ assert!(
2745+ body.contains(&format!("/drive?edit={file_id}")),
2746+ "file row has no edit entry: {body}"
2747+ );
2748+ let edit_page = app
2749+ .get(&format!("/drive?edit={file_id}"), Some(&cookie))
2750+ .await;
2751+ assert!(
2752+ edit_page.text().contains("action=\"/api/file/rename\""),
2753+ "{}",
2754+ edit_page.text()
2755+ );
2756+ // A non-empty list carries no empty state.
2757+ assert!(!body.contains("This folder is empty"), "{body}");
2758+}
2759+
2760+#[tokio::test]
2761+async fn an_empty_folder_says_how_to_fill_it() {
2709 let app = TestApp::build().await;2762 let app = TestApp::build().await;
2710 let cookie = app.sign_in("sub-empty", "empty@in.test", "Empty").await;2763 let cookie = app.sign_in("sub-empty", "empty@in.test", "Empty").await;
2711 let page = app.get("/drive", Some(&cookie)).await;2764 let page = app.get("/drive", Some(&cookie)).await;
2712 assert_eq!(page.status, StatusCode::OK, "{}", page.text());2765 assert_eq!(page.status, StatusCode::OK, "{}", page.text());
2766+ let body = page.text();
2767+ // The single empty state names both ways to fill the folder.
2713 assert!(2768 assert!(
2714- page.text().contains("Nothing here yet"),2769+ body.contains("This folder is empty. Press + to create or upload, or drop files on this page."),
2715- "no empty-state hint: {}",2770+ "no empty-state hint: {body}"
2716- page.text()
2717 );2771 );
2718- // And the drop handler the hint promises is on the page.2772+ assert_eq!(body.matches("<section class=\"panel\">").count(), 1, "{body}");
2719- assert!(page.text().contains("__inDrop"), "{}", page.text());2773+ assert!(!body.contains("panel-head"), "{body}");
2774+ // And the upload control plus the drop handler the hint promises are on the page.
2775+ assert!(body.contains("id=\"upload-form\""), "{body}");
2776+ assert!(body.contains("__inDrop"), "{body}");
2720 }2777 }
style/main.scssmodified+3 -1
@@ -1790,7 +1790,9 @@ img.avatar {
1790 overflow-y: auto;1790 overflow-y: auto;
1791 }1791 }
1792 1792
1793-.pop-row-form { display: block; }1793+// In's rows pair a dropdown with its submit (move), so the form is a row of
1794+// controls, not a block — iz's pop-rows only ever hold one.
1795+.pop-row-form { display: flex; align-items: center; gap: 8px; }
1794 1796
1795 .pop-row {1797 .pop-row {
1796 display: flex;1798 display: flex;