Smoking habit tracker

fix(design): heatmap cells should be square with consistent gap #4

Open io-industries.dev
Open opened by io-industries.dev

fix(design): heatmap cells should be square with consistent gap #

Area: Dashboard + Diagrams · Heatmap · assets/css/marathon-components.css Type: bug (visual) Priority: p2

Summary #

Heatmap points currently have inconsistent width/height gaps and don't look like the GitHub contribution graph. Width and height (including gaps) must be identical and visually match GitHub.

Current behavior #

Both pages/dashboard.vue:231 and pages/diagrams.vue:64:

<div class="grid grid-cols-12 gap-[3px]">
  <div class="heatmap-cell" :class="count>0 ? … : 'bg-base-300'"></div>
</div>
.heatmap-cell { width:1.75rem; height:0.75rem; } /* 12px */
  • grid-cols-12 stretches cells to fill container width → gap is only 3px between columns but row gap may differ as container resizes; cells can render as rectangles when grid stretches.
  • No aspect-square, no border-radius.
  • Does not match GitHub: ~10–12px squares, gap:3px uniform, border-radius:2px, 7 rows × N week-columns.

Expected behavior #

  • Cells must be provably square: enforce aspect-square + fixed w-3 h-3 (or w-[10px] h-[10px]).
  • Gap must be uniform on both axes — gap-[3px] for row-gap and column-gap.
  • Add subtle rounding like GitHub: rounded-[2px] or rounded-sm.
  • Prefer grid-auto-flow: column + grid-rows-7 (week columns) or keep grid-cols-12 but add justify-start + auto-rows: 12px so cells don't stretch. Either is fine if square is guaranteed.
  • Colors unchanged: bg-base-300 (none) / bg-primary/40 (some) / bg-primary (many).
  • Keep role="img" + aria-label/title per cell.

Files to touch #

  • assets/css/marathon-components.css:.heatmap-cell — add aspect-ratio:1 / border-radius:2px
  • pages/dashboard.vue:231 — grid classes
  • pages/diagrams.vue:64 — grid classes (keep in sync)

Acceptance criteria #

How to test #

  1. Run npm run dev, open dashboard + diagrams, inspect a .heatmap-cell → computed size must be square.
  2. Resize viewport 320→1280 → cells stay square, gap uniform.
  3. Compare side-by-side with git contributions graph.
Sign up or Sign in to add to the discussion.