mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-06 16:24:17 +00:00
feat(webui): add compare versions view for version stacks
Add a Compare Versions mode to the file detail page (authenticated and public share) that splits the viewer into two 50/50 panes showing two versions side by side. - Breadcrumb file menu gains a Compare Versions entry (version stacks with >=2 versions); the file segment is hidden in compare mode. - URL-driven state (compare/cmpLeft/cmpRight/cmpActive) on both file routes so the view is refresh/share-safe. - Per-side topbar with filename, version, version-switch dropdown, an active-side highlight, and an X exit button. - Shared control bar reflects the active pane; for same-type media it coordinates both panes (play/pause, seek, frame-step, zoom, pan sync), seekbar length matches the active side while the shorter side holds its last frame; only the active side plays audio; resolution/download apply to the active side; fullscreen covers the whole compare view. - Right sidebar (comments/fields) binds to the active side; comment selection seeks the active pane and annotations/comments can be created. - Reuses useFramePlayer + DrawingCanvas without modifying the existing single-file video player. - Unit tests for compare selection/clamp logic.
This commit is contained in:
+3
@@ -411,6 +411,9 @@ export * from "./auth_feature_teams.js";
|
||||
export * from "./auth_community_cta.js";
|
||||
export * from "./versions.js";
|
||||
export * from "./manage_versions.js";
|
||||
export * from "./compare_versions.js";
|
||||
export * from "./exit_compare.js";
|
||||
export * from "./switch_version.js";
|
||||
export * from "./show_left_sidebar.js";
|
||||
export * from "./hide_left_sidebar.js";
|
||||
export * from "./show_right_sidebar.js";
|
||||
|
||||
+3
@@ -413,6 +413,9 @@ export * from './auth_feature_teams.js'
|
||||
export * from './auth_community_cta.js'
|
||||
export * from './versions.js'
|
||||
export * from './manage_versions.js'
|
||||
export * from './compare_versions.js'
|
||||
export * from './exit_compare.js'
|
||||
export * from './switch_version.js'
|
||||
export * from './show_left_sidebar.js'
|
||||
export * from './hide_left_sidebar.js'
|
||||
export * from './show_right_sidebar.js'
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Compare Versions" |
|
||||
*
|
||||
* @param {Compare_VersionsInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const compare_versions: ((inputs?: Compare_VersionsInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Compare_VersionsInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Compare_VersionsInputs = {};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Compare_VersionsInputs */
|
||||
|
||||
const en_compare_versions = /** @type {(inputs: Compare_VersionsInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Compare Versions`)
|
||||
};
|
||||
|
||||
const zh_compare_versions = /** @type {(inputs: Compare_VersionsInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`对比版本`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Compare Versions" |
|
||||
*
|
||||
* @param {Compare_VersionsInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const compare_versions = /** @type {((inputs?: Compare_VersionsInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Compare_VersionsInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_compare_versions(inputs)
|
||||
return zh_compare_versions(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Exit compare" |
|
||||
*
|
||||
* @param {Exit_CompareInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const exit_compare: ((inputs?: Exit_CompareInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Exit_CompareInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Exit_CompareInputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Exit_CompareInputs */
|
||||
|
||||
const en_exit_compare = /** @type {(inputs: Exit_CompareInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Exit compare`)
|
||||
};
|
||||
|
||||
const zh_exit_compare = /** @type {(inputs: Exit_CompareInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`退出对比`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Exit compare" |
|
||||
*
|
||||
* @param {Exit_CompareInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const exit_compare = /** @type {((inputs?: Exit_CompareInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Exit_CompareInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_exit_compare(inputs)
|
||||
return zh_exit_compare(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Switch version" |
|
||||
*
|
||||
* @param {Switch_VersionInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const switch_version: ((inputs?: Switch_VersionInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Switch_VersionInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Switch_VersionInputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Switch_VersionInputs */
|
||||
|
||||
const en_switch_version = /** @type {(inputs: Switch_VersionInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Switch version`)
|
||||
};
|
||||
|
||||
const zh_switch_version = /** @type {(inputs: Switch_VersionInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`切换版本`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Switch version" |
|
||||
*
|
||||
* @param {Switch_VersionInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const switch_version = /** @type {((inputs?: Switch_VersionInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Switch_VersionInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_switch_version(inputs)
|
||||
return zh_switch_version(inputs)
|
||||
});
|
||||
Reference in New Issue
Block a user