fix(site-finder): visible by-quarter pipeline bars #167

Merged
lekss361 merged 1 commit from fix/pipeline-bar-height-rendering into main 2026-05-15 07:35:51 +00:00
lekss361 commented 2026-05-15 07:32:00 +00:00 (Migrated from github.com)

Summary

  • По кварталам сдачи график показывал почти невидимые столбики (~1–15 px) для cad 66:41:0204016:10, хотя API отдаёт корректные данные (11 объектов, 4 075 квартир, flats per quarter 147–860).
  • Root cause: outer контейнер align-items: flex-end → каждая колонка shrink-to-content (~15.8 px = высота лейбла), и inner-bar с height: ${heightPct}% резолвится против этих 15.8 px, не против намеренной высоты 80 px.
  • Fix: align-items: stretch + bar в фиксированных px (60 px BAR_AREA, ~20 px резерв на лейбл), justifyContent: flex-end на колонке → bars + labels садятся к bottom baseline.

Test plan

  • tsc --noEmit чисто
  • pre-commit (prettier + ruff) green
  • code-reviewer agent: approve
  • После deploy — verify на https://gendsgn.ru/site-finder?tab=market для cad 66:41:0204016:10:
    • визуально видны 8 столбиков (от высокого 2026-Q2 = 860 квартир до 4 px при 0 flats)
    • hover на bar показывает title "2026-Q2: 1 ЖК / 860 квартир"
    • label под каждым баром на baseline

Closes #34 follow-up (pipeline visual rendering).

## Summary - `По кварталам сдачи` график показывал почти невидимые столбики (~1–15 px) для cad 66:41:0204016:10, хотя API отдаёт корректные данные (11 объектов, 4 075 квартир, flats per quarter 147–860). - Root cause: outer контейнер `align-items: flex-end` → каждая колонка shrink-to-content (~15.8 px = высота лейбла), и inner-bar с `height: ${heightPct}%` резолвится против этих 15.8 px, не против намеренной высоты 80 px. - Fix: `align-items: stretch` + bar в фиксированных px (60 px BAR_AREA, ~20 px резерв на лейбл), `justifyContent: flex-end` на колонке → bars + labels садятся к bottom baseline. ## Test plan - [x] `tsc --noEmit` чисто - [x] pre-commit (prettier + ruff) green - [x] code-reviewer agent: ✅ approve - [ ] После deploy — verify на https://gendsgn.ru/site-finder?tab=market для cad `66:41:0204016:10`: - визуально видны 8 столбиков (от высокого 2026-Q2 = 860 квартир до 4 px при 0 flats) - hover на bar показывает title `"2026-Q2: 1 ЖК / 860 квартир"` - label под каждым баром на baseline Closes #34 follow-up (pipeline visual rendering).
lekss361 commented 2026-05-15 07:35:41 +00:00 (Migrated from github.com)

Final review (SHA ca5d0ac, CI )

Cross-checked агентом — pure CSS layout fix, нет contract risks.

Bug analysis verified: align-items: flex-end на outer flex давал каждой колонке shrink-to-content (~16px label height); inner bar height: ${pct}% резолвился против этой column height, не намеренного 80px → bars 1-15px. Fix: align-items: stretch + fixed barPx (60px max BAR_AREA + ~16px label) + justifyContent: flex-end на column.

Backend contract untouched: единственный файл Pipeline24moBlock.tsx (+15/-5). Consumed q.quarter, q.objects, q.flats идентичны PipelineQuarterSlot interface в site-finder.ts. Нет new TS fields — избегаем PR #163 punted-follow-up trap.

Rendering safety: gated data.by_quarter.length > 0 guard сохранён, maxFlatsPerQuarter > 0 short-circuit предотвращает NaN/divide-by-zero, single-quarter → bar at barPx=60 (max).

CSS / responsive: inline styles consistent с existing, no dark-mode regression, fixed pixel heights разумны.

tsc clean per PR body + pre-commit + CI green.

approve merge

## Final review (SHA `ca5d0ac`, CI ✅) Cross-checked агентом — pure CSS layout fix, нет contract risks. ✅ **Bug analysis verified**: `align-items: flex-end` на outer flex давал каждой колонке shrink-to-content (~16px label height); inner bar `height: ${pct}%` резолвился против этой column height, не намеренного 80px → bars 1-15px. Fix: `align-items: stretch` + fixed `barPx` (60px max BAR_AREA + ~16px label) + `justifyContent: flex-end` на column. ✅ **Backend contract untouched**: единственный файл `Pipeline24moBlock.tsx` (+15/-5). Consumed `q.quarter`, `q.objects`, `q.flats` идентичны `PipelineQuarterSlot` interface в `site-finder.ts`. **Нет new TS fields** — избегаем PR #163 punted-follow-up trap. ✅ **Rendering safety**: gated `data.by_quarter.length > 0` guard сохранён, `maxFlatsPerQuarter > 0` short-circuit предотвращает NaN/divide-by-zero, single-quarter → bar at `barPx=60` (max). ✅ **CSS / responsive**: inline styles consistent с existing, no dark-mode regression, fixed pixel heights разумны. ✅ tsc clean per PR body + pre-commit + CI green. approve merge
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lekss361/gendesign#167
No description provided.