From e11412502c817c43e060de080983cfc79f34b5c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Sun, 6 Sep 2026 00:15:54 +0300 Subject: [PATCH] feat(ui): house media player, working viewer Download, Everyone panel redesign MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The viewer's media now plays through the house player — play/pause toggle, mono clock, accent seek bar, fullscreen on video — over controls-less elements; native controls are browser chrome that ignores the theme, and on the video page they were cut at the fold while the picture overflowed its stage. The stage's duplicate rules merge into one card; the dead viewer-audio wrap goes with them. The viewer's Download link carried no download attribute, so the soft-nav handler fetched the bytes and swapped them into the page as text. The link wears the attribute now, and the handler skips every /file/ byte route so the class cannot recur. The admin register's Set and Save buttons were display:none: the dropdown enhancement hid a form's submit on the assumption every enhanced select autosubmits, and the quota and upload-limit unit selects do not — quotas could not be saved from the page at all. The enhancement now bows the submit out only for autosubmit selects. The register gains a Storage quota column with the compact amount+unit+Set form on the row line, Disable sits at the row's end, and the instance upload limit becomes a labeled row under the table instead of a floating strip. --- crates/in-web/src/dropdown.rs | 11 ++- crates/in-web/src/files.rs | 108 ++++++++++++++++++++++++++--- crates/in-web/src/i18n.rs | 13 ++-- crates/in-web/src/layout.rs | 4 +- crates/in-web/src/settings.rs | 29 +++++--- style/main.scss | 127 +++++++++++++++++++++++++--------- 6 files changed, 226 insertions(+), 66 deletions(-) diff --git a/crates/in-web/src/dropdown.rs b/crates/in-web/src/dropdown.rs index 7b9f698..7bcb339 100644 --- a/crates/in-web/src/dropdown.rs +++ b/crates/in-web/src/dropdown.rs @@ -187,16 +187,15 @@ pub async fn dropdown_script(cx: &Cx) -> Result { window.__inAdded(trigger);\ select.parentNode.insertBefore(trigger, select);\ window.__inOwn(select, ['dd-native'], []);\ - /* The form's own submit only serves the no-script path; once \ - the select is enhanced it duplicates the autosubmit, so it \ - bows out — directly, not via a stylesheet the skin or a \ - morph might out-race. */ \ - var go = null; \ + /* The form's own submit only serves the no-script path of an \ + autosubmit select; once that select is enhanced it bows out. \ + A select without autosubmit still needs its button — hiding \ + it then strands the form with no way to post at all. */ \ var sibs = select.parentNode.children; \ for (var si = 0; si < sibs.length; si++) { \ if (sibs[si].tagName === 'BUTTON' && sibs[si].type === 'submit' && !sibs[si].classList.contains('dd-trigger')) { go = sibs[si]; break; } \ } \ - if (go) { window.__inOwn(go, [], ['style']); go.style.display = 'none'; } \ + if (go && select.hasAttribute('data-autosubmit')) { window.__inOwn(go, [], ['style']); go.style.display = 'none'; } \ var panel = document.createElement('div');\ panel.className = 'dd-panel';\ panel.setAttribute('role', 'listbox');\ diff --git a/crates/in-web/src/files.rs b/crates/in-web/src/files.rs index aa4fd60..ddda023 100644 --- a/crates/in-web/src/files.rs +++ b/crates/in-web/src/files.rs @@ -484,7 +484,7 @@ async fn view_file(cx: &Cx) -> Result { (t(language, Key::BackToDrive))
if may_download { - (t(language, Key::Download)) + (t(language, Key::Download)) }

(entry_chip(cx, &file).await?) (file.name.clone())

@@ -495,8 +495,33 @@ async fn view_file(cx: &Cx) -> Result { if matches!(viewer_kind(&file.mime), Some(ViewerKind::Image | ViewerKind::Video | ViewerKind::Audio)) || may_download { match viewer_kind(&file.mime) { Some(ViewerKind::Image) => (file.name.clone()), - Some(ViewerKind::Video) => , - Some(ViewerKind::Audio) =>
, + Some(ViewerKind::Video) =>
+ +
+ + "0:00" + + "0:00" + +
+
, + Some(ViewerKind::Audio) =>
+ + "0:00" + + "0:00" + +
, Some(ViewerKind::Pdf) =>

(t(language, Key::PreviewUnavailable))

, @@ -531,16 +556,81 @@ async fn view_file(cx: &Cx) -> Result { + (media_player_script(cx).await?) (viewer_guard_script(cx).await?) } } -/// The preview's save-path cleanup: the media elements already carry no -/// download affordance (`controlslist="nodownload"`, `draggable="false"`), -/// and this drops the context menu over the stage, so "save as" never -/// opens on a preview. A page's bytes on the wire can always be captured — -/// this keeps the surface from offering it, which is what a view-only -/// grant promises. +/// The house media player: play toggle, clock, seek bar — and a fullscreen +/// button on video — over a controls-less `