Skip to content

Commit 806bee4

Browse files
committed
Fixations
1 parent 2749f6a commit 806bee4

2 files changed

Lines changed: 35 additions & 24 deletions

File tree

docs/website/css/components/development.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@
133133
color: var(--txt);
134134
font-size: 0.92rem;
135135
line-height: 1.55;
136+
white-space: normal;
137+
writing-mode: horizontal-tb;
138+
text-orientation: mixed;
136139
overflow-wrap: break-word;
137140
word-break: normal;
138141
}
@@ -160,6 +163,9 @@
160163
font-family: var(--mono);
161164
font-size: 0.68rem;
162165
line-height: 1.55;
166+
white-space: normal;
167+
writing-mode: horizontal-tb;
168+
text-orientation: mixed;
163169
overflow-wrap: break-word;
164170
}
165171

@@ -169,6 +175,9 @@
169175
color: var(--txt);
170176
font-size: 13px;
171177
text-align: right;
178+
white-space: normal;
179+
writing-mode: horizontal-tb;
180+
text-orientation: mixed;
172181
overflow-wrap: break-word;
173182
word-break: normal;
174183
min-width: 0;
@@ -209,6 +218,9 @@
209218
color: var(--txt);
210219
font-size: 0.88rem;
211220
line-height: 1.55;
221+
white-space: normal;
222+
writing-mode: horizontal-tb;
223+
text-orientation: mixed;
212224
overflow-wrap: break-word;
213225
word-break: normal;
214226
}

docs/website/js/features/development-feed.js

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,14 @@ const DevelopmentFeed = (() => {
5959
return;
6060
}
6161

62+
const watchers = Number.isFinite(Number(repo.subscribers_count)) ? Number(repo.subscribers_count) : 0;
63+
6264
node.innerHTML = `
6365
<div class="dev-stat-grid">
6466
<div class="dev-stat"><span class="dev-stat-label">Stars</span><span class="dev-stat-value">${DocsHelpers.compactNumber(repo.stargazers_count)}</span></div>
6567
<div class="dev-stat"><span class="dev-stat-label">Forks</span><span class="dev-stat-value">${DocsHelpers.compactNumber(repo.forks_count)}</span></div>
6668
<div class="dev-stat"><span class="dev-stat-label">Open Issues</span><span class="dev-stat-value">${DocsHelpers.compactNumber(repo.open_issues_count)}</span></div>
67-
<div class="dev-stat"><span class="dev-stat-label">Watchers</span><span class="dev-stat-value">${DocsHelpers.compactNumber(repo.subscribers_count || repo.watchers_count)}</span></div>
69+
<div class="dev-stat"><span class="dev-stat-label">Watchers</span><span class="dev-stat-value">${DocsHelpers.compactNumber(watchers)}</span></div>
6870
</div>
6971
<div class="dev-snapshot-grid">
7072
<div class="dev-snapshot-card">
@@ -85,23 +87,7 @@ const DevelopmentFeed = (() => {
8587
}
8688

8789
function buildCommitSeries(commits, days = 5) {
88-
const buckets = [];
8990
const counts = new Map();
90-
const today = new Date();
91-
92-
for (let offset = days - 1; offset >= 0; offset -= 1) {
93-
const date = new Date(today);
94-
date.setHours(0, 0, 0, 0);
95-
date.setDate(date.getDate() - offset);
96-
const key = date.toISOString().slice(0, 10);
97-
buckets.push({
98-
key,
99-
label: date.toLocaleDateString(undefined, { weekday: "short" }),
100-
fullLabel: date.toLocaleDateString(undefined, { month: "short", day: "numeric" }),
101-
count: 0
102-
});
103-
counts.set(key, 0);
104-
}
10591

10692
commits.forEach((commit) => {
10793
const date = commit.commit?.author?.date;
@@ -110,15 +96,28 @@ const DevelopmentFeed = (() => {
11096
}
11197

11298
const key = new Date(date).toISOString().slice(0, 10);
113-
if (counts.has(key)) {
114-
counts.set(key, counts.get(key) + 1);
115-
}
99+
counts.set(key, (counts.get(key) || 0) + 1);
116100
});
117101

118-
return buckets.map((bucket) => ({
119-
...bucket,
120-
count: counts.get(bucket.key) || 0
121-
}));
102+
const recentDays = Array.from(counts.keys())
103+
.sort((left, right) => new Date(left) - new Date(right))
104+
.slice(-days);
105+
106+
if (recentDays.length === 0) {
107+
const today = new Date();
108+
today.setHours(0, 0, 0, 0);
109+
recentDays.push(today.toISOString().slice(0, 10));
110+
}
111+
112+
return recentDays.map((key) => {
113+
const date = new Date(key);
114+
return {
115+
key,
116+
label: date.toLocaleDateString(undefined, { weekday: "short" }),
117+
fullLabel: date.toLocaleDateString(undefined, { month: "short", day: "numeric" }),
118+
count: counts.get(key) || 0
119+
};
120+
});
122121
}
123122

124123
function chartPath(points) {

0 commit comments

Comments
 (0)