Skip to content

Commit ad3726e

Browse files
authored
fix: fix repoContrib confusion (#2269) (#2274)
This commit prevents confusion about the Contributed to stat. Currently, only the last year's results are shown, but it looks like it is the all-time contribution count (see #2269). This commit adds a ' (last year)' suffix to prevent this confusion from happening.
1 parent 0efb982 commit ad3726e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: src/cards/stats-card.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => {
154154
},
155155
contribs: {
156156
icon: icons.contribs,
157-
label: i18n.t("statcard.contribs"),
157+
label: i18n.t("statcard.contribs") + " (last year)",
158158
value: contributedTo,
159159
id: "contribs",
160160
},
@@ -186,7 +186,7 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => {
186186
index,
187187
showIcons: show_icons,
188188
shiftValuePos:
189-
(!include_all_commits ? 50 : 35) + (isLongLocale ? 50 : 0),
189+
(!include_all_commits ? 79.01 : 35) + (isLongLocale ? 50 : 0),
190190
bold: text_bold,
191191
}),
192192
);

Diff for: tests/renderStatsCard.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ describe("Test renderStatsCard", () => {
344344
document.querySelector(
345345
'g[transform="translate(0, 100)"]>.stagger>.stat.bold',
346346
).textContent,
347-
).toMatchInlineSnapshot(`"参与项目数:"`);
347+
).toMatchInlineSnapshot(`"参与项目数 (last year):"`);
348348
});
349349

350350
it("should render without rounding", () => {

0 commit comments

Comments
 (0)