{p.commit_count > 0 &&
{p.commit_count} commits}
@@ -102,15 +82,6 @@ function ProjectCard({ project: p, langs, colorMap }: { project: ProjectSummary;
);
}
-function forgeIcon(source: string): string {
- switch (source) {
- case 'github': return '/github.svg';
- case 'gitea': return '/gitea.svg';
- case 'hg': return '/mozilla.svg';
- default: return '/github.svg';
- }
-}
-
function formatRange(first: string | null, last: string | null): string {
const fmt = (iso: string) =>
new Date(iso)
diff --git a/ui/src/pages/ProjectPage.tsx b/ui/src/pages/ProjectPage.tsx
index e6ec4c7..3d239ed 100644
--- a/ui/src/pages/ProjectPage.tsx
+++ b/ui/src/pages/ProjectPage.tsx
@@ -9,6 +9,7 @@ import { fetchEvents, fetchReadme, fetchRepoLanguages, fetchProjects, type Sourc
import { LanguageBar } from '../components/LanguageBar';
import { Markdown } from '../components/Markdown';
import { TimelineEntry } from '../components/TimelineEntry';
+import { forgeIcon } from '../lib/forge';
export function ProjectPage() {
const { source, '*': repoPath } = useParams();
@@ -73,7 +74,7 @@ export function ProjectPage() {
<>
-
{repo}
+
{langs && }
@@ -117,13 +118,3 @@ function repoUrl(source: string, host: string, repo: string): string {
}
}
-function forgeIcon(source: string): string {
- switch (source) {
- case 'github': return '/github.svg';
- case 'gitea': return '/gitea.svg';
- case 'hg': return '/mozilla.svg';
- default: return '/github.svg';
- }
-}
-
-
diff --git a/ui/src/pages/TimelineHome.tsx b/ui/src/pages/TimelineHome.tsx
index 460ac50..52601d2 100644
--- a/ui/src/pages/TimelineHome.tsx
+++ b/ui/src/pages/TimelineHome.tsx
@@ -19,6 +19,7 @@ import {
import { Filters } from '../components/Filters';
import { SummaryEntry } from '../components/SummaryEntry';
import { TimelineEntry } from '../components/TimelineEntry';
+import { useRepoLanguages } from '../lib/useRepoLanguages';
import {
defaultActivityRange,
endOfTodayMs,
@@ -137,6 +138,9 @@ export function TimelineHome() {
enabled: summaryMode,
});
+ // Language mix per repo for the summary cards' distribution bars.
+ const { langsByRepo, colorMap } = useRepoLanguages(summaryMode);
+
// Group the flat rows into periods. The API orders by period desc then
// count desc, so Map insertion order is already the display order.
const periods = useMemo(() => {
@@ -222,6 +226,8 @@ export function TimelineHome() {
period={period}
bucket={bucket}
repos={repos}
+ langsByRepo={langsByRepo}
+ colorMap={colorMap}
/>
))
: events.map((item) => (
diff --git a/ui/src/prerender/prefetch.ts b/ui/src/prerender/prefetch.ts
index 7063a0e..064cec2 100644
--- a/ui/src/prerender/prefetch.ts
+++ b/ui/src/prerender/prefetch.ts
@@ -80,6 +80,7 @@ async function prefetchActivity(qc: QueryClient): Promise
{
const range = summaryRange('day', endOfTodayMs());
await Promise.all([
qc.prefetchQuery({ queryKey: ['sources'], queryFn: fetchSources }),
+ qc.prefetchQuery({ queryKey: ['repo-languages'], queryFn: fetchRepoLanguages }),
qc.prefetchQuery({
queryKey: ['activity-summary', range.fromStr, range.toStr, 'day', ALL_SOURCES],
queryFn: () =>