forge
Explore
Log in

Don't you dare go Hollow

the share picker takes a whole crowd at once: the one-person select becomes a checkbox list with an Everyone row that checks every candidate in one click, one Share posts every checked address with the one permission chosen, and the typed-email fallback stays for the empty directory; the shared page's owner column widens to take the name it truncated (a Muhammet Özdemediroğlu no longer dies at Muhammet Özd…), the legacy-link note moves out from between the link field and its revoke button into its own full-width sentence under the row, every dropdown lands on the iz house style (chevron scoping, status-trigger padding, panel and menu radii and insets, viewport-capped panel width, the >7-option search rule) — and the enhancement itself no longer dies on the first select whose form has no submit button: the missing var declaration aborted the whole sweep, which is why theme, language and the kind filters were still showing the browser's own popup

Browse files at this commit

e23224b124de7a22b69240a145fa95458be80191Ahmet Kaan GümüşParent: f5e4675
crates/in-web/src/drive.rsmodified+2 -2
@@ -598,7 +598,7 @@ async fn drive(cx: &Cx) -> Result {
598598 }
599599 <form class="field-box field-box-search" method="get" action="/drive">
600600 <input
601- class="dd-search"
601+ class="filter-search"
602602 type="search"
603603 name="q"
604604 value=(box_text.clone())
@@ -614,7 +614,7 @@ async fn drive(cx: &Cx) -> Result {
614614 }
615615 </form>
616616 <form class="field-box field-box-sort" method="get" action="/drive">
617- <select class="status-select" name="sort" data-autosubmit="" data-nosearch="" aria-label=(t(language, Key::Sort))>
617+ <select class="status-select" name="sort" data-autosubmit="" aria-label=(t(language, Key::Sort))>
618618 <option value="name:asc" selected=(sort_value == "name:asc")>(t(language, Key::SortNameAZ))</option>
619619 <option value="name:desc" selected=(sort_value == "name:desc")>(t(language, Key::SortNameZA))</option>
620620 <option value="uploaded:desc" selected=(sort_value == "uploaded:desc")>(t(language, Key::SortNewest))</option>
crates/in-web/src/dropdown.rsmodified+12 -2
@@ -62,6 +62,10 @@ use topcoat::view::{Unescaped, view};
6262 /// with `?task=` registered it first and the modal chain won, closing
6363 /// the whole modal over an open dropdown — the registry pins the correct
6464 /// order; the whole table lives in `layout.rs`'s `escape_manager_script`).
65+/// A panel's rows are `white-space: nowrap`, so a long option never wraps —
66+/// `place` caps the open panel's width at `innerWidth − 8`, shaving off the
67+/// padding and borders a `max-width` does not cover, or its right edge would
68+/// clip on a 320px phone no matter where the left clamp puts it.
6569 pub async fn dropdown_script(cx: &Cx) -> Result {
6670 const JS: &str = "\
6771 (function () {\
@@ -76,6 +80,11 @@ pub async fn dropdown_script(cx: &Cx) -> Result {
7680 }\
7781 function place(panel, trigger) {\
7882 var r = trigger.getBoundingClientRect();\
83+ var maxW = window.innerWidth - 8;\
84+ panel.style.maxWidth = '';\
85+ if (panel.offsetWidth > maxW) { panel.style.maxWidth = maxW + 'px'; }\
86+ var over = panel.offsetWidth - maxW;\
87+ if (over > 0) { panel.style.maxWidth = (maxW - over) + 'px'; }\
7988 var h = panel.offsetHeight;\
8089 var w = panel.offsetWidth;\
8190 var top = r.bottom + 4;\
@@ -84,7 +93,7 @@ pub async fn dropdown_script(cx: &Cx) -> Result {
8493 var left = Math.max(4, Math.min(r.left, window.innerWidth - w - 4));\
8594 panel.style.left = left + 'px';\
8695 panel.style.top = top + 'px';\
87- panel.style.minWidth = r.width + 'px';\
96+ panel.style.minWidth = Math.min(r.width, maxW) + 'px';\
8897 }\
8998 function visibleRows(panel) { return Array.prototype.slice.call(panel.querySelectorAll('.dd-option:not(.dd-option-hidden)')); }\
9099 function activate(panel, row) {\
@@ -192,6 +201,7 @@ pub async fn dropdown_script(cx: &Cx) -> Result {
192201 A select without autosubmit still needs its button — hiding \
193202 it then strands the form with no way to post at all. */ \
194203 var sibs = select.parentNode.children; \
204+ var go = null; \
195205 for (var si = 0; si < sibs.length; si++) { \
196206 if (sibs[si].tagName === 'BUTTON' && sibs[si].type === 'submit' && !sibs[si].classList.contains('dd-trigger')) { go = sibs[si]; break; } \
197207 } \
@@ -206,7 +216,7 @@ pub async fn dropdown_script(cx: &Cx) -> Result {
206216 select.__ddPanel = panel;\
207217 var allOpts = opts(select);\
208218 var search = null;\
209- if ((allOpts.length > 7 && !select.hasAttribute('data-nosearch')) || select.hasAttribute('data-search')) {\
219+ if (allOpts.length > 7 || select.hasAttribute('data-search')) {\
210220 search = document.createElement('input');\
211221 search.type = 'text';\
212222 search.className = 'dd-search';\
crates/in-web/src/i18n.rsmodified+3 -0
@@ -147,6 +147,7 @@ pub enum Key {
147147 ShareWithUser,
148148 SharePlaceholder,
149149 SharePickPerson,
150+ ShareEveryone,
150151 CanDownload,
151152 RemoveAccess,
152153 NoSharedItems,
@@ -317,6 +318,7 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
317318 ShareWithUser => "Share with someone",
318319 SharePlaceholder => "Name or address",
319320 SharePickPerson => "Pick a person",
321+ ShareEveryone => "Everyone",
320322 CanDownload => "May download",
321323 RemoveAccess => "Remove access",
322324 NoSharedItems => "Nothing is shared with you yet.",
@@ -477,6 +479,7 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
477479 ShareWithUser => "Biriyle paylaş",
478480 SharePlaceholder => "Ad ya da adres",
479481 SharePickPerson => "Birini seç",
482+ ShareEveryone => "Herkes",
480483 CanDownload => "İndirebilir",
481484 RemoveAccess => "Erişimi kaldır",
482485 NoSharedItems => "Seninle henüz bir şey paylaşılmadı.",
crates/in-web/src/settings.rsmodified+3 -1
@@ -481,9 +481,11 @@ async fn settings(cx: &Cx) -> Result {
481481 <button class="quiet share-copy" type="button" data-copied-label=(t(language, Key::Copied))>(t(language, Key::CopyLink))</button>
482482 } else {
483483 <input class="field-input share-link-url" readonly="" value=(format!("{origin}/s/…")) aria-label=(t(language, Key::ShareLink))>
484- <p class="field-note">(t(language, Key::LegacyLinkNote))</p>
485484 }
486485 </div>
486+ if url.is_none() {
487+ <p class="share-link-note">(t(language, Key::LegacyLinkNote))</p>
488+ }
487489 }
488490 </div>
489491 </section>
crates/in-web/src/share.rsmodified+130 -39
@@ -22,7 +22,8 @@
2222
2323 use in_core::store::{File, ShareKind, Store, StoreError, ThumbState, User};
2424 use in_core::{hash_link_password, hash_share_token, link_password_matches, link_unlock_proof};
25-use serde::Deserialize;
25+use serde::de::{IgnoredAny, MapAccess, Visitor};
26+use serde::{Deserialize, Deserializer};
2627 use time::OffsetDateTime;
2728 use topcoat::Result;
2829 use topcoat::context::Cx;
@@ -393,18 +394,62 @@ async fn under_target(store: &dyn Store, owner_id: &str, target_id: &str, at: &s
393394 }
394395 }
395396 }
396-#[derive(Deserialize)]
397+/// The share form. The picker posts one `email` field per person, and
398+/// serde_urlencoded hands a map visitor one pair at a time — a `Vec` field
399+/// cannot see the repeats — so the impl below collects them itself. The
400+/// typed-address fallback posts a single `email`, which lands the same way.
397401 struct ShareUserForm {
398402 kind: String,
399403 target_id: String,
400- #[serde(default)]
401- email: String,
402- #[serde(default)]
404+ email: Vec<String>,
403405 can_download: Option<String>,
404406 }
405407
406-/// Shares one file or folder with one named person. The address is folded to
407-/// lowercase before lookup; an unknown address is not-found.
408+impl<'de> Deserialize<'de> for ShareUserForm {
409+ fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
410+ where
411+ D: Deserializer<'de>,
412+ {
413+ struct FormVisitor;
414+ impl<'de> Visitor<'de> for FormVisitor {
415+ type Value = ShareUserForm;
416+
417+ fn expecting(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
418+ f.write_str("the share form")
419+ }
420+
421+ fn visit_map<A: MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
422+ let mut form = ShareUserForm {
423+ kind: String::new(),
424+ target_id: String::new(),
425+ email: Vec::new(),
426+ can_download: None,
427+ };
428+ while let Some(key) = map.next_key::<String>()? {
429+ match key.as_str() {
430+ "kind" => form.kind = map.next_value()?,
431+ "target_id" => form.target_id = map.next_value()?,
432+ // The repeats are the point: every checked row is
433+ // one pair, collected in post order.
434+ "email" => form.email.push(map.next_value()?),
435+ // Absent means the checkbox came unchecked.
436+ "can_download" => form.can_download = map.next_value()?,
437+ _ => {
438+ let _: IgnoredAny = map.next_value()?;
439+ }
440+ }
441+ }
442+ Ok(form)
443+ }
444+ }
445+ deserializer.deserialize_map(FormVisitor)
446+ }
447+}
448+
449+/// Shares one file or folder with the people the form names: one `email`
450+/// field per person, so the picker's multi-select posts them all in one
451+/// submit. Each address is folded to lowercase before lookup; an unknown
452+/// address is not-found.
408453 #[route(POST "/api/share/user/add")]
409454 async fn add_share(cx: &Cx, Form(input): Form<ShareUserForm>) -> Redirect {
410455 let user = match require_user(cx).await {
@@ -419,28 +464,31 @@ async fn add_share(cx: &Cx, Form(input): Form<ShareUserForm>) -> Redirect {
419464 return redirect_back(cx, "/settings", "add", Some(refusal));
420465 }
421466 let store = app(cx).store;
422- let grantee = store
423- .user_by_email(&input.email.trim().to_lowercase())
424- .await
425- .map_err(|_| Refusal::Unavailable);
426- let Ok(Some(grantee)) = grantee else {
467+ // Absent means the checkbox came unchecked: view-only, like the
468+ // sibling link creator above. One setting covers the whole submit.
469+ let can_download = parse_flag(input.can_download.as_deref(), false);
470+ // Nothing checked resolves to nobody, like a typed empty address.
471+ if input.email.is_empty() {
427472 return redirect_back(cx, "/settings", "add", Some(Refusal::NotFound));
428- };
429- match store
430- .add_share_user(
431- &user.id,
432- kind,
433- &input.target_id,
434- &grantee.id,
435- // Absent means the checkbox came unchecked: view-only, like the
436- // sibling link creator above.
437- parse_flag(input.can_download.as_deref(), false),
438- )
439- .await
440- {
441- Ok(()) => redirect_back(cx, "/settings", "add", None),
442- Err(error) => redirect_back(cx, "/settings", "add", Some(refusal_of(error))),
443473 }
474+ for email in &input.email {
475+ let grantee = store
476+ .user_by_email(&email.trim().to_lowercase())
477+ .await
478+ .map_err(|_| Refusal::Unavailable);
479+ let Ok(Some(grantee)) = grantee else {
480+ return redirect_back(cx, "/settings", "add", Some(Refusal::NotFound));
481+ };
482+ // Re-sharing updates the same row — the store upserts — so a name
483+ // the list already carries cannot refuse here.
484+ if let Err(error) = store
485+ .add_share_user(&user.id, kind, &input.target_id, &grantee.id, can_download)
486+ .await
487+ {
488+ return redirect_back(cx, "/settings", "add", Some(refusal_of(error)));
489+ }
490+ }
491+ redirect_back(cx, "/settings", "add", None)
444492 }
445493
446494 /// Unshares. Removing what was never shared is not an error; only the
@@ -460,8 +508,10 @@ async fn remove_share(cx: &Cx, Form(input): Form<ShareUserForm>) -> Redirect {
460508 return redirect_back(cx, "/settings", "remove", Some(refusal));
461509 }
462510 let store = app(cx).store;
511+ // The remove form posts exactly one address.
512+ let email = input.email.first().map(String::as_str).unwrap_or("");
463513 let grantee = store
464- .user_by_email(&input.email.trim().to_lowercase())
514+ .user_by_email(&email.trim().to_lowercase())
465515 .await
466516 .map_err(|_| Refusal::Unavailable);
467517 let Ok(Some(grantee)) = grantee else {
@@ -1302,7 +1352,7 @@ async fn shared(cx: &Cx) -> Result {
13021352 <form class="field-box field-box-search" method="get" action="/shared">
13031353 <span class="field-text">(t(language, Key::NavSearch))</span>
13041354 <input
1305- class="dd-search"
1355+ class="filter-search"
13061356 type="search"
13071357 name="q"
13081358 value=(box_text.clone())
@@ -1314,7 +1364,7 @@ async fn shared(cx: &Cx) -> Result {
13141364 </form>
13151365 <form class="field-box field-box-sort" method="get" action="/shared">
13161366 <span class="field-text">(t(language, Key::Sort))</span>
1317- <select class="status-select" name="sort" data-autosubmit="" data-nosearch="" aria-label=(t(language, Key::Sort))>
1367+ <select class="status-select" name="sort" data-autosubmit="" aria-label=(t(language, Key::Sort))>
13181368 <option value="name:asc" selected=(sort_value == "name:asc")>(t(language, Key::SortNameAZ))</option>
13191369 <option value="name:desc" selected=(sort_value == "name:desc")>(t(language, Key::SortNameZA))</option>
13201370 <option value="uploaded:desc" selected=(sort_value == "uploaded:desc")>(t(language, Key::SortNewest))</option>
@@ -1338,7 +1388,7 @@ async fn shared(cx: &Cx) -> Result {
13381388 <input type="hidden" name="q" value=(box_text.clone())>
13391389 </form>
13401390 </div>
1341- <section class="panel drive-panel">
1391+ <section class="panel drive-panel drive-owner">
13421392 if rows.is_empty() {
13431393 <div class="drive-empty">
13441394 <span class="drive-empty-glyph" aria-hidden="true">"▤"</span>
@@ -1526,14 +1576,23 @@ pub(crate) async fn share_modal(
15261576 if candidates.is_empty() {
15271577 <input class="field-input share-add-email" type="email" name="email" required="" placeholder=(t(language, Key::SharePlaceholder)) aria-label=(t(language, Key::EmailAddress))>
15281578 } else {
1529- <select class="field-input share-add-email" name="email" required="" aria-label=(t(language, Key::SharePickPerson))>
1530- <option value="" disabled="" selected="">(t(language, Key::SharePickPerson))</option>
1531- for person in &candidates {
1532- <option value=(person.email.clone())>(format!("{} — {}", person.display_name.clone(), person.email.clone()))</option>
1533- }
1534- </select>
1579+ <div class="share-picker pop-panel" role="group" aria-label=(t(language, Key::SharePickPerson))>
1580+ <label class="pop-row share-pick-all">
1581+ <input type="checkbox" class="share-all-toggle" aria-label=(t(language, Key::ShareEveryone))>
1582+ <span class="pop-row-name">(t(language, Key::ShareEveryone))</span>
1583+ </label>
1584+ <div class="pop-list pop-list-scroll">
1585+ for person in &candidates {
1586+ <label class="pop-row">
1587+ <input type="checkbox" name="email" value=(person.email.clone())>
1588+ <span class="pop-row-name">(person.display_name.clone())</span>
1589+ <span class="share-pick-mail">(person.email.clone())</span>
1590+ </label>
1591+ }
1592+ </div>
1593+ </div>
15351594 }
1536- <select class="field-input" name="can_download" aria-label=(t(language, Key::CanDownload))>
1595+ <select class="field-input share-add-access" name="can_download" aria-label=(t(language, Key::CanDownload))>
15371596 <option value="1">(t(language, Key::CanDownload))</option>
15381597 <option value="0">(t(language, Key::ViewOnly))</option>
15391598 </select>
@@ -1581,6 +1640,7 @@ pub(crate) async fn share_modal(
15811640 // away. A link from before the sealing — or one whose key is gone —
15821641 // keeps the masked value and carries the carry-forward note.
15831642 let url = share_link_url(cx, *link).await;
1643+ let legacy = url.is_none();
15841644 <div class="member-row">
15851645 <span class="member-name">(t(language, Key::AnyoneWithLink))</span>
15861646 <div class="spacer"></div>
@@ -1596,17 +1656,20 @@ pub(crate) async fn share_modal(
15961656 <button class="quiet share-copy" type="button" data-copied-label=(t(language, Key::Copied))>(t(language, Key::CopyLink))</button>
15971657 } else {
15981658 <input class="field-input share-link-url" readonly="" value=(format!("{origin}/s/…")) aria-label=(t(language, Key::ShareLink))>
1599- <p class="field-note">(t(language, Key::LegacyLinkNote))</p>
16001659 }
16011660 <form class="pop-row-form" method="post" action="/api/share/link/revoke">
16021661 <input type="hidden" name="id" value=(link.id.clone())>
16031662 <button class="quiet quiet-danger" type="submit">(t(language, Key::RevokeLink))</button>
16041663 </form>
16051664 </div>
1665+ if legacy {
1666+ <p class="share-link-note">(t(language, Key::LegacyLinkNote))</p>
1667+ }
16061668 }
16071669 </div>
16081670 </div>
16091671 (share_copy_script(cx).await?)
1672+ (share_pick_script(cx).await?)
16101673 }?))
16111674 }
16121675
@@ -1632,6 +1695,34 @@ pub(crate) async fn share_copy_script(cx: &Cx) -> Result {
16321695 view! { cx => <script>(Unescaped::new_unchecked(JS))</script> }
16331696 }
16341697
1698+/// The people picker's client half: the All row checks and unchecks every
1699+/// candidate, and hand-checking rows keeps the All row honest. One delegated
1700+/// listener, idempotent across the modal's re-renders (`window.__inSharePick`
1701+/// guards it), so the `in:wire` morph needs no per-element re-init.
1702+pub(crate) async fn share_pick_script(cx: &Cx) -> Result {
1703+ use topcoat::view::Unescaped;
1704+ const JS: &str = "\
1705+ (function () { \
1706+ if (window.__inSharePick) { return; } \
1707+ window.__inSharePick = true; \
1708+ function rows(box) { return Array.prototype.slice.call(box.querySelectorAll('.pop-list input[type=checkbox]')); } \
1709+ document.addEventListener('change', function (e) { \
1710+ var t = e.target; \
1711+ if (!t || !t.closest) { return; } \
1712+ var box = t.closest('.share-picker'); \
1713+ if (!box) { return; } \
1714+ if (t.classList.contains('share-all-toggle')) { \
1715+ rows(box).forEach(function (cb) { cb.checked = t.checked; }); \
1716+ } else { \
1717+ var all = box.querySelector('.share-all-toggle'); \
1718+ var list = rows(box); \
1719+ if (all) { all.checked = list.length > 0 && list.every(function (cb) { return cb.checked; }); } \
1720+ } \
1721+ }); \
1722+ })();";
1723+ view! { cx => <script>(Unescaped::new_unchecked(JS))</script> }
1724+}
1725+
16351726 /// When the link stops opening, or never on its own. Twins the settings
16361727 /// page's helper; the share page renders the same expiry line.
16371728 fn expiry_line(language: Lang, expires_at: Option<OffsetDateTime>) -> String {
crates/in-web/src/trash.rsmodified+2 -2
@@ -312,7 +312,7 @@ async fn trash(cx: &Cx) -> Result {
312312 <form class="field-box field-box-search" method="get" action="/trash">
313313 <span class="field-text">(t(language, Key::NavSearch))</span>
314314 <input
315- class="dd-search"
315+ class="filter-search"
316316 type="search"
317317 name="q"
318318 value=(box_text.clone())
@@ -324,7 +324,7 @@ async fn trash(cx: &Cx) -> Result {
324324 </form>
325325 <form class="field-box field-box-sort" method="get" action="/trash">
326326 <span class="field-text">(t(language, Key::Sort))</span>
327- <select class="status-select" name="sort" data-autosubmit="" data-nosearch="" aria-label=(t(language, Key::Sort))>
327+ <select class="status-select" name="sort" data-autosubmit="" aria-label=(t(language, Key::Sort))>
328328 <option value="deleted:desc" selected=(sort_value == "deleted:desc")>(t(language, Key::SortNewest))</option>
329329 <option value="deleted:asc" selected=(sort_value == "deleted:asc")>(t(language, Key::SortOldest))</option>
330330 <option value="name:asc" selected=(sort_value == "name:asc")>(t(language, Key::SortNameAZ))</option>
crates/in-web/tests/http.rsmodified+78 -10
@@ -1996,7 +1996,7 @@ async fn share_modal_offers_the_im_directory() {
19961996 // The owner as im knows her: never offered to share with herself.
19971997 serde_json::json!({"sub": "sub-admin", "email": "ada@in.test", "name": "Ada", "admin": true}),
19981998 // Valid in im but disabled here: sharing with her is sharing with
1999- // nobody, so the dropdown never offers her.
1999+ // nobody, so the picker never offers her.
20002000 serde_json::json!({"sub": "sub-gonca", "email": "gonca@in.test", "name": "Gonca", "admin": false}),
20012001 ]);
20022002 let admin = app.sign_in("sub-admin", "ada@in.test", "Ada").await;
@@ -2017,22 +2017,31 @@ async fn share_modal_offers_the_im_directory() {
20172017 assert_eq!(page.status, StatusCode::OK, "{}", page.text());
20182018 let text = page.text();
20192019 assert!(
2020- text.contains("<select class=\"field-input share-add-email\" name=\"email\""),
2021- "modal kept the typed address: {text}"
2020+ text.contains("<div class=\"share-picker pop-panel\""),
2021+ "picker panel missing: {text}"
20222022 );
20232023 assert!(
2024- text.contains("Pick a person"),
2025- "no placeholder option: {text}"
2024+ text.contains("aria-label=\"Pick a person\""),
2025+ "no picker group label: {text}"
2026+ );
2027+ assert!(
2028+ text.contains("type=\"checkbox\" name=\"email\" value=\"ember@in.test\""),
2029+ "Ember not offered as a checkable row: {text}"
2030+ );
2031+ assert!(
2032+ text.contains("type=\"checkbox\" name=\"email\" value=\"bora@in.test\""),
2033+ "Bora not offered as a checkable row: {text}"
20262034 );
2027- assert!(text.contains("Ember — ember@in.test"), "{}", text);
2028- assert!(text.contains("Bora — bora@in.test"), "{}", text);
20292035 assert!(
20302036 text.find("Bora").unwrap() < text.find("Ember").unwrap(),
20312037 "directory not offered by name: {text}"
20322038 );
2033- assert!(!text.contains("Ada — ada@in.test"), "owner offered: {text}");
20342039 assert!(
2035- !text.contains("Gonca — gonca@in.test"),
2040+ !text.contains("value=\"ada@in.test\""),
2041+ "owner offered: {text}"
2042+ );
2043+ assert!(
2044+ !text.contains("value=\"gonca@in.test\""),
20362045 "disabled account offered: {text}"
20372046 );
20382047
@@ -2056,6 +2065,62 @@ async fn share_modal_offers_the_im_directory() {
20562065 assert!(page.text().contains("Ember"), "{}", page.text());
20572066 }
20582067
2068+/// One submit, several people: the picker posts one `email` field per
2069+/// checked row, and every address lands under Who has access carrying the
2070+/// one `can_download` the submit chose.
2071+#[tokio::test]
2072+async fn share_modal_grants_every_posted_address() {
2073+ let app = TestApp::build().await;
2074+ app.fake.set_directory(&[
2075+ serde_json::json!({"sub": "sub-ember", "email": "ember@in.test", "name": "Ember", "admin": false}),
2076+ serde_json::json!({"sub": "sub-bora", "email": "bora@in.test", "name": "Bora", "admin": false}),
2077+ ]);
2078+ let admin = app.sign_in("sub-admin", "ada@in.test", "Ada").await;
2079+ let owner = owner_of(&app, "sub-admin").await;
2080+ let file = file_id(&app, &owner, "crowd.txt", b"crowd").await;
2081+
2082+ // The picker exists only on a rendered modal, and the render is what
2083+ // provisions im's directory into the store; the post below is the
2084+ // picker's own submit, so it opens the modal first.
2085+ let page = app
2086+ .get(&format!("/drive?share=file:{file}"), Some(&admin))
2087+ .await;
2088+ assert_eq!(page.status, StatusCode::OK, "{}", page.text());
2089+
2090+ let answer = app
2091+ .post(
2092+ "/api/share/user/add",
2093+ Some(&admin),
2094+ &[
2095+ ("kind", "file"),
2096+ ("target_id", &file),
2097+ ("email", "ember@in.test"),
2098+ ("email", "bora@in.test"),
2099+ ("can_download", "0"),
2100+ ],
2101+ )
2102+ .await;
2103+ assert!(answer.accepted(), "add refused: {:?}", answer.location);
2104+
2105+ let grants = app
2106+ .store
2107+ .shares_for_target(&owner, ShareKind::File, &file)
2108+ .await
2109+ .unwrap();
2110+ assert_eq!(grants.len(), 2, "not every posted address granted");
2111+ assert!(
2112+ grants.iter().all(|grant| !grant.can_download),
2113+ "view-only not applied to every grant"
2114+ );
2115+
2116+ let page = app
2117+ .get(&format!("/drive?share=file:{file}"), Some(&admin))
2118+ .await;
2119+ let text = page.text();
2120+ assert!(text.contains("Ember"), "{}", text);
2121+ assert!(text.contains("Bora"), "{}", text);
2122+}
2123+
20592124 /// A directory that does not answer — im without the route, the way an
20602125 /// unregistered or unreachable im behaves — leaves the modal exactly as
20612126 /// it was: the typed address.
@@ -2745,7 +2810,10 @@ async fn the_family_flyout_holds_the_siblings_when_the_family_is_mirrored() {
27452810 let nav = &body[nav_start..nav_start + nav_end];
27462811 // Only the siblings hang in the flyout — this app's own row is the mark
27472812 // the flyout hangs from, not an entry in it.
2748- assert!(!nav.contains("href=\"https://files.example.com/\""), "{nav}");
2813+ assert!(
2814+ !nav.contains("href=\"https://files.example.com/\""),
2815+ "{nav}"
2816+ );
27492817 assert!(nav.contains("href=\"https://id.example.com/\""), "{nav}");
27502818 assert!(nav.contains("href=\"https://board.example.com/\""), "{nav}");
27512819 assert!(nav.contains("title=\"Account\""), "{nav}");
style/main.scssmodified+105 -25
@@ -714,10 +714,10 @@ a {
714714 right: 0;
715715 z-index: 30;
716716 width: 220px;
717- padding: 8px 0;
717+ padding: 8px;
718718 background: var(--surface);
719719 border: 1px solid var(--border-strong);
720- border-radius: var(--radius-lg);
720+ border-radius: var(--radius-md);
721721 box-shadow: var(--shadow-2);
722722 visibility: hidden;
723723 opacity: 0;
@@ -734,20 +734,20 @@ a {
734734 .user-menu.user-menu-esc .user-menu-panel { visibility: hidden; opacity: 0; pointer-events: none; }
735735
736736 .user-menu-name {
737- padding: 4px 14px 0;
737+ padding: 4px 10px 0;
738738 font-size: 13px;
739739 font-weight: 600;
740740 }
741741
742742 .user-menu-email {
743- padding: 2px 14px 0;
743+ padding: 2px 10px 0;
744744 font-size: 12px;
745745 color: var(--muted);
746746 word-break: break-all;
747747 }
748748
749749 .user-menu-role {
750- padding: 2px 14px 6px;
750+ padding: 2px 10px 6px;
751751 font-size: 12px;
752752 color: var(--muted-soft);
753753 text-transform: capitalize;
@@ -758,7 +758,8 @@ a {
758758 align-items: center;
759759 width: 100%;
760760 height: 32px;
761- padding: 0 14px;
761+ padding: 0 10px;
762+ border-radius: var(--radius-sm);
762763 border: none;
763764 background: none;
764765 font-family: inherit;
@@ -2269,25 +2270,24 @@ img.avatar {
22692270 }
22702271
22712272 // The board's search field is the bar's third field-box, and its typing
2272-// area is the house's own type-as-filter input: the rules `.dd-search`
2273-// wears inside dropdown panels, freed of the panel-only block geometry and
2274-// filling the box past its label.
2273+// area speaks the panel type-to-filter's voice — borderless type on the
2274+// box — under its own class, so the panel's `.dd-search` block geometry
2275+// and its :focus-visible underline swap stay inside dropdown panels and
2276+// the shared focus ring reaches the typing area.
22752277 .field-box-search {
22762278 flex: 0 1 240px;
22772279 min-width: 0;
22782280
22792281 .field-text { flex: none; }
22802282
2281- .dd-search {
2283+ .filter-search {
22822284 flex: 1;
22832285 min-width: 0;
2284- width: auto;
2285- height: auto;
2286- margin-bottom: 0;
2287- padding: 0;
2288- // The panel hairline the base rule draws under the typing area reads as
2289- // a stray underline inside the bordered box; the box is the frame.
2290- border-bottom: none;
2286+ border: none;
2287+ background: none;
2288+ font: inherit;
2289+ font-size: 13px;
2290+ color: var(--ink);
22912291 }
22922292 }
22932293
@@ -3350,9 +3350,10 @@ img.avatar {
33503350
33513351 // The house dropdown trigger — `dropdown.rs`'s <button> clone of a select —
33523352 // draws the same chevron the rest of the app uses, so the closed look stands
3353-// in for the field it replaced. A native select keeps the browser's own
3354-// arrow on the plain .field-input box.
3355-.dd-trigger {
3353+// in for the field it replaced. Scoped to the field-input trigger, as the
3354+// reference app has it: a status-select trigger stays bare — its box is the
3355+// chrome, and no chevron rides it.
3356+.field-input.dd-trigger {
33563357 appearance: none;
33573358 -webkit-appearance: none;
33583359 cursor: pointer;
@@ -3365,7 +3366,7 @@ img.avatar {
33653366 // Dark theme's lighter muted ink, baked into a second copy of the chevron:
33663367 // a data-URI can't read custom properties.
33673368 [data-theme="dark"] {
3368- .dd-trigger {
3369+ .field-input.dd-trigger {
33693370 background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16' fill='none' stroke='%238b949e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
33703371 }
33713372 }
@@ -3403,7 +3404,7 @@ input[type="radio"] {
34033404 // The trigger carries the select's own classes (`.status-select` or
34043405 // `.field-input`), so its closed look is already right; this only resets
34053406 // what a bare `<button>` adds on top of that.
3406-.status-select.dd-trigger { padding: 0 24px 0 0; background-position: right 4px center; }
3407+.status-select.dd-trigger { padding: 0; }
34073408 .dd-trigger {
34083409 display: flex;
34093410 align-items: center;
@@ -5025,11 +5026,11 @@ div.member-row + div.member-row {
50255026 .entry-options .user-menu-panel .quiet {
50265027 border: none;
50275028 background: none;
5028- border-radius: 0;
5029+ border-radius: var(--radius-sm);
50295030 width: 100%;
50305031 height: 32px;
50315032 justify-content: flex-start;
5032- padding: 0 14px;
5033+ padding: 0 10px;
50335034 font-size: 13px;
50345035 color: var(--ink-soft);
50355036
@@ -5105,6 +5106,63 @@ div.member-row + div.member-row {
51055106 margin: 0 0 16px;
51065107
51075108 .share-add-email { flex: 1; min-width: 0; }
5109+ .share-picker { flex: 1 1 100%; }
5110+ .share-add-access { margin-left: auto; }
5111+}
5112+// The multi-select people list: an All row up top, then one checkable row
5113+// per candidate — the iz pop-panel family, token-painted so every skin
5114+// carries it without its own rules.
5115+.pop-panel {
5116+ padding: 8px;
5117+ background: var(--surface);
5118+ border: 1px solid var(--border-strong);
5119+ border-radius: var(--radius-md);
5120+ box-shadow: var(--shadow-2);
5121+}
5122+.pop-list {
5123+ display: flex;
5124+ flex-direction: column;
5125+ gap: 2px;
5126+}
5127+.pop-list-scroll { max-height: 220px; overflow-y: auto; }
5128+.pop-row {
5129+ display: flex;
5130+ align-items: center;
5131+ gap: 8px;
5132+ width: 100%;
5133+ padding: 4px 6px;
5134+ border: none;
5135+ border-radius: var(--radius-sm);
5136+ background: transparent;
5137+ font: inherit;
5138+ font-size: 13px;
5139+ color: var(--ink);
5140+ text-align: left;
5141+ cursor: pointer;
5142+ transition: background-color var(--dur-fast) var(--ease);
5143+
5144+ &:hover { background: var(--row-hover); }
5145+
5146+ input[type="checkbox"] { margin: 0; accent-color: var(--accent); }
5147+}
5148+.pop-row-name { font-size: 12px; }
5149+// The All master row: kept apart from the scrolling candidates by a
5150+// hairline, so it stays visible however long the list grows.
5151+.share-pick-all {
5152+ border-bottom: 1px solid var(--border);
5153+ padding-bottom: 6px;
5154+ margin-bottom: 2px;
5155+}
5156+// The candidate's address: pinned right, muted, ellipsized like the iz
5157+// chip names.
5158+.share-pick-mail {
5159+ min-width: 0;
5160+ margin-left: auto;
5161+ overflow: hidden;
5162+ white-space: nowrap;
5163+ text-overflow: ellipsis;
5164+ font-size: 12px;
5165+ color: var(--muted);
51085166 }
51095167 .share-link-row {
51105168 display: flex;
@@ -5115,6 +5173,16 @@ div.member-row + div.member-row {
51155173 .share-link-url { flex: 1; min-width: 0; color: var(--muted); }
51165174 .pop-row-form { flex: none; }
51175175 }
5176+
5177+// The legacy-link carry-forward note: its own full-width row under the link
5178+// row — never a squeezed flex child between the address and the revoke
5179+// button. Family note voice: plain muted text, no fill, both render sites.
5180+.share-link-note {
5181+ margin: 0;
5182+ font-size: 13px;
5183+ line-height: 1.5;
5184+ color: var(--muted);
5185+}
51185186 // A section label inside the modal: muted, small, with air above.
51195187 .share-section {
51205188 margin: 14px 0 6px;
@@ -5182,6 +5250,16 @@ div.member-row + div.member-row {
51825250 align-items: center;
51835251 }
51845252
5253+// The shared page's last column carries the grant's owner and access chip —
5254+// words, not the download count the drive counts in the same track. The
5255+// modifier is /shared-only: the track grows with the viewport so a real
5256+// name ellipsizes only under real pressure, and the drive page keeps its
5257+// fixed 88px.
5258+.drive-owner .drive-cols,
5259+.drive-owner .drive-open {
5260+ grid-template-columns: 40px minmax(0, 1fr) 76px 110px minmax(150px, 1fr);
5261+}
5262+
51855263 .drive-head .drive-cols > span {
51865264 min-width: 0;
51875265 overflow: hidden;
@@ -5319,7 +5397,9 @@ div.member-row + div.member-row {
53195397 // fold away instead of crushing the name.
53205398 @media (max-width: 620px) {
53215399 .drive-cols,
5322- .drive-open {
5400+ .drive-open,
5401+ .drive-owner .drive-cols,
5402+ .drive-owner .drive-open {
53235403 grid-template-columns: 40px minmax(0, 1fr) 72px;
53245404 }
53255405