Skip to content

Make videos on the computer you already own. FreeVideo runs MiniMax H3 in as little as 8 GB of VRAM and 16 GB of RAM, and adapts its acceleration path to your hardware.

Keep feedback accessible in narrow view headers

Bowen Xue36d8925d75be
diff --git a/web/editor.css b/web/editor.css
index 4b14dc2..02abbfa 100644
--- a/web/editor.css
+++ b/web/editor.css
@@ -201,6 +201,7 @@
.fv-studio.fv-editor .fv-header[data-fit~=wrap]>.fv-view-switch{grid-column:1/-1;grid-row:2;justify-self:center}
.fv-studio.fv-editor .fv-header[data-fit~=wrap]>.fv-header-actions{grid-column:2;grid-row:1}
.fv-studio.fv-editor .fv-header[data-fit~=wrap] .fv-ed-name{max-width:320px}
+.fv-studio.fv-editor .fv-header[data-fit~=lean] .fv-feedback-entry{display:none}
.fv-ed-volume-popover{position:absolute;top:calc(100% + 8px);left:0;display:flex;align-items:center;gap:8px;padding:10px 12px;border:1px solid var(--fv-border);border-radius:8px;background:var(--fv-card);white-space:nowrap;z-index:8}
.fv-ed-volume{width:90px}.fv-ed-volume-value{font-variant-numeric:tabular-nums;font-size:12px;min-width:34px}
diff --git a/web/editor_header_fit.js b/web/editor_header_fit.js
index fe58c0a..5552eb1 100644
--- a/web/editor_header_fit.js
+++ b/web/editor_header_fit.js
@@ -1,5 +1,6 @@
// The view switch stays centred in the editor's header while the project name next to the logo stays readable.
// When it would not, the logo first takes its phone size, then gives its place to the name; if that is still too tight, the switch moves to a second row.
+// The feedback entry leaves before the switch moves down, and on two rows when the name is still tight.
// About six Chinese characters or ten Latin letters of the name itself, without the menu arrow.
const READABLE = 120, COMPACT_MARK = 90;
@@ -16,13 +17,19 @@ export function fitEditorHeader(header, brand, title, navigation, actions) {
const own = getComputedStyle(title), chevron = span.nextElementSibling, text = document.createRange(); text.selectNodeContents(span);
const frame = px(own.paddingLeft) + px(own.paddingRight) + px(own.borderLeftWidth) + px(own.borderRightWidth) + (chevron ? chevron.getBoundingClientRect().width + px(own.columnGap) : 0);
const wanted = Math.min(READABLE, text.getBoundingClientRect().width) + frame;
- const fits = markWidth => side >= actions.offsetWidth && side - markWidth - spacing >= wanted;
+ // The actions' own width: the box itself may already be squeezed below its buttons.
+ const shown = [...actions.children].filter(child => child.offsetWidth > 0), apart = px(getComputedStyle(actions).columnGap);
+ const need = Math.max(actions.offsetWidth, shown.reduce((sum, child) => sum + child.getBoundingClientRect().width, 0) + apart * Math.max(0, shown.length - 1));
+ const fits = markWidth => side >= need && side - markWidth - spacing >= wanted;
const compact = Math.min(COMPACT_MARK, mark.offsetWidth);
// On two rows the name shares the first row with the actions only; the logo shrinks too when that is still tight.
- const rowFits = inner - actions.offsetWidth - gap - mark.offsetWidth - spacing >= wanted;
- // From 681 px up the switch has one place in every view, so the logo leaves before the switch moves down.
- const bare = !matchMedia('(max-width:680px)').matches && side >= actions.offsetWidth && side >= wanted;
- const fit = fits(mark.offsetWidth) ? '' : fits(compact) ? 'compact' : bare ? 'bare' : rowFits ? 'wrap' : 'wrap compact';
+ const row = markWidth => inner - need - gap - markWidth - spacing;
+ // The feedback entry is the first action to leave this header (it stays in the other views).
+ const feedback = actions.querySelector('.fv-feedback-entry'), spare = feedback ? feedback.offsetWidth + apart : 0;
+ // From 681 px up the switch has one place in every view, so the logo, then the feedback entry, leave before the switch moves down.
+ const wide = !matchMedia('(max-width:680px)').matches, bare = room => wide && side >= room && side >= wanted;
+ const fit = fits(mark.offsetWidth) ? '' : fits(compact) ? 'compact' : bare(need) ? 'bare' : spare && bare(need - spare) ? 'bare lean'
+ : row(mark.offsetWidth) >= wanted ? 'wrap' : row(compact) >= wanted || !spare ? 'wrap compact' : 'wrap compact lean';
if (fit) header.dataset.fit = fit;
}
const observer = new ResizeObserver(check);
diff --git a/web/feedback.css b/web/feedback.css
index 5cfe82f..effd5e4 100644
--- a/web/feedback.css
+++ b/web/feedback.css
@@ -6,10 +6,11 @@
.fv-feedback .fv-feedback-actions{display:flex;align-items:center;justify-content:flex-end;gap:14px;margin-top:20px}
.fv-feedback .fv-feedback-status{flex:1;margin:0;min-width:0;color:#a5b3c6;font-size:13px;line-height:1.45;text-decoration:none}
.fv-feedback .fv-feedback-actions button{flex:none;min-width:88px}
-/* Header buttons never break into lines; where the header cannot hold the entry beside Settings, only Settings stays. */
+/* Keep the entry beside Settings; compact headers use the same labelled button with a line icon. */
.fv-header-actions>button{white-space:nowrap}
-@media(max-width:1040px){.fv-autopilot .fv-header-actions>.fv-feedback-entry{display:none}}
-/* Below 801 px the editor's header has room for the name, the view switch and Export only; the entry is in the other views. */
-@media(max-width:800px){.fv-editor .fv-header-actions>.fv-feedback-entry{display:none}}
+.fv-feedback-entry>svg{display:none;flex:none;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
+@media(max-width:1040px){.fv-autopilot .fv-feedback-entry>svg{display:block}.fv-autopilot .fv-feedback-label{display:none}}
+@media(max-width:800px){.fv-editor .fv-feedback-entry>svg{display:block}.fv-editor .fv-feedback-label{display:none}}
+@media(max-width:680px){.fv-studio .fv-feedback-entry>svg{display:block}.fv-studio .fv-feedback-label{display:none}}
/* On a narrow screen the line gets the whole width above the button. */
@media(max-width:480px){.fv-feedback .fv-feedback-actions{flex-wrap:wrap;row-gap:10px}.fv-feedback .fv-feedback-status{flex:1 0 100%}.fv-feedback .fv-feedback-status:empty{display:none}}
diff --git a/web/feedback.js b/web/feedback.js
index 6dd3510..c2bc7e2 100644
--- a/web/feedback.js
+++ b/web/feedback.js
@@ -217,7 +217,14 @@ export function openFeedback(t, { open = openPage, version = productVersion,
// The header entry, in the style of the Settings button beside it.
export function feedbackButton(t, className = 'fv-quiet') {
- const button = el('button', `${className} fv-feedback-entry`, t('Feedback', '反馈')); button.type = 'button';
+ const label = t('Feedback', '反馈');
+ const button = el('button', `${className} fv-feedback-entry`); button.type = 'button';
+ button.setAttribute('aria-label', label); button.title = label;
+ const icon = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
+ icon.setAttribute('viewBox', '0 0 16 16'); icon.setAttribute('aria-hidden', 'true'); icon.setAttribute('focusable', 'false');
+ const path = document.createElementNS(icon.namespaceURI, 'path');
+ path.setAttribute('d', 'M13.5 2.5h-11a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h2v3l3.5-3h5.5a1 1 0 0 0 1-1v-7a1 1 0 0 0-1-1Z');
+ icon.append(path); button.append(icon, el('span', 'fv-feedback-label', label));
button.onclick = () => openFeedback(t);
return button;
}