Eye on the Tags header hides all tags, also tags added later
ci / check (push) Successful in 3m3s
release / release (push) Successful in 11m34s

This commit is contained in:
2026-10-15 13:55:08 +02:00
parent 302fe4a4ae
commit e4e597dc5c
7 changed files with 47 additions and 4 deletions
+15
View File
@@ -78,3 +78,18 @@ describe("lineOwners", () => {
expect(owners.get("f")).toBe("refs/heads/feature");
});
});
describe("hiding all tags", () => {
const state = { hidden: [], rules: [], hideTags: true };
it("hides every tag", () => {
expect(isRefVisible("refs/tags/v1", state)).toBe(false);
expect(isRefVisible("refs/tags/release/2", state)).toBe(false);
});
it("leaves branches alone", () => {
expect(isRefVisible("refs/heads/main", state)).toBe(true);
expect(isRefVisible("refs/remotes/origin/main", state)).toBe(true);
});
it("shows tags again when turned off", () => {
expect(isRefVisible("refs/tags/v1", { ...state, hideTags: false })).toBe(true);
});
});
+1
View File
@@ -21,6 +21,7 @@ export function globMatch(pattern: string, text: string): boolean {
export function isRefVisible(name: string, state: FilterState): boolean {
if (state.hidden.includes(name)) return false;
if (state.hideTags && name.startsWith("refs/tags/")) return false;
const short = shortName(name);
const only = state.rules.filter((r) => r.mode === "only");
if (only.length > 0 && !only.some((r) => globMatch(r.pattern, short))) return false;
+2
View File
@@ -33,6 +33,8 @@ export interface FilterState {
/** Full ref names hidden with the eye toggle. */
hidden: string[];
rules: FilterRule[];
/** Hides every tag, also tags created later. */
hideTags?: boolean;
}
/** A commit as shown on screen, with its parent edges after collapsing. */