From e8654c7e062431a521636703f47339cde64644fd Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 1 Jul 2026 13:17:23 +0200 Subject: [PATCH] refactor: replace `vue-bar-graph` dependency with inlined SVG chart (#38292) Inlines the small SVG bar graph into `RepoActivityTopAuthors.vue` (its only consumer) and drops the `vue-bar-graph` npm dependency. - Bars render at static height (dropped the grow animation). - Theme-aware axis color instead of a hardcoded `#555555`. - Removed the dangling `role="img"`/`aria-labelledby` on the ``. - Reserve the chart height so the page does not shift when the component mounts. Screenshot 2026-07-01 at 11 15 25 Screenshot 2026-07-01 at 11 15 35 fyi @lafriks --------- Signed-off-by: silverwind --- package.json | 1 - pnpm-lock.yaml | 12 -- templates/repo/pulse.tmpl | 2 +- types.d.ts | 18 --- .../js/components/RepoActivityTopAuthors.vue | 115 ++++++++---------- 5 files changed, 51 insertions(+), 97 deletions(-) diff --git a/package.json b/package.json index c47ba1801de..e185d5e361c 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,6 @@ "vite": "8.1.0", "vite-string-plugin": "2.0.4", "vue": "3.5.38", - "vue-bar-graph": "2.2.0", "vue-chartjs": "5.3.3" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0a9a877c824..9b10e2cc504 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -200,9 +200,6 @@ importers: vue: specifier: 3.5.38 version: 3.5.38(typescript@6.0.3) - vue-bar-graph: - specifier: 2.2.0 - version: 2.2.0(typescript@6.0.3) vue-chartjs: specifier: 5.3.3 version: 5.3.3(chart.js@4.5.1)(vue@3.5.38(typescript@6.0.3)) @@ -4306,9 +4303,6 @@ packages: vscode-uri@3.1.0: resolution: {integrity: sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==} - vue-bar-graph@2.2.0: - resolution: {integrity: sha512-1xFPho2nM6nFDziExLu48vKO+Q90gjxz1NyHfc+MhgfYDSxR9BMyhOIXUO5EmwKIVEX5dBoP2n3Ius8SjKRD4g==} - vue-chartjs@5.3.3: resolution: {integrity: sha512-jqxtL8KZ6YJ5NTv6XzrzLS7osyegOi28UGNZW0h9OkDL7Sh1396ht4Dorh04aKrl2LiSalQ84WtqiG0RIJb0tA==} peerDependencies: @@ -8979,12 +8973,6 @@ snapshots: vscode-uri@3.1.0: {} - vue-bar-graph@2.2.0(typescript@6.0.3): - dependencies: - vue: 3.5.38(typescript@6.0.3) - transitivePeerDependencies: - - typescript - vue-chartjs@5.3.3(chart.js@4.5.1)(vue@3.5.38(typescript@6.0.3)): dependencies: chart.js: 4.5.1 diff --git a/templates/repo/pulse.tmpl b/templates/repo/pulse.tmpl index 1550c7e8cf1..58011f80e52 100644 --- a/templates/repo/pulse.tmpl +++ b/templates/repo/pulse.tmpl @@ -105,7 +105,7 @@ {{ctx.Locale.TrN .Activity.Code.Deletions "repo.activity.git_stats_deletion_1" "repo.activity.git_stats_deletion_n" .Activity.Code.Deletions}}.
-
+
{{end}} diff --git a/types.d.ts b/types.d.ts index 639bd56ad39..2a3447e80c2 100644 --- a/types.d.ts +++ b/types.d.ts @@ -47,21 +47,3 @@ declare module '@citation-js/core' { declare module '@citation-js/plugin-software-formats' {} declare module '@citation-js/plugin-bibtex' {} declare module '@citation-js/plugin-csl' {} - -declare module 'vue-bar-graph' { - import type {DefineComponent} from 'vue'; - - interface BarGraphPoint { - value: number; - label: string; - } - - export const VueBarGraph: DefineComponent<{ - points?: Array; - barColor?: string; - textColor?: string; - textAltColor?: string; - height?: number; - labelHeight?: number; - }>; -} diff --git a/web_src/js/components/RepoActivityTopAuthors.vue b/web_src/js/components/RepoActivityTopAuthors.vue index 82e70b11ae4..85c90489434 100644 --- a/web_src/js/components/RepoActivityTopAuthors.vue +++ b/web_src/js/components/RepoActivityTopAuthors.vue @@ -1,6 +1,13 @@