feat(web): merge search filters into one row and tidy episode versions (POLISH-1)
- H&R becomes a quick-filter facet (yes/no/unknown, with counts) on search results and the site resources tab; drop the old free/H&R selects, keep size range and sort on the same row (mobile: drawer), single clear button - legacy free/hr URL params migrate into quick filters; stored selections keep the same localStorage key - search timing and query terms move into TechInfo - library episode versions: click the whole row to expand, versions listed as sibling rows, details only under the selected version, raw values in TechInfo - slot comparison gaps get reason codes (matchGapText in contracts reasons.ts): "可换成 2160p", "缺 HDR 版本" Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
12bc4664b6
commit
71b129d85a
19 files changed
+668
-290
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { looksLikeCode, reasonSentence, reasonText } from "../src/reasons.ts";
|
||||
import { looksLikeCode, matchGapText, matchGapTexts, reasonSentence, reasonText } from "../src/reasons.ts";
|
||||
|
||||
describe("reasonText(DEAI-2 原因码人话化)", () => {
|
||||
it("裸码、blocked:多码、带后缀的码都能翻译", () => {
|
||||
@@ -24,3 +24,21 @@ describe("reasonText(DEAI-2 原因码人话化)", () => {
|
||||
expect(looksLikeCode("Connection refused")).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("matchGapText(POLISH-1 入库版本差距)", () => {
|
||||
it("带参数的码转成短句", () => {
|
||||
expect(matchGapText("version_resolution:2160p")).toBe("可换成 2160p");
|
||||
expect(matchGapText("version_hdr")).toBe("缺 HDR 版本");
|
||||
expect(matchGapText("version_hdr:DV")).toBe("缺 DV 版本");
|
||||
expect(matchGapText("version_source:REMUX")).toBe("可换成 Remux");
|
||||
expect(matchGapText("version_subtitles:zh-Hans")).toBe("缺简中字幕");
|
||||
expect(matchGapText("version_subtitles:chs")).toBe("缺 chs 字幕");
|
||||
});
|
||||
|
||||
it("不认识的码返回 null;列表去重", () => {
|
||||
expect(matchGapText("nope")).toBeNull();
|
||||
expect(matchGapTexts(["version_resolution:2160p", "version_resolution_upgrade:2160p", "nope"])).toEqual([
|
||||
"可换成 2160p",
|
||||
]);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user