diff --git a/VERSION b/VERSION index 4e8f395f..30f6cf8d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.26.0 +0.26.1 diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 0b6b22ce..e66fdf5e 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -7,27 +7,21 @@ This project follows the repository versioning rule: - `feature` -> `+0.1.0` - `bugfix` -> `+0.0.1` -## 0.25.3 +## 0.26.1 -Released: 2026-04-11 +Released: 2026-04-12 ### Highlights -- Refined the Earth HUD visual system into a calmer operator-facing style, turned the top-left Earth brand into a real reusable component with language-driven rendering, and cleaned up duplicated brand assets so the page now has a single source of truth for HUD branding. - -### Added - -- Added [frontend/public/earth/js/brand.js](/home/ray/dev/linkong/planet/frontend/public/earth/js/brand.js) as a reusable Earth `brand` component that renders the top-left logo/title/subtitle block from a shared config instead of hardcoding the structure in HTML. -- Added [frontend/public/earth/assets/brand/earth-logo.svg](/home/ray/dev/linkong/planet/frontend/public/earth/assets/brand/earth-logo.svg), [frontend/public/earth/assets/brand/title-zh.svg](/home/ray/dev/linkong/planet/frontend/public/earth/assets/brand/title-zh.svg), and [frontend/public/earth/assets/brand/title-en.svg](/home/ray/dev/linkong/planet/frontend/public/earth/assets/brand/title-en.svg) as the canonical Earth brand asset set. +- Cleaned up the first TV follow-up and replaced the dashboard sidebar's brittle one-off scroll behavior with a reusable `Scrollbar` component, so the new live module code is easier to maintain and the console navigation can scroll without layout jitter. ### Improved -- Improved [frontend/public/earth/css/base.css](/home/ray/dev/linkong/planet/frontend/public/earth/css/base.css), [frontend/public/earth/css/hud.css](/home/ray/dev/linkong/planet/frontend/public/earth/css/hud.css), [frontend/public/earth/css/coordinates-display.css](/home/ray/dev/linkong/planet/frontend/public/earth/css/coordinates-display.css), [frontend/public/earth/css/legend.css](/home/ray/dev/linkong/planet/frontend/public/earth/css/legend.css), [frontend/public/earth/css/earth-stats.css](/home/ray/dev/linkong/planet/frontend/public/earth/css/earth-stats.css), and [frontend/public/earth/css/toolbar.css](/home/ray/dev/linkong/planet/frontend/public/earth/css/toolbar.css) by rebalancing the Earth HUD into a more restrained deep-blue control-room look instead of the earlier over-layered glass-and-neon mix. -- Improved [frontend/public/earth/index.html](/home/ray/dev/linkong/planet/frontend/public/earth/index.html), [frontend/public/earth/js/main.js](/home/ray/dev/linkong/planet/frontend/public/earth/js/main.js), and [frontend/public/earth/js/constants.js](/home/ray/dev/linkong/planet/frontend/public/earth/js/constants.js) by moving the Earth brand mount to a dedicated root and letting `HUD_CONFIG.brandLanguage` choose between `zh` and `en` without embedding the language decision in the DOM. +- Improved [frontend/src/components/Scrollbar/Scrollbar.tsx](/home/ray/dev/linkong/planet/frontend/src/components/Scrollbar/Scrollbar.tsx), [frontend/src/components/AppLayout/AppLayout.tsx](/home/ray/dev/linkong/planet/frontend/src/components/AppLayout/AppLayout.tsx), and [frontend/src/index.css](/home/ray/dev/linkong/planet/frontend/src/index.css) by extracting the sidebar scrollbar into a dedicated component with explicit `x / y / both` axis support, hidden native scrollbars, compact account/version rows, and a sidebar-only vertical setup instead of the earlier patchwork CSS glued directly onto the layout. ### Fixed -- Fixed [frontend/public/earth/css/info-panel.css](/home/ray/dev/linkong/planet/frontend/public/earth/css/info-panel.css) so the Earth brand area now uses consistent `earth-brand` component selectors and English-specific typography hooks, avoiding the earlier one-off `brand-banner` naming drift and duplicated title styles. +- Fixed [frontend/public/earth/js/tv.js](/home/ray/dev/linkong/planet/frontend/public/earth/js/tv.js) by refactoring repeated iframe/video reset paths into shared helpers, so TV source switching, empty-state fallback, and playback retry handling no longer duplicate cleanup logic across multiple branches. ## 0.26.0 @@ -53,6 +47,28 @@ Released: 2026-04-12 - Fixed [frontend/public/earth/js/tv.js](/home/ray/dev/linkong/planet/frontend/public/earth/js/tv.js) and [frontend/public/earth/index.html](/home/ray/dev/linkong/planet/frontend/public/earth/index.html) so HLS/video playback now actively attempts autoplay in the TV panel instead of only loading metadata and leaving the player visually idle. - Fixed [frontend/public/earth/css/tv-panel.css](/home/ray/dev/linkong/planet/frontend/public/earth/css/tv-panel.css) so the TV source selector and action controls better match the Earth HUD dark theme instead of falling back to a bright native dropdown presentation. +## 0.25.3 + +Released: 2026-04-11 + +### Highlights + +- Refined the Earth HUD visual system into a calmer operator-facing style, turned the top-left Earth brand into a real reusable component with language-driven rendering, and cleaned up duplicated brand assets so the page now has a single source of truth for HUD branding. + +### Added + +- Added [frontend/public/earth/js/brand.js](/home/ray/dev/linkong/planet/frontend/public/earth/js/brand.js) as a reusable Earth `brand` component that renders the top-left logo/title/subtitle block from a shared config instead of hardcoding the structure in HTML. +- Added [frontend/public/earth/assets/brand/earth-logo.svg](/home/ray/dev/linkong/planet/frontend/public/earth/assets/brand/earth-logo.svg), [frontend/public/earth/assets/brand/title-zh.svg](/home/ray/dev/linkong/planet/frontend/public/earth/assets/brand/title-zh.svg), and [frontend/public/earth/assets/brand/title-en.svg](/home/ray/dev/linkong/planet/frontend/public/earth/assets/brand/title-en.svg) as the canonical Earth brand asset set. + +### Improved + +- Improved [frontend/public/earth/css/base.css](/home/ray/dev/linkong/planet/frontend/public/earth/css/base.css), [frontend/public/earth/css/hud.css](/home/ray/dev/linkong/planet/frontend/public/earth/css/hud.css), [frontend/public/earth/css/coordinates-display.css](/home/ray/dev/linkong/planet/frontend/public/earth/css/coordinates-display.css), [frontend/public/earth/css/legend.css](/home/ray/dev/linkong/planet/frontend/public/earth/css/legend.css), [frontend/public/earth/css/earth-stats.css](/home/ray/dev/linkong/planet/frontend/public/earth/css/earth-stats.css), and [frontend/public/earth/css/toolbar.css](/home/ray/dev/linkong/planet/frontend/public/earth/css/toolbar.css) by rebalancing the Earth HUD into a more restrained deep-blue control-room look instead of the earlier over-layered glass-and-neon mix. +- Improved [frontend/public/earth/index.html](/home/ray/dev/linkong/planet/frontend/public/earth/index.html), [frontend/public/earth/js/main.js](/home/ray/dev/linkong/planet/frontend/public/earth/js/main.js), and [frontend/public/earth/js/constants.js](/home/ray/dev/linkong/planet/frontend/public/earth/js/constants.js) by moving the Earth brand mount to a dedicated root and letting `HUD_CONFIG.brandLanguage` choose between `zh` and `en` without embedding the language decision in the DOM. + +### Fixed + +- Fixed [frontend/public/earth/css/info-panel.css](/home/ray/dev/linkong/planet/frontend/public/earth/css/info-panel.css) so the Earth brand area now uses consistent `earth-brand` component selectors and English-specific typography hooks, avoiding the earlier one-off `brand-banner` naming drift and duplicated title styles. + ## 0.25.2 Released: 2026-04-10 diff --git a/docs/version-history.md b/docs/version-history.md index 5bb3e5bb..633b4a58 100644 --- a/docs/version-history.md +++ b/docs/version-history.md @@ -16,7 +16,7 @@ ## Current Version - `main` 当前主线历史推导到:`0.16.5` -- `dev` 当前开发分支历史推导到:`0.26.0` +- `dev` 当前开发分支历史推导到:`0.26.1` ## Timeline @@ -86,6 +86,7 @@ | `0.25.2` | bugfix | `dev` | `pending` | refine Earth settings modal sizing, eliminate first-frame HUD scale flicker, and make dragged HUD panels animate cleanly through maximized layout transitions | | `0.25.3` | bugfix | `dev` | `pending` | refactor the Earth HUD visual system, extract the top-left Earth brand into a reusable language-driven component, and consolidate duplicated brand assets into a single canonical set | | `0.26.0` | feature | `dev` | `pending` | add the Earth TV live module with backend-configurable sources, a draggable/resizable TV HUD window, a first curated news channel catalog, and TV source management hooks in system settings | +| `0.26.1` | bugfix | `dev` | `pending` | extract the dashboard sidebar scrollbar into a reusable component and clean duplicated Earth TV player reset logic after the first live-module rollout | ## Maintenance Commits Not Counted as Version Bumps diff --git a/frontend/package.json b/frontend/package.json index bc8aab64..4c79e57d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "planet-frontend", - "version": "0.26.0", + "version": "0.26.1", "private": true, "packageManager": "bun@1", "dependencies": { diff --git a/frontend/public/earth/js/tv.js b/frontend/public/earth/js/tv.js index d0f1fcfb..1b52edcd 100644 --- a/frontend/public/earth/js/tv.js +++ b/frontend/public/earth/js/tv.js @@ -371,6 +371,10 @@ function findSourceById(sourceId) { return tvPayload?.sources?.find((source) => source.id === sourceId) || null; } +function getCurrentSource() { + return findSourceById(currentSourceId); +} + function setPanelMessage(message) { const { status } = getElements(); if (status) { @@ -378,6 +382,50 @@ function setPanelMessage(message) { } } +function resetIframe(iframe) { + if (!(iframe instanceof HTMLIFrameElement)) return; + iframe.removeAttribute("src"); + iframe.hidden = true; +} + +function resetVideo(video) { + if (!(video instanceof HTMLVideoElement)) return; + video.removeAttribute("src"); + video.hidden = true; + video.load(); +} + +function showEmptyState(empty, message) { + if (!(empty instanceof HTMLElement)) return; + empty.hidden = false; + empty.textContent = message; +} + +function hideEmptyState(empty) { + if (empty instanceof HTMLElement) { + empty.hidden = true; + } +} + +function renderVideoSource(video, iframe, source) { + resetIframe(iframe); + if (video instanceof HTMLVideoElement) { + video.hidden = false; + attachVideoSource(video, source); + } +} + +function renderEmbeddedSource(iframe, video, embeddedUrl) { + destroyHlsPlayer(); + resetVideo(video); + if (iframe instanceof HTMLIFrameElement) { + iframe.hidden = false; + if (iframe.src !== embeddedUrl) { + iframe.src = embeddedUrl; + } + } +} + function renderSourceOptions() { const { select } = getElements(); if (!select) return; @@ -429,53 +477,26 @@ function renderSource(source) { if (!source || (!embeddedUrl && !videoUrl)) { destroyHlsPlayer(); - if (iframe) { - iframe.removeAttribute("src"); - iframe.hidden = true; - } - if (video) { - video.removeAttribute("src"); - video.hidden = true; - video.load(); - } - if (empty) { - empty.hidden = false; - empty.textContent = isExternalOnly + resetIframe(iframe); + resetVideo(video); + showEmptyState( + empty, + isExternalOnly ? "当前频道仅支持跳转官网或外部播放器打开。" - : "暂无可播放直播源,请先在系统配置中添加频道。"; - } + : "暂无可播放直播源,请先在系统配置中添加频道。", + ); setPanelMessage(isExternalOnly ? TV_STATUS_MESSAGE.externalOnly : TV_STATUS_MESSAGE.empty); updateOpenButton(source); return; } if (isVideo && videoUrl) { - if (iframe) { - iframe.removeAttribute("src"); - iframe.hidden = true; - } - if (video) { - video.hidden = false; - attachVideoSource(video, source); - } + renderVideoSource(video, iframe, source); } else { - destroyHlsPlayer(); - if (video) { - video.removeAttribute("src"); - video.hidden = true; - video.load(); - } - if (iframe) { - iframe.hidden = false; - if (iframe.src !== embeddedUrl) { - iframe.src = embeddedUrl; - } - } + renderEmbeddedSource(iframe, video, embeddedUrl); } - if (empty) { - empty.hidden = true; - } + hideEmptyState(empty); setPanelMessage( source.id === tvPayload?.default_source_id ? "当前正在播放默认源" : "当前正在播放已选频道", @@ -586,7 +607,7 @@ export function initTVPanel() { }); video?.addEventListener("error", () => { - const currentSource = findSourceById(currentSourceId); + const currentSource = getCurrentSource(); if (!showEmbeddedFallback(currentSource)) { setPanelMessage(TV_STATUS_MESSAGE.videoError); } diff --git a/frontend/src/components/AppLayout/AppLayout.tsx b/frontend/src/components/AppLayout/AppLayout.tsx index 79724870..515372dd 100644 --- a/frontend/src/components/AppLayout/AppLayout.tsx +++ b/frontend/src/components/AppLayout/AppLayout.tsx @@ -20,6 +20,7 @@ import { useLocation, useNavigate } from 'react-router-dom' import type { ItemType, MenuItemType } from 'antd/es/menu/interface' import { useAuthStore } from '../../stores/auth' import packageJson from '../../../package.json' +import Scrollbar from '../Scrollbar/Scrollbar' const { Sider, Content } = Layout const { Text } = Typography @@ -117,7 +118,7 @@ function AppLayout({ children }: AppLayoutProps) { className="dashboard-sider" >