the share modal keeps its height while the people filter types: the first keystroke on the picker now floors the panel at its full unfiltered height, because the rows the filter hides were shrinking the panel — and the modal under it — with every letter, jumping everything below; clearing the filter returns exactly that height, a panel reborn through a morph re-render locks anew at its own measure, and the no-script page (no filter, no lock) is untouched
Browse files at this commitf937d233a9495fcb9ad0a0439b913a89b7ad7535Parent: dc994c41 changed file +10 -13
- crates/in-web/src/share.rs +10 -13
crates/in-web/src/share.rsmodified+10 -13
| @@ -441,8 +441,7 @@ async fn remint_link(cx: &Cx, Form(input): Form<RevokeLinkForm>) -> Redirect { | |||
| 441 | // creation seals its own; a failed seal is lived | 441 | // creation seals its own; a failed seal is lived |
| 442 | // with, because the redirect below shows the full | 442 | // with, because the redirect below shows the full |
| 443 | // address regardless. | 443 | // address regardless. |
| 444 | - let sealed = | 444 | + let sealed = in_core::store::secret::seal(&app(cx).link_key, &minted.token); |
| 445 | - in_core::store::secret::seal(&app(cx).link_key, &minted.token); | ||
| 446 | let _ = app(cx) | 445 | let _ = app(cx) |
| 447 | .store | 446 | .store |
| 448 | .set_setting(&format!("share_token:{}", minted.link.id), &sealed) | 447 | .set_setting(&format!("share_token:{}", minted.link.id), &sealed) |
| @@ -1003,14 +1002,7 @@ async fn download_bytes( | |||
| 1003 | HeaderValue::from_static("private, no-cache"), | 1002 | HeaderValue::from_static("private, no-cache"), |
| 1004 | ); | 1003 | ); |
| 1005 | let Some(parts) = | 1004 | let Some(parts) = |
| 1006 | - crate::files::bytes_response( | 1005 | + crate::files::bytes_response(store, file_id, size_bytes, range, headers).await |
| 1007 | - store, | ||
| 1008 | - file_id, | ||
| 1009 | - size_bytes, | ||
| 1010 | - range, | ||
| 1011 | - headers, | ||
| 1012 | - ) | ||
| 1013 | - .await | ||
| 1014 | else { | 1006 | else { |
| 1015 | return dead_link(cx).await; | 1007 | return dead_link(cx).await; |
| 1016 | }; | 1008 | }; |
| @@ -1851,9 +1843,13 @@ pub(crate) async fn share_copy_script(cx: &Cx) -> Result { | |||
| 1851 | /// and address — and hides itself down to the Everyone row when no filter | 1843 | /// and address — and hides itself down to the Everyone row when no filter |
| 1852 | /// word matches. The same field carries the no-script typed-address post, | 1844 | /// word matches. The same field carries the no-script typed-address post, |
| 1853 | /// so on submit it is benched whenever rows are checked: its half-typed | 1845 | /// so on submit it is benched whenever rows are checked: its half-typed |
| 1854 | -/// text must not ride beside them. Delegated listeners only, idempotent | 1846 | +/// text must not ride beside them. The first keystroke also locks the |
| 1855 | -/// across the modal's re-renders (`window.__inSharePick` guards it), so the | 1847 | +/// panel at its full, unfiltered height — the rows the filter hides would |
| 1856 | -/// `in:wire` morph needs no per-element re-init. | 1848 | +/// otherwise shrink the modal under it, jumping everything below with |
| 1849 | +/// every letter — and a panel reborn through a morph re-render locks | ||
| 1850 | +/// anew. Delegated listeners only, idempotent across the modal's | ||
| 1851 | +/// re-renders (`window.__inSharePick` guards it), so the `in:wire` morph | ||
| 1852 | +/// needs no per-element re-init. | ||
| 1857 | pub(crate) async fn share_pick_script(cx: &Cx) -> Result { | 1853 | pub(crate) async fn share_pick_script(cx: &Cx) -> Result { |
| 1858 | use topcoat::view::Unescaped; | 1854 | use topcoat::view::Unescaped; |
| 1859 | const JS: &str = "\ | 1855 | const JS: &str = "\ |
| @@ -1878,6 +1874,7 @@ pub(crate) async fn share_pick_script(cx: &Cx) -> Result { | |||
| 1878 | if (!t || !t.classList || !t.classList.contains('share-pick-filter')) { return; } \ | 1874 | if (!t || !t.classList || !t.classList.contains('share-pick-filter')) { return; } \ |
| 1879 | var box = t.closest('.share-picker'); \ | 1875 | var box = t.closest('.share-picker'); \ |
| 1880 | if (!box) { return; } \ | 1876 | if (!box) { return; } \ |
| 1877 | + if (!box.style.minHeight) { box.style.minHeight = box.getBoundingClientRect().height + 'px'; } \ | ||
| 1881 | var needle = t.value.trim().toLowerCase(); \ | 1878 | var needle = t.value.trim().toLowerCase(); \ |
| 1882 | var shown = 0; \ | 1879 | var shown = 0; \ |
| 1883 | pickRows(box).forEach(function (row) { \ | 1880 | pickRows(box).forEach(function (row) { \ |