From 85a6a522931d36607a2e1457d0f69f0f52f111f8 Mon Sep 17 00:00:00 2001 From: anqtal Date: Sun, 22 Nov 2026 21:24:49 +1100 Subject: [PATCH 01/51] fix(toast): keep the rounded, centered toast style on phones react-toastify's <=480px rules set border-radius: 0, a 100vw container and pin it to the screen edge, which beat our variable-based radius. Override them so phones get the same pill, inset from the bottom/top edges and safe areas. Co-Authored-By: Claude Opus 5.5 --- src/styles/components/toast.css | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/styles/components/toast.css b/src/styles/components/toast.css index 83a8ed1f..cf21543c 100644 --- a/src/styles/components/toast.css +++ b/src/styles/components/toast.css @@ -34,6 +34,32 @@ gap: 8px; } +/* 库在 480px 以下把通知改成贴边的直角通栏(border-radius: 0、容器 100vw、贴着屏幕底边), + 手机上要和电脑一样:圆角胶囊居中、离底边和安全区留出距离 */ +@media only screen and (max-width: 480px) { + .Toastify .Toastify__toast-container { + width: 100vw; + padding: 0 16px; + bottom: calc(env(safe-area-inset-bottom) + 16px); + } + + /* 顶部的(顶栏头像彩蛋)同样离开屏幕上边和刘海 */ + .Toastify .Toastify__toast-container--top-center { + top: calc(env(safe-area-inset-top) + 16px); + bottom: auto; + } + + .Toastify .Toastify__toast { + border-radius: var(--toastify-toast-bd-radius); + margin-bottom: 0; + } + + .Toastify .Toastify__toast.download-toast { + width: 100%; + border-radius: 14px; + } +} + /* 图标是 24px 的浅色底圆点(ToastIcon),默认 20px 的槽位放不下 */ .Toastify .Toastify__toast-icon { width: auto; From 2af3af8794a4b29688387f3e952fb8082f3a9de4 Mon Sep 17 00:00:00 2001 From: anqtal Date: Sun, 22 Nov 2026 21:24:49 +1100 Subject: [PATCH 02/51] fix(header): make the logo easter egg toast last long enough to notice It closed after 500ms, right after its enter animation, so taps on phones looked like they did nothing. Show it for 1.5s and reuse one toast id so repeated taps restart it instead of stacking. Co-Authored-By: Claude Opus 5.5 --- src/components/header/useLogoEasterEgg.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/header/useLogoEasterEgg.ts b/src/components/header/useLogoEasterEgg.ts index c0118bb7..8c8c4187 100644 --- a/src/components/header/useLogoEasterEgg.ts +++ b/src/components/header/useLogoEasterEgg.ts @@ -1,13 +1,22 @@ import { useTranslation } from 'react-i18next'; import { toast } from 'react-toastify'; +const LOGO_TOAST_ID = 'logo-easter-egg'; + /** 点 xxlb 头像的彩蛋(“不要点我”):顶栏 Logo 和页脚头像共用 */ export function useLogoEasterEgg() { const { t } = useTranslation(); return () => { + // 原来只停 500ms,进场动画刚播完就没了,手机上像是点了没反应; + // 固定 toastId:连点时不会叠一串,只是重新计时 + if (toast.isActive(LOGO_TOAST_ID)) { + toast.update(LOGO_TOAST_ID, { autoClose: 1500 }); + return; + } toast.error(t("shared/MajdataLogo.FUCKYOU"), { + toastId: LOGO_TOAST_ID, position: 'top-center', - autoClose: 500, + autoClose: 1500, }); }; } From 3a70ef853916e7a4c62810c51e23a3448509fed8 Mon Sep 17 00:00:00 2001 From: anqtal Date: Sun, 22 Nov 2026 21:56:19 +1100 Subject: [PATCH 03/51] fix(majview): play the plain tap judge at the end of EX and break holds too Play's HoldDrop.End() always plays a plain tap judge (IsBreak/IsEX = false) when a hold ends; MajView only did this for plain holds, so EX and break hold tails were silent. Co-Authored-By: Claude Opus 5.5 --- src/majview/timeline.js | 4 +++- test/majview/timeline.test.ts | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/majview/timeline.js b/src/majview/timeline.js index e91f39bd..b5fa0bfe 100644 --- a/src/majview/timeline.js +++ b/src/majview/timeline.js @@ -62,7 +62,9 @@ export function soundEvents(chart) { } if (n.ex) add(n.time, 'judge_ex'); if (!n.ex && !n.brk) add(n.time, 'judge'); - if (long && !n.ex && !n.brk) add(n.end, 'judge'); + // hold 尾判和 Play 的 HoldDrop.End() 一样:不管 hold 本身是 EX 还是绝赞,都按普通 tap 判定音响 + // (IsBreak = false、IsEX = false)。以前只给普通 hold 加,EX / 绝赞 hold 的尾巴不响 + if (long) add(n.end, 'judge'); } } raw.sort((a, b) => a.time - b.time); diff --git a/test/majview/timeline.test.ts b/test/majview/timeline.test.ts index d436eec0..8f44005e 100644 --- a/test/majview/timeline.test.ts +++ b/test/majview/timeline.test.ts @@ -30,6 +30,16 @@ describe('MajView sound events (aligned with MajdataPlay NoteAudioManager)', () expect(events).toEqual([['touchHold_riser', 1, 1.5], ['judge', 2.5, 0]]); }); + it('ends every long hold with a plain tap judge, even EX and break holds (HoldDrop.End)', () => { + const judgesAt = (hold: Partial) => + soundEvents({ notes: [{ kind: 'hold', time: 1, end: 2, ...hold }] }) + .filter((e) => e.time === 2 && e.name.startsWith('judge')) + .map((e) => e.name); + expect(judgesAt({})).toEqual(['judge']); + expect(judgesAt({ ex: true })).toEqual(['judge']); + expect(judgesAt({ brk: true })).toEqual(['judge']); + }); + it('requests each sound at most once per frame', () => { const judges = soundEvents({ notes: [tap(1), tap(1.005), tap(1.5)] }).filter((e) => e.name === 'judge'); expect(judges.map((e) => e.time)).toEqual([1, 1.5]); From ae7707fd49d573a463d7fdd82602228944e2277e Mon Sep 17 00:00:00 2001 From: anqtal Date: Sun, 22 Nov 2026 21:58:36 +1100 Subject: [PATCH 04/51] fix(majview): don't cut off judge/answer sounds when merging notes a few ms apart Merging same-frame sound requests extended the kept event's length to the later note, which turned one-shot sounds (length 0 = play to the end) into ~11ms clips that were stopped almost immediately. Only sustained sounds (the touch hold riser) get their length extended now. Co-Authored-By: Claude Opus 5.5 --- src/majview/timeline.js | 4 +++- test/majview/timeline.test.ts | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/majview/timeline.js b/src/majview/timeline.js index b5fa0bfe..1f3c1223 100644 --- a/src/majview/timeline.js +++ b/src/majview/timeline.js @@ -73,7 +73,9 @@ export function soundEvents(chart) { for (const e of raw) { const previous = last.get(e.name); if (previous && e.time - previous.time < FRAME) { - previous.length = Math.max(previous.length, e.time + e.length - previous.time); + // 只有持续音(touchhold 的 riser)要把长度延到后一个的结尾;一次性的音效 length 是 0(播完为止), + // 不能改:以前这里把相隔几毫秒的两个 tap 合并后的 judge / answer 设成了几毫秒长,响一下就被掐断 + if (previous.length > 0) previous.length = Math.max(previous.length, e.time + e.length - previous.time); continue; } const event = { ...e }; diff --git a/test/majview/timeline.test.ts b/test/majview/timeline.test.ts index 8f44005e..6b105f80 100644 --- a/test/majview/timeline.test.ts +++ b/test/majview/timeline.test.ts @@ -40,6 +40,11 @@ describe('MajView sound events (aligned with MajdataPlay NoteAudioManager)', () expect(judgesAt({ brk: true })).toEqual(['judge']); }); + it('merging notes a few ms apart keeps one-shot sounds full length', () => { + const merged = soundEvents({ notes: [tap(80.7273), tap(80.7386)] }).filter((e) => e.name === 'judge' || e.name === 'answer'); + expect(merged.map((e) => [e.name, e.time, e.length])).toEqual([['answer', 80.7273, 0], ['judge', 80.7273, 0]]); + }); + it('requests each sound at most once per frame', () => { const judges = soundEvents({ notes: [tap(1), tap(1.005), tap(1.5)] }).filter((e) => e.name === 'judge'); expect(judges.map((e) => e.time)).toEqual([1, 1.5]); From 5f850d17cb3bf6c1a5f2a9c8623a0e5d29d5af8a Mon Sep 17 00:00:00 2001 From: anqtal Date: Sun, 22 Nov 2026 22:08:28 +1100 Subject: [PATCH 05/51] feat(song): YouTube-style song page on phones On phones the preview player sits flush under the top bar, full width with square corners, and stays pinned there while playing. Below it come the title and actions, then tabs for overview (the sidebar's chart details), comments, chart file and scores; switching tabs never hides the player. Desktop is unchanged. Co-Authored-By: Claude Opus 5.5 --- src/components/song/MajView.tsx | 6 ++- src/hooks/useMediaQuery.ts | 14 ++++++ src/locales/en.json | 1 + src/locales/ja.json | 1 + src/locales/ko.json | 1 + src/locales/zh.json | 1 + src/pages/SongPage.tsx | 62 ++++++++++++++++++--------- src/styles/components/song-detail.css | 34 ++++++++++++++- 8 files changed, 96 insertions(+), 24 deletions(-) create mode 100644 src/hooks/useMediaQuery.ts diff --git a/src/components/song/MajView.tsx b/src/components/song/MajView.tsx index ad376917..9149e9b4 100644 --- a/src/components/song/MajView.tsx +++ b/src/components/song/MajView.tsx @@ -88,7 +88,7 @@ function chartDuration(chart: Chart) { return chart.notes.reduce((end: number, n: { end: number; firework?: boolean }) => Math.max(end, n.end + (n.firework ? 1.4 : 0.76)), 0); } -export default function MajView({ songId, level, cover, onCoverError, active = true, jump, onMarkRange }: { +export default function MajView({ songId, level, cover, onCoverError, active = true, jump, onMarkRange, onPlayingChange }: { songId: string; level: number; cover: string; @@ -99,6 +99,8 @@ export default function MajView({ songId, level, cover, onCoverError, active = t jump?: (ChartMark & { key: number }) | null; /** 告诉页面当前谱面的范围,用来判断评论里的时间 / combo 是否有效 */ onMarkRange?: (range: { length: number; maxCombo: number } | null) => void; + /** 播放 / 暂停时通知页面(手机上播放时把播放器钉在顶栏下面) */ + onPlayingChange?: (playing: boolean) => void; }) { const { t } = useTranslation(); const rootRef = useRef(null); @@ -170,6 +172,8 @@ export default function MajView({ songId, level, cover, onCoverError, active = t // 错误只记原因,文案在渲染时翻译 const [error, setError] = useState<{ track?: boolean; detail?: string }>({}); const [playing, setPlaying] = useState(false); + useEffect(() => { onPlayingChange?.(playing); }, [playing, onPlayingChange]); + useEffect(() => () => onPlayingChange?.(false), [onPlayingChange]); const [duration, setDuration] = useState(0); // 开头 clock 在 0 之前时,进度条从第一下 clock 开始,显示的时间和总长也把这段算进去 const [begin, setBegin] = useState(0); diff --git a/src/hooks/useMediaQuery.ts b/src/hooks/useMediaQuery.ts new file mode 100644 index 00000000..bd7f3289 --- /dev/null +++ b/src/hooks/useMediaQuery.ts @@ -0,0 +1,14 @@ +import { useCallback, useSyncExternalStore } from 'react'; + +const supported = () => typeof window !== 'undefined' && typeof window.matchMedia === 'function'; + +/** 媒体查询是否匹配,窗口变化时跟着更新(没有 matchMedia 的环境,比如测试,当作不匹配) */ +export function useMediaQuery(query: string) { + const subscribe = useCallback((onChange: () => void) => { + if (!supported()) return () => {}; + const list = window.matchMedia(query); + list.addEventListener('change', onChange); + return () => list.removeEventListener('change', onChange); + }, [query]); + return useSyncExternalStore(subscribe, () => supported() && window.matchMedia(query).matches, () => false); +} diff --git a/src/locales/en.json b/src/locales/en.json index 7a0b9fed..256a0655 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -576,6 +576,7 @@ "Duration": "Length", "ManageTags": "Manage tags", "NoTags": "No tags", + "Overview": "Overview", "Preview": "Chart preview", "SearchForArtist": "Search for artist", "SearchForTag": "Search for tag", diff --git a/src/locales/ja.json b/src/locales/ja.json index 80b083bb..e3e8d81c 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -565,6 +565,7 @@ "Duration": "長さ", "ManageTags": "タグを管理", "NoTags": "タグがありません", + "Overview": "概要", "Preview": "譜面プレビュー", "SearchForArtist": "アーティストを検索", "SearchForTag": "タグを検索", diff --git a/src/locales/ko.json b/src/locales/ko.json index ac6b9319..35335525 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -565,6 +565,7 @@ "Duration": "길이", "ManageTags": "태그 관리", "NoTags": "태그 없음", + "Overview": "개요", "Preview": "채보 미리보기", "SearchForArtist": "작곡가 검색", "SearchForTag": "태그 검색", diff --git a/src/locales/zh.json b/src/locales/zh.json index c3874766..5a9cec1a 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -565,6 +565,7 @@ "Duration": "时长", "ManageTags": "管理标签", "NoTags": "暂无标签", + "Overview": "概览", "Preview": "谱面预览", "SearchForArtist": "搜索该艺术家", "SearchForTag": "搜索标签", diff --git a/src/pages/SongPage.tsx b/src/pages/SongPage.tsx index 2a647757..c76e9552 100644 --- a/src/pages/SongPage.tsx +++ b/src/pages/SongPage.tsx @@ -24,7 +24,7 @@ import { ChartMarkContext, type ChartMark, type ChartMarkTarget } from '@/compon import UserAvatar from '@/components/user/UserAvatar'; import UnderlineTabs from '@/components/ui/UnderlineTabs'; import SectionLoading from '@/components/ui/SectionLoading'; -import { LuFileCode, LuPlay, LuTrophy } from 'react-icons/lu'; +import { LuFileCode, LuInfo, LuMessageSquare, LuPlay, LuTrophy } from 'react-icons/lu'; import { PhotoProvider, PhotoView } from 'react-photo-view'; import 'react-photo-view/dist/react-photo-view.css'; import { PiBookmarkSimple, PiCopySimple, PiDownloadSimple, PiLinkSimple, PiTagSimple } from 'react-icons/pi'; @@ -37,6 +37,7 @@ import { compactNumber } from '@/utils/interaction'; import { formatDuration } from '@/utils/simai'; import { useChartMeta } from '@/hooks/useChartMeta'; import { useChartMediaUrl } from '@/hooks/useChartMediaUrl'; +import { useMediaQuery } from '@/hooks/useMediaQuery'; import { preloadMajView } from '@/majview/preload'; // 网页版谱面预览带着 PixiJS,只在点开预览时加载 @@ -118,22 +119,28 @@ const ACTION_BUTTON_CLASS = 'flex justify-center items-center gap-1.5 bg-white/[ const TAG_CLASS = 'inline-flex items-center bg-white/[0.06] hover:bg-white/10 px-2.5 border border-white/10 hover:border-white/20 rounded-full h-7 text-white/80 hover:text-white text-xs no-underline transition-colors'; -const songTabs = [ - { id: 'preview', label: 'song/SongPage.Preview', icon: LuPlay }, - { id: 'chart', label: 'song/ChartFile.Title', icon: LuFileCode }, - { id: 'scores', label: 'song/ScoreRanking.RankingList', icon: LuTrophy }, -] as const; -type SongTab = typeof songTabs[number]['id']; +/** 和 song-detail.css 里手机布局的断点一致 */ +const MOBILE_QUERY = '(max-width: 48rem)'; + +const PREVIEW_TAB = { id: 'preview', label: 'song/SongPage.Preview', icon: LuPlay } as const; +const OVERVIEW_TAB = { id: 'overview', label: 'song/SongPage.Overview', icon: LuInfo } as const; +const COMMENTS_TAB = { id: 'comments', label: 'song/SongComments.Comments', icon: LuMessageSquare } as const; +const CHART_TAB = { id: 'chart', label: 'song/ChartFile.Title', icon: LuFileCode } as const; +const SCORES_TAB = { id: 'scores', label: 'song/ScoreRanking.RankingList', icon: LuTrophy } as const; +const desktopTabs = [PREVIEW_TAB, CHART_TAB, SCORES_TAB]; +const mobileTabs = [OVERVIEW_TAB, COMMENTS_TAB, CHART_TAB, SCORES_TAB]; +type SongTab = typeof PREVIEW_TAB['id'] | typeof OVERVIEW_TAB['id'] | typeof COMMENTS_TAB['id'] | typeof CHART_TAB['id'] | typeof SCORES_TAB['id']; // 打开页面就显示播放器(停在开头);没有可预览的难度时只显示封面 type MarkRange = { length: number; maxCombo: number } | null; -function ChartPreview({ song, chartLevel, active, jump, onMarkRange }: { +function ChartPreview({ song, chartLevel, active, jump, onMarkRange, onPlayingChange }: { song: SongSummary; chartLevel?: number; active: boolean; jump: (ChartMark & { key: number }) | null; onMarkRange: (range: MarkRange) => void; + onPlayingChange: (playing: boolean) => void; }) { const cover = useChartMediaUrl(endpoints.maichart.fullImage(song.id)); const coverSrc = cover.src ?? endpoints.maichart.image(song.id); @@ -148,7 +155,7 @@ function ChartPreview({ song, chartLevel, active, jump, onMarkRange }: { {chartLevel === undefined || cover.recovering ? coverImage : ( + active={active} jump={jump} onMarkRange={onMarkRange} onPlayingChange={onPlayingChange} /> )} @@ -162,8 +169,11 @@ function SongInfo({ data: song, focusId }: { data: SongSummary; focusId?: string const chartLevel = parseRequestedLevel(params.get('level'), song.levels) ?? getDefaultChartLevel(song.levels); const tagWidget = useRef(null); const requestedTab = params.get('tab'); - // 评论不再是页签,一直在播放器下面;旧链接里的 ?tab=comments 落到预览页签 - const activeTab: SongTab = songTabs.find(tab => tab.id === requestedTab)?.id ?? 'preview'; + // 手机上(和视频网站一样)播放器一直在最上面,不是页签;侧栏的谱面资料变成“概览”页签(默认),评论也是页签。 + // 电脑上评论一直在播放器下面、资料在侧栏;手机专用的页签在电脑上落到预览,?tab=preview 在手机上落到概览 + const isMobile = useMediaQuery(MOBILE_QUERY); + const tabs = isMobile ? mobileTabs : desktopTabs; + const activeTab: SongTab = tabs.find(tab => tab.id === requestedTab)?.id ?? tabs[0].id; const [collecting, setCollecting] = useState(false); // 评论排序:菜单放在评论区标题右边,评论区按它加载 const [commentSort, setCommentSort] = useState('best'); @@ -171,6 +181,8 @@ function SongInfo({ data: song, focusId }: { data: SongSummary; focusId?: string const [markRange, setMarkRange] = useState(null); const [jump, setJump] = useState<(ChartMark & { key: number }) | null>(null); const previewRef = useRef(null); + // 手机上播放时播放器钉在顶栏下面(像视频网站),暂停了就跟着页面滚走 + const [previewPlaying, setPreviewPlaying] = useState(false); const searchLink = (text: string) => '/search?search=' + encodeURIComponent(text); const uploadTime = new Date(song.timestamp); const cover = endpoints.maichart.image(song.id); @@ -181,6 +193,7 @@ function SongInfo({ data: song, focusId }: { data: SongSummary; focusId?: string const { data: interact } = useSWR(endpoints.maichart.interactsum(song.id), apiFetcher, { revalidateOnFocus: false }); const tabCounts: Partial> = { scores: leaderboard && chartLevel !== undefined ? leaderboard.scores?.[chartLevel]?.length ?? 0 : undefined, + comments: interact?.comments, }; async function copy(value: string) { @@ -200,11 +213,14 @@ function SongInfo({ data: song, focusId }: { data: SongSummary; focusId?: string const jumpTo = useCallback((mark: ChartMark) => { setJump({ ...mark, key: Date.now() }); - const next = new URLSearchParams(params); - next.set('tab', 'preview'); - setParams(next, { preventScrollReset: true }); + // 手机上播放器不在页签里,留在评论页签就行 + if (!isMobile) { + const next = new URLSearchParams(params); + next.set('tab', 'preview'); + setParams(next, { preventScrollReset: true }); + } requestAnimationFrame(() => previewRef.current?.scrollIntoView({ behavior: 'smooth', block: 'center' })); - }, [params, setParams]); + }, [params, setParams, isMobile]); const markTarget = useMemo( () => markRange && { ...markRange, jump: jumpTo }, [markRange, jumpTo], @@ -252,15 +268,17 @@ function SongInfo({ data: song, focusId }: { data: SongSummary; focusId?: string
({ key: id, label: t(label), icon, count: tabCounts[id] }))} + tabs={tabs.map(({ id, label, icon }) => ({ key: id, label: t(label), icon, count: tabCounts[id] }))} active={activeTab} onSelect={selectTab} idPrefix="song" label={t('song/SongPage.ChartDetails')} /> {/* 播放器一直挂着:切到别的页签不用重新加载,评论里的时间 / combo 也要靠它判断范围 */} -
From a2a129e4ae4860e1a0c59d13f0ca30f6bf2fb218 Mon Sep 17 00:00:00 2001 From: anqtal Date: Sun, 22 Nov 2026 22:17:17 +1100 Subject: [PATCH 11/51] feat(song): put like/dislike left of the download button on phones On phones the compact vote control joins the header action row and the sidebar vote panel is hidden; desktop keeps the panel in the sidebar. Co-Authored-By: Claude Opus 5.5 --- src/components/index.ts | 2 +- src/pages/SongPage.tsx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/index.ts b/src/components/index.ts index 55a8ef08..a383cf07 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -32,7 +32,7 @@ export { default as TimelineModal } from './event/TimelineModal'; // 歌曲详情页组件 export { default as SongDifficultyLevels } from './song/SongDifficultyLevels'; export { CommentSection, CommentSortMenu, CommentListView, CommentBody } from './song/SongComments'; -export { ChartVotePanel } from './song/SongInteraction'; +export { ChartVotePanel, ChartVoteBadge } from './song/SongInteraction'; export { ScoreRanking } from './song/ScoreRanking'; diff --git a/src/pages/SongPage.tsx b/src/pages/SongPage.tsx index 8d7f98be..c82de154 100644 --- a/src/pages/SongPage.tsx +++ b/src/pages/SongPage.tsx @@ -12,6 +12,7 @@ import { CommentSection, CommentSortMenu, ChartVotePanel, + ChartVoteBadge, ScoreRanking, CollectionModal, } from '@/components'; @@ -248,6 +249,8 @@ function SongInfo({ data: song, focusId }: { data: SongSummary; focusId?: string {/* 和个人空间“编辑资料”一样的次要按钮,放在页头标题右边;窄屏时排到标题下面 */}
+ {/* 手机上点赞点踩放在下载左边(电脑上在侧栏) */} + {isMobile && } {([ [PiDownloadSimple, t('song/SongPage.Download'), () => void downloadSong({ id: song.id, title: song.title, toast })], [PiBookmarkSimple, t('song/SongPage.Collection'), () => setCollecting(true)], @@ -335,7 +338,7 @@ function SongInfo({ data: song, focusId }: { data: SongSummary; focusId?: string
))} - + {!isMobile && } {/* 标签:作者标签和玩家标签都是可点的小标签,右边“管理”打开编辑窗口 */}
From d45f3a18118ac77ab6c2e175b8d284ed5922e2cf Mon Sep 17 00:00:00 2001 From: anqtal Date: Sun, 22 Nov 2026 22:17:54 +1100 Subject: [PATCH 12/51] fix(radar): trim the empty space above and below the radar The viewBox reserved room for the maximum score of 200 on the vertical axes, leaving large blank bands for typical charts. Reserve about 166 instead; higher scores still draw thanks to overflow-visible. Co-Authored-By: Claude Opus 5.5 --- src/components/chart/RadarPlot.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/chart/RadarPlot.tsx b/src/components/chart/RadarPlot.tsx index bb190692..0c1c705c 100644 --- a/src/components/chart/RadarPlot.tsx +++ b/src/components/chart/RadarPlot.tsx @@ -40,7 +40,9 @@ export default function RadarPlot({ feature }: RadarPlotProps) { return ( `${label}: ${values[i] ?? '—'}`).join(', ')}; ${estiLabel}: ${esti?.toFixed(2) ?? '—'}`} From 60d8a2857ca47ff17a87edbbbfabb7b7c2d6a017 Mon Sep 17 00:00:00 2001 From: anqtal Date: Sun, 22 Nov 2026 22:20:44 +1100 Subject: [PATCH 13/51] fix(song): style the phone vote control like the action buttons beside it Pass size md through ChartVoteBadge so the like/dislike control is a 36px bordered pill, aligned with download/collect/share. Co-Authored-By: Claude Opus 5.5 --- src/components/song/SongInteraction.tsx | 3 ++- src/pages/SongPage.tsx | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/song/SongInteraction.tsx b/src/components/song/SongInteraction.tsx index e0a38397..82aa580a 100644 --- a/src/components/song/SongInteraction.tsx +++ b/src/components/song/SongInteraction.tsx @@ -52,7 +52,7 @@ export function ChartVotePanel({ songid }: { songid: string }) { } /** 成绩卡片等紧凑场景下的投票控件:只有箭头和分数。 */ -export function ChartVoteBadge({ songid }: { songid: string }) { +export function ChartVoteBadge({ songid, size }: { songid: string; size?: 'sm' | 'md' }) { const { t } = useTranslation(); const { data, mutate } = useSWR(endpoints.maichart.interactsum(songid), apiFetcher, { revalidateOnFocus: false, @@ -61,6 +61,7 @@ export function ChartVoteBadge({ songid }: { songid: string }) { if (!data) return null; return ( {/* 和个人空间“编辑资料”一样的次要按钮,放在页头标题右边;窄屏时排到标题下面 */}
- {/* 手机上点赞点踩放在下载左边(电脑上在侧栏) */} - {isMobile && } + {/* 手机上点赞点踩放在下载左边(电脑上在侧栏),和旁边的按钮一样高、一样的边框 */} + {isMobile && } {([ [PiDownloadSimple, t('song/SongPage.Download'), () => void downloadSong({ id: song.id, title: song.title, toast })], [PiBookmarkSimple, t('song/SongPage.Collection'), () => setCollecting(true)], From e55809b8a0fa6ef68f8ffe19b7bf148b6ba2ef5f Mon Sep 17 00:00:00 2001 From: anqtal Date: Sun, 22 Nov 2026 22:25:04 +1100 Subject: [PATCH 14/51] feat(majview): hook the preview up to system media controls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Report title, artist, cover, play state and position through the Media Session API and handle play, pause, seek and ±10s skip from the lock screen / Control Center / notification. Because Web Audio alone does not count as playing media, a silent looping