fix(ui): Show the full SDK name in selects and shorten Windows home paths

A long detail (an installation path) was not cut, so it pushed the option label out
(e.g. "Eclipse Adopti…", the Maven name hidden) and scrolled the popup sideways. The
label now keeps its width and the detail is cut with an ellipsis (full path in the
tooltip, detail text translated). Paths under C:/Users/<name> are shown as ~/…
Цей коміт міститься в:
l0ng-ai committed 2026-10-24 09:11:58 +08:00
1 джерело 6a8016b888
коміт 49be259232
4 files changed
+18 -5

No files matched your search

+2
Переглянути файл
@@ -63,5 +63,7 @@ describe("language pages", () => {
expect(filterPackages(pkgs, "dj").map((p) => p.name)).toEqual(["Django"]);
expect(filterPackages(pkgs, "")).toHaveLength(2);
expect(tildify("/Users/me/p/.venv/bin/python")).toBe("~/p/.venv/bin/python");
expect(tildify("C:/Users/me/.m2/wrapper/dists/apache-maven-3.9.16")).toBe("~/.m2/wrapper/dists/apache-maven-3.9.16");
expect(tildify("C:/Program Files/Java/jdk-21")).toBe("C:/Program Files/Java/jdk-21");
});
});
+1 -1
Переглянути файл
@@ -15,7 +15,7 @@ export function useProjectSetting<T>(key: string): [T, (v: T) => void] {
return useSetting<T>(key, hasProject ? "project" : "global");
}
const HOME = /^\/(?:Users|home)\/[^/]+/;
const HOME = /^(?:\/(?:Users|home)|[A-Za-z]:[\\/]Users)[\\/][^\\/]+/;
/** `~/…` for paths in the home directory. */
export function tildify(path: string): string {