ui(frontend): 适配移动端布局与笔记预览换行#376
Open
techotaku39 wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动概述
适配 BiliNote Web 前端移动端布局,并修复笔记预览在手机/窄面板下长文本不换行、内容被遮挡的问题。
为什么
当前首页与设置页主要按桌面三栏布局设计,在手机端操作不便;同时 Markdown 笔记预览中的长链接、长英文、代码块、视频横幅标题等会撑开预览容器,导致手机端或 PC 拖窄预览面板时内容被遮挡,无法按可用宽度自适应。
做了什么
useIsMobile,首页移动端切换为顶部 Header + 底部生成 / 历史 / 笔记Tab。markdown-responsive.css,覆盖github-markdown-css中不利于窄屏显示的默认样式:VideoBanner,标题和元信息在窄屏/窄面板下可换行。ScrollAreaviewport 增加min-w-0/max-w-full,避免子内容撑宽父容器。测试方式
npm run build(BillNote_frontend,Vite production build)通过。npx -y pnpm@9.15.0 install --frozen-lockfile && npx -y pnpm@9.15.0 build(BillNote_frontend)通过。pnpm 9.15.0;本机全局pnpm 11.2.2会因依赖构建审批策略触发ERR_PNPM_IGNORED_BUILDS。typecheck状态已确认:BillNote_frontend当前没有typecheckscript;直接执行tsc --noEmit在develop基线已有类型错误,本 PR 未引入新的生产构建失败。backend代码,无需python -m py_compile。http://localhost:3015,后端使用本机已有8483服务。回归风险
BillNote_frontend的布局与样式,后端/API/配置无变更。.bilinote-markdown-body作用域,降低对其他页面的影响。Checklist
feature/*/fix/*/release/*/hotfix/*)develop;线上紧急 →master;发版 → 见 §4.3)type(scope): subject格式(CONTRIBUTING.md §5.1)README.md/CHANGELOG.md/CLAUDE.md/ 模块 README,如适用).env/ 大型二进制