追加 Hosts、路径撞名拦截、连接页表头随行滚动、GEO 借内核通路
设置页内核参数加 hosts 行,铅笔进弹窗编辑(顶层 hosts: 键, config.go:454,值单个或数组 parseHosts config.go:1131)。弹窗里随便改、 保存才一次性提交——写配置有几秒的校验重载,逐行失焦提交会把等待塞进 每次输入。没动过的行原样写回,数组不被重整形。 订阅和规则组新增时查缓存路径撞名:路径由名字净化而来,「订阅 A」和 「订阅/A」是两个名字、同一个文件,名字查重挡不住,会互相覆盖缓存。 纯函数在 shared 带测试,页面提交前拦。 连接页表头挪进滚动容器加 sticky:.scroller 声明 overflow-y 后按规范 连带拿到横向滚动上下文,表头留在外面时窄屏横向滚动两者脱节。表头 40px 的窗口偏移由 overscan 8 行吸收,不配 scrollMargin。 GEO 单文件下载先借内核的混合端口出去再退直连——内核自己更新 GEO 走 的是它的分流,Patchbay 直连 GitHub 不一定通。ECharts 拆独立 chunk, 业务代码改动不再让这 500KB 跟着换 hash。
This commit is contained in:
@@ -6,10 +6,11 @@ import {
|
||||
listSubscriptions,
|
||||
providerNames,
|
||||
removeSubscription,
|
||||
subscriptionPathConflict,
|
||||
subscriptionReferences,
|
||||
updateSubscription,
|
||||
} from './providers.ts'
|
||||
import { applySetup, chainProviderName } from './inbound-groups.ts'
|
||||
import { applySetup, chainProviderName, providerCachePath } from './inbound-groups.ts'
|
||||
import type { OutboundSetup } from './inbound-groups.ts'
|
||||
import type { ConfigObject } from '../vendor/config-editor/index.ts'
|
||||
|
||||
@@ -181,3 +182,18 @@ describe('删除前的引用检查', () => {
|
||||
expect(subscriptionReferences(base(), 'ghost')).toEqual([])
|
||||
})
|
||||
})
|
||||
|
||||
describe('缓存路径撞名', () => {
|
||||
it('名字只差符号时净化成同一个路径,能认出来', () => {
|
||||
const data = addSubscription({}, '订阅 A', 'https://a.example/sub')
|
||||
const path = providerCachePath('订阅/A')
|
||||
expect(path).toBe(providerCachePath('订阅 A'))
|
||||
expect(subscriptionPathConflict(data, '订阅/A', path)).toBe('订阅 A')
|
||||
})
|
||||
|
||||
it('不同路径、或者就是自己,都不算撞', () => {
|
||||
const data = addSubscription({}, '订阅 A', 'https://a.example/sub')
|
||||
expect(subscriptionPathConflict(data, 'B', providerCachePath('B'))).toBeNull()
|
||||
expect(subscriptionPathConflict(data, '订阅 A', providerCachePath('订阅 A'))).toBeNull()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user