Skip to content

Commit 460355a

Browse files
sloweyyyslowey-katalonclaude
authored
fix(leetcode): visually group heatmap + badges into one bordered card (#6)
The compact badges row was sitting outside the heatmap's card boundary, making it ambiguous whose badges belonged to whom — readers had to trace upward past a border to find the engineer name. - Pull the border out to .lc-heatmap-card itself; remove the inner heatmap's border so the whole engineer block is one container: header → heatmap → badges, top-to-bottom. - Add a "Badges · N" subtitle (.lc-badges-compact-title) above the icon row, separated by a top border, so the section reads as a labeled subsection of the engineer's card rather than a floating strip. - Engineer header gets a bottom border to anchor it visually. Co-authored-by: Truong Le Vinh Phuc <phuc.truong@katalon.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 109a137 commit 460355a

2 files changed

Lines changed: 46 additions & 11 deletions

File tree

app/globals.css

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,19 +1356,32 @@ footer {
13561356

13571357
.lc-heatmap-list {
13581358
display: grid;
1359-
gap: 24px;
1359+
gap: 20px;
13601360
}
13611361

13621362
.lc-heatmap-card {
13631363
display: flex;
13641364
flex-direction: column;
1365-
gap: 14px;
1365+
gap: 16px;
1366+
background: var(--surface);
1367+
border: 1px solid var(--border);
1368+
border-radius: var(--r-card);
1369+
padding: 20px;
1370+
}
1371+
1372+
/* When wrapped in a card, the heatmap doesn't need its own border */
1373+
.lc-heatmap-card .lc-heatmap {
1374+
background: transparent;
1375+
border: none;
1376+
padding: 0;
13661377
}
13671378

13681379
.lc-heatmap-cardhead {
13691380
display: flex;
13701381
align-items: center;
13711382
gap: 12px;
1383+
padding-bottom: 14px;
1384+
border-bottom: 1px solid var(--border);
13721385
}
13731386

13741387
.lc-heatmap-cardhead a {
@@ -1398,8 +1411,25 @@ footer {
13981411
align-items: center;
13991412
}
14001413

1401-
.lc-badges-compact {
1402-
margin-top: 12px;
1414+
.lc-badges-compact-wrap {
1415+
border-top: 1px solid var(--border);
1416+
padding-top: 14px;
1417+
}
1418+
1419+
.lc-badges-compact-title {
1420+
font-family: var(--font-display);
1421+
font-size: 0.95rem;
1422+
font-weight: 500;
1423+
color: var(--text-bright);
1424+
margin: 0 0 10px;
1425+
letter-spacing: -0.2px;
1426+
}
1427+
1428+
.lc-badges-compact-title .muted {
1429+
font-family: var(--font-mono);
1430+
font-size: 0.78rem;
1431+
font-weight: 400;
1432+
color: var(--text-mute);
14031433
}
14041434

14051435
.lc-badge {

components/LeetcodeBadges.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,18 @@ export default function LeetcodeBadges({ badges, variant = "compact", limit }: P
2828
const list = limit != null ? sorted.slice(0, limit) : sorted;
2929
const hidden = limit != null ? Math.max(0, sorted.length - limit) : 0;
3030
return (
31-
<div className="lc-badges lc-badges-compact" aria-label={`${sorted.length} badges`}>
32-
{list.map((b) => (
33-
<span key={b.id} className="lc-badge" title={`${b.name} · ${b.creationDate}`}>
34-
<img src={b.icon} alt={b.name} loading="lazy" />
35-
</span>
36-
))}
37-
{hidden > 0 && <span className="lc-badge-more">+{hidden}</span>}
31+
<div className="lc-badges-compact-wrap">
32+
<h4 className="lc-badges-compact-title">
33+
Badges <span className="muted">· {sorted.length}</span>
34+
</h4>
35+
<div className="lc-badges" aria-label={`${sorted.length} badges`}>
36+
{list.map((b) => (
37+
<span key={b.id} className="lc-badge" title={`${b.name} · ${b.creationDate}`}>
38+
<img src={b.icon} alt={b.name} loading="lazy" />
39+
</span>
40+
))}
41+
{hidden > 0 && <span className="lc-badge-more">+{hidden}</span>}
42+
</div>
3843
</div>
3944
);
4045
}

0 commit comments

Comments
 (0)