惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
F
Fortinet All Blogs
D
Docker
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
WordPress大学
WordPress大学
罗磊的独立博客
Y
Y Combinator Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
J
Java Code Geeks
T
The Blog of Author Tim Ferriss
U
Unit 42
N
Netflix TechBlog - Medium
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
云风的 BLOG
云风的 BLOG
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog
Hugging Face - Blog
Hugging Face - Blog
Stack Overflow Blog
Stack Overflow Blog
爱范儿
爱范儿
酷 壳 – CoolShell
酷 壳 – CoolShell
P
Proofpoint News Feed
G
Google Developers Blog
H
Help Net Security

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
refactor(diffs): drop unused language hint filter · openc...
vincentkoc · 2026-06-19 · via Recent Commits to openclaw:main

@@ -2,13 +2,17 @@

22

import type { FileDiffMetadata } from "@pierre/diffs";

33

import { describe, expect, it } from "vitest";

44

import {

5-

filterSupportedLanguageHints,

65

normalizeDiffViewerPayloadLanguages,

6+

normalizeSupportedLanguageHint,

77

} from "./language-hints.js";

889-

describe("filterSupportedLanguageHints", () => {

9+

async function normalizeHints(values: readonly string[], options = {}) {

10+

return await Promise.all(values.map((value) => normalizeSupportedLanguageHint(value, options)));

11+

}

12+13+

describe("normalizeSupportedLanguageHint", () => {

1014

it("keeps supported languages", async () => {

11-

await expect(filterSupportedLanguageHints(["typescript", "cpp", "text"])).resolves.toEqual([

15+

await expect(normalizeHints(["typescript", "cpp", "text"])).resolves.toEqual([

1216

"typescript",

1317

"cpp",

1418

"text",

@@ -17,7 +21,7 @@ describe("filterSupportedLanguageHints", () => {

17211822

it("normalizes common aliases to base viewer languages", async () => {

1923

await expect(

20-

filterSupportedLanguageHints(["ts", "c++", "c#", "bash", "dockerfile", "rb", "kt", "ps1"]),

24+

normalizeHints(["ts", "c++", "c#", "bash", "dockerfile", "rb", "kt", "ps1"]),

2125

).resolves.toEqual([

2226

"typescript",

2327

"cpp",

@@ -32,7 +36,7 @@ describe("filterSupportedLanguageHints", () => {

32363337

it("keeps mainstream languages in the base viewer without the language pack", async () => {

3438

await expect(

35-

filterSupportedLanguageHints([

39+

normalizeHints([

3640

"ruby",

3741

"swift",

3842

"kotlin",

@@ -57,23 +61,24 @@ describe("filterSupportedLanguageHints", () => {

5761

});

58625963

it("drops uncommon languages without the language pack", async () => {

60-

await expect(filterSupportedLanguageHints(["abap"])).resolves.toEqual(["text"]);

64+

await expect(normalizeSupportedLanguageHint("abap")).resolves.toBeUndefined();

6165

});

62666367

it("keeps uncommon languages when the language pack is available", async () => {

6468

await expect(

65-

filterSupportedLanguageHints(["abap"], { languagePackAvailable: true }),

66-

).resolves.toEqual(["abap"]);

69+

normalizeSupportedLanguageHint("abap", { languagePackAvailable: true }),

70+

).resolves.toBe("abap");

6771

});

687269-

it("drops invalid languages and falls back to text", async () => {

70-

await expect(filterSupportedLanguageHints(["not-a-real-language"])).resolves.toEqual(["text"]);

73+

it("drops invalid languages", async () => {

74+

await expect(normalizeSupportedLanguageHint("not-a-real-language")).resolves.toBeUndefined();

7175

});

72767377

it("keeps valid languages when invalid hints are mixed in", async () => {

74-

await expect(

75-

filterSupportedLanguageHints(["typescript", "not-a-real-language"]),

76-

).resolves.toEqual(["typescript"]);

78+

await expect(normalizeHints(["typescript", "not-a-real-language"])).resolves.toEqual([

79+

"typescript",

80+

undefined,

81+

]);

7782

});

7883

});

7984