fix(dashboard): recent cigarettes table columns shift with date length #
Area: Dashboard · Recent section · pages/dashboard.vue
Type: bug (visual)
Priority: p2
Summary #
Text in the Recent table on the dashboard shifts horizontally when the date string gets longer. Columns should have fixed widths so position is stable regardless of text length.
Current behavior #
pages/dashboard.vue Recent section (~v-for="cig in cigs"):
<div class="data-row">
<span class="data-row-label">{{ formatTimestamp(cig.timestamp) }}</span>
<span v-if="cigTypeName(cig)" class="tag">{{ cigTypeName(cig) }}</span>
<span class="data-row-value accent">■</span>
</div>
.data-row { display:flex; justify-content:space-between; align-items:center }(assets/css/marathon-components.css:33)formatTimestampisnew Date(ts*1000).toLocaleString()— variable length per locale, per date (e.g.9/13/2025, 2:32:01 PMvs13.09.2025, 14:32:01)- Longer strings push
tagand■sideways → visible jank, especially when switching locales or when dates cross single/double-digit days.
Expected behavior #
Use fixed columns so tag and indicator never move:
- Replace
flex space-betweenfor this table with a grid, e.g.:grid-template-columns: 10rem 1fr auto /* or tailwind: grid grid-cols-[160px_1fr_24px] */ - Date column: fixed
~160px, left-aligned,truncate+whitespace-nowrap+titlefor full value on hover. - Brand tag: middle column,
min-width:0, truncate if needed. - Indicator
■: fixed24px, right-aligned. - Keep
.data-row+ top border treatment for other sections, or introduce.data-row-gridvariant. - Remains responsive (<640px) — may collapse to
grid-cols-[1fr_auto]with date full-width on mobile if needed.
Files to touch #
pages/dashboard.vue— Recent section templateassets/css/marathon-components.css—.data-rowor new.data-row-grid
Acceptance criteria #
How to test #
- Log 5 cigs, open dashboard, observe Recent rows.
- Switch
navigator.languageor temporarily return a long date string → verify columns stay pinned. - Resize to 320px and 1280px → no wrapping/shift.