From 88397e80a30819a6e9e83625863a1b0f9fa3d9d2 Mon Sep 17 00:00:00 2001 From: Tien Nguyen Minh Date: Sun, 19 Apr 2026 10:22:03 +0700 Subject: [PATCH] =?UTF-8?q?docs:=20resync=20after=20card=20fixes=20?= =?UTF-8?q?=E2=80=94=20title=20auto-fit,=20truncate,=20abbreviated=20ticks?= =?UTF-8?q?=20(#15)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Several recent code changes hadn't propagated to the docs: - design-guidelines * Card frame title row: document the 11–15 px auto-shrink (not a flat 15 px anymore). * Donut Top-N: already 7 (updated earlier). * Bar-chart section renamed to cover weekday + by-year too; document the peak-vs-dim highlight convention and the niceTicks yMax ≥ max invariant. * Add Heatmap / Stat-column (streak) / List (top-starred) card sections — they were missing entirely. * Rewrite "Text overflow" from "we don't truncate" to the current truth (truncate helper, formatTick abbreviations). * Replace dangling `truncateName` reference with `truncate`. - code-standards * SVG output standards: call out truncate, formatTick abbreviation, header auto-fit so the card-review gate reflects what the renderers actually do. - codebase-summary * Layout tree: svg.go / axis.go comments list the helpers they now contain; productive.go notes the weekday histogram. * demo/ tree shows the index vs per-theme split. * Data-flow diagram includes Weekday in the productive pass. * Test coverage row lists TestCardsFitFrame / TestFitTitleFontSize / TestNiceTicksCoversMax — the new invariant guards. - system-architecture * Shared primitives list adds renderWeekday and renderHeatmap; donut blurb updated to "top 7". * New "Chart-geometry invariants" block documents niceTicks ceiling, formatTick abbreviation, header auto-fit. - project-roadmap * Phase 7.5 bullet updated to describe the index + per-theme demo split (was single-README TOC). --- docs/code-standards.md | 4 ++- docs/codebase-summary.md | 16 +++++----- docs/design-guidelines.md | 58 +++++++++++++++++++++++++++++-------- docs/project-roadmap.md | 2 +- docs/system-architecture.md | 9 +++++- 5 files changed, 67 insertions(+), 22 deletions(-) diff --git a/docs/code-standards.md b/docs/code-standards.md index 98ea6be5..75bd7216 100644 --- a/docs/code-standards.md +++ b/docs/code-standards.md @@ -57,8 +57,10 @@ Never write comments that describe what well-named code does (`// increment coun ## SVG output standards - Always XML-escape user-controlled strings through `escapeXML` (`&`, `<`, `>`, `"`, `'`). -- Numbers formatted via `formatInt` with thousands separators. +- Long user-controlled strings (bio, names, company, repo slugs) go through `truncate` in `svg.go` before rendering — never print raw multi-line input that could push a later element off-screen. +- Body numbers formatted via `formatInt` (thousands separators). Y-axis tick numbers go through `formatTick`, which abbreviates ≥ 1000 to `k` / `M` / `B` so no label exceeds 4 chars. - Stable viewbox per card (`340×200`) matching github-profile-summary-cards. +- Titles render through `header()` which auto-shrinks font-size (15 → 11 px) when the string wouldn't fit in `width − 20 − 4`. - No `