From 2980fd326168386671a20237691c6b151c2b0cd1 Mon Sep 17 00:00:00 2001 From: whereareiam Date: Wed, 2 Sep 2026 21:14:07 +0200 Subject: [PATCH 1/4] Match GitHub heatmap hover styling --- styles/components/heatmap.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/styles/components/heatmap.ts b/styles/components/heatmap.ts index 0f99512e..8efbdcbd 100644 --- a/styles/components/heatmap.ts +++ b/styles/components/heatmap.ts @@ -53,7 +53,8 @@ const heatmap = css` outline: 0.5px solid ${themeVars.github.contribution.default.borderColor.num0}; outline-offset: -0.5px; &:hover { - outline: 0.5px solid ${themeVars.color.text.self} !important; + outline: 1px solid ${themeVars.color.tooltip.text} !important; + outline-offset: -1px; } &[style="fill: var(--color-secondary-alpha-60);"] { fill: ${themeVars.github.contribution.default.bgColor.num0} !important; @@ -80,6 +81,17 @@ const heatmap = css` } } } + /* Forgejo's heatmap tooltip is unthemed; scope the GitHub treatment to hovered cells. */ + body:has(#user-heatmap .vch__day__square:hover) .tippy-box:not([data-theme]) { + background-color: ${themeVars.color.tooltip.bg}; + color: ${themeVars.color.tooltip.text}; + .tippy-content { + font-size: 12px; + font-weight: 400; + line-height: 19.5px; + padding: 4px 8px; + } + } `; // 动态 From 93340e1b04f8b7c821df8101cf21fe5091519252 Mon Sep 17 00:00:00 2001 From: whereareiam Date: Wed, 2 Sep 2026 22:01:01 +0200 Subject: [PATCH 2/4] Match GitHub dated heatmap tooltips --- src/build-output.test.ts | 8 ++++++++ templates/user/heatmap.tmpl | 12 ++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 templates/user/heatmap.tmpl diff --git a/src/build-output.test.ts b/src/build-output.test.ts index f93562e1..eb2fe6b6 100644 --- a/src/build-output.test.ts +++ b/src/build-output.test.ts @@ -183,6 +183,7 @@ describe("Forgejo 15 native integration", () => { "repo/home_sidebar_top.tmpl", "repo/view_content.tmpl", "repo/view_list.tmpl", + "user/heatmap.tmpl", ]; const unsupportedSelectorFamilies = [ @@ -461,6 +462,13 @@ describe("Forgejo 15 native integration", () => { expect(fs.existsSync(path.join(ROOT_DIR, "templates", template)), `missing template: ${template}`).toBe(true); } }); + + it("keeps the native dated fallback for zero-contribution heatmap tooltips", () => { + const heatmapTemplate = fs.readFileSync(path.join(ROOT_DIR, "templates", "user", "heatmap.tmpl"), "utf-8"); + + expect(heatmapTemplate).toContain("data-heatmap-data"); + expect(heatmapTemplate).not.toContain("data-locale-contributions-zero"); + }); }); describe("auto 主题 CSS 内容验证", () => { diff --git a/templates/user/heatmap.tmpl b/templates/user/heatmap.tmpl new file mode 100644 index 00000000..0a34ee87 --- /dev/null +++ b/templates/user/heatmap.tmpl @@ -0,0 +1,12 @@ +{{if .HeatmapData}} +
+
+{{end}} From edecb97ea5febe4b7860df65a200fe835e770dfc Mon Sep 17 00:00:00 2001 From: whereareiam Date: Wed, 2 Sep 2026 22:08:41 +0200 Subject: [PATCH 3/4] Match GitHub heatmap tooltip geometry --- styles/components/heatmap.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/styles/components/heatmap.ts b/styles/components/heatmap.ts index 8efbdcbd..7fdd03bd 100644 --- a/styles/components/heatmap.ts +++ b/styles/components/heatmap.ts @@ -81,10 +81,11 @@ const heatmap = css` } } } - /* Forgejo's heatmap tooltip is unthemed; scope the GitHub treatment to hovered cells. */ - body:has(#user-heatmap .vch__day__square:hover) .tippy-box:not([data-theme]) { + /* Forgejo's heatmap tooltip is unthemed; scope the GitHub treatment to the heatmap page. */ + body:has(#user-heatmap) .tippy-box:not([data-theme]) { background-color: ${themeVars.color.tooltip.bg}; color: ${themeVars.color.tooltip.text}; + border: 0; .tippy-content { font-size: 12px; font-weight: 400; From e2803f46b690fc4d94a73fbb7c03aae2f6678337 Mon Sep 17 00:00:00 2001 From: whereareiam Date: Wed, 2 Sep 2026 22:14:16 +0200 Subject: [PATCH 4/4] Normalize heatmap tooltip typography --- styles/components/heatmap.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/styles/components/heatmap.ts b/styles/components/heatmap.ts index 7fdd03bd..4526f955 100644 --- a/styles/components/heatmap.ts +++ b/styles/components/heatmap.ts @@ -86,6 +86,8 @@ const heatmap = css` background-color: ${themeVars.color.tooltip.bg}; color: ${themeVars.color.tooltip.text}; border: 0; + font-size: 12px; + line-height: 19.5px; .tippy-content { font-size: 12px; font-weight: 400;