feat: bilingual i18n support + UI optimizations (help modal, per-page badge, fixed layout) - #8
Open
likesrt wants to merge 6 commits into
Open
feat: bilingual i18n support + UI optimizations (help modal, per-page badge, fixed layout)#8likesrt wants to merge 6 commits into
likesrt wants to merge 6 commits into
Conversation
- 新增 locales 模块,包含中英文翻译字典、类型定义和工具函数 - 添加 useI18n composable,组件通过 provide/inject 获取翻译函数 - 语言默认跟随浏览器设置,支持在 Settings 面板手动切换并持久化 - 所有功能文案和技术术语均已翻译,品牌名 ModBox 保持原样 - 功能按钮(操作类型、拦截类型、规则标题等)增加 tooltip 悬停说明 - Settings 面板新增「使用帮助」弹窗,提供功能概述和使用指引 - 构建通过,118 个已有测试全部通过
- service worker 新增规则匹配器(urlFilter 通配语法 + requestDomains 域名后缀匹配),近似复刻 DNR 条件语义 - 监听 tabs.onActivated / tabs.onUpdated / windows.onFocusChanged / storage.onChanged,切换或刷新页面时重算角标 - 命中 0 条或特殊页面(chrome:// 等)时隐藏角标 - 移除 popup 内直接写角标的逻辑,角标写入收敛到 service worker 单独负责;面板顶部"启用规则总数"保持不变 Generated with Co-Authored-By: FuFu <fufu@ansss.de>
- .help-content 去掉 max-height:70vh 的过小限制,改为 max-height:100%,仅受弹窗遮罩内边距约束 - 弹窗内容补底色与圆角,视觉上与面板一致;宽度维持现状不动 Generated with Co-Authored-By: FuFu <fufu@ansss.de>
- .folders 锁定 calc(100vh - 20px),右侧 folders__detail 内部滚动(overflow-y:auto) - 侧边栏常驻可见;列表过长时侧边栏自身内部滚动,底部 sticky 设置块随之自然生效 - 帮助弹窗样式同步迁移:.help-content 高度上限放宽为遮罩可用空间 - 兼容 compact 模式收窄侧边栏 Generated with Co-Authored-By: FuFu <fufu@ansss.de>
- 覆盖 parseDomains / hostMatchesDomain / urlFilterToRegExp(* 通配、| 与 || 锚点、转义、大小写) - conditionMatchesPage:urlFilter 与域名 AND 关系、fallback 域名链、document:true 忽略 urlFilter - countMatchedRules:四类规则计数、各级 active 开关、脏数据安全 - updateBadge 集成(chrome stub):命中显示数字、0 命中/特殊页面/无数据/坏 JSON 时隐藏、生命周期监听注册 - 通过 Vite ?raw 导入 service worker 源码并在注入 stub 的沙箱中执行,无需 Node 类型依赖 Generated with Co-Authored-By: FuFu <fufu@ansss.de>
根因:.panel__modal 是 absolute 定位,只能盖住所在的那张小卡片, help-content 的 max-height:100% 因此被限制在卡片内,视觉上毫无变化。 新增 panel__modal--fullscreen(position:fixed)铺满整个 popup 视口, 帮助内容随之占满可用空间;其余确认类弹窗保持 absolute 不受影响。 Generated with Co-Authored-By: FuFu <fufu@ansss.de>
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.
Changes