mirror of
https://github.com/we-promise/sure.git
synced 2026-09-02 05:11:05 +00:00
* fix(dashboard): fit money-flow month labels and put its figures on scale Two problems in the Money In / Out widget. The month labels collided on a phone. The axis rendered whatever `short_month_year` produced with no regard for the space each band actually has, and that format is only short in some locales: "Mar 2026" in English, but "Mar de 2026" in ca/es/pt. Measured on a 390px viewport in Catalan, the labels are 62-71px against a 56px band step — five overlapping pairs, worst overlap 15px. English is not immune, just further from the edge: it clears by 2px at 390px and overlaps four pairs at 360px. The chart now measures what it rendered and steps down until it fits: the full label, then an abbreviated month, then every other tick with the highlighted month always kept. Measuring beats assuming a character width, which changes with locale, font and zoom. The income and expense amounts also carried no size class, so they inherited the 16px base. That is off the scale the dashboard uses — `text-sm` for a repeated row, `text-lg` for a section total, `text-3xl` for a hero figure — and left each amount larger than the label sitting next to it. They are now `text-sm`, matching both their own labels and the equivalent amount in the outflows widget. The balance keeps `text-lg`: that matches the balance sheet's group total, and with the rows corrected it now reads as the summary of the two beneath it rather than one more oversized number. * fix(dashboard): take the thinned-label parity from the highlighted month The thinning tier kept every even index plus the highlighted month. That month sits last — build_money_flow_data counts down to the selected month — so at six bars it kept 0, 2, 4 and 5, leaving the final pair one step apart: exactly the spacing the code had just measured as too tight. Take the parity from the highlighted index instead, so that month is part of the pattern rather than an exception to it. At 240px it now keeps 1, 3, 5 (Abr, Jun, Ago) evenly spaced with the selected month still shown, against 0, 2, 4, 5 before.