Skip to content

Align report tables, format timestamps, and fix help typos - #2169

Open
ArturWieczorek wants to merge 3 commits into
masterfrom
artur/fix-dbtool-report-cosmetics
Open

Align report tables, format timestamps, and fix help typos#2169
ArturWieczorek wants to merge 3 commits into
masterfrom
artur/fix-dbtool-report-cosmetics

Conversation

@ArturWieczorek

Copy link
Copy Markdown
Contributor

Closes #2164.

The report tables were built from hardcoded header and underline string literals, and the address column was printed unpadded. Any value wider than the header - a 59-to-63 character bech32 stake address is the usual culprit - pushed every following column out of line, and one underline literal even carried a stray space. Timestamps were rendered with the default Show of UTCTime, so a row with sub-second precision was wider than one without, shifting the date column too.

This adds a small renderTable helper that sizes each column to the widest of its header and its cells, and a formatReportTime that renders a uniform second-precision timestamp. The balance, latest, history, and transaction reports all go through them, so the tables stay aligned regardless of address length or timestamp fractions. As a side effect leftPad/rightPad now pad with Text.replicate instead of slicing a fixed 56-character literal, which quietly removes an old truncation limit. While here I also fixed the user-facing help typos (histiory, fof the gievn), the utxo-set paritioning typo, and the misspelled coaleseTxs helper.

The first commit stands up the first cardano-db-tool test suite and adds a failing test; the rest implement the fix. The suite covers formatReportTime (uniform, second-precision) and renderTable (every line the same width, no stray spaces in the underline). All three report tables were also checked end to end against a live local db-sync database - balance, rewards history, and transactions all line up with clean timestamps.

Marked WIP/draft pending review of the same author's related db-tool fixes (#2166, #2168) and any Address-variant test coverage.

@ArturWieczorek
ArturWieczorek force-pushed the artur/fix-dbtool-report-cosmetics branch from add3ff7 to 0762536 Compare July 16, 2026 17:04
@ArturWieczorek
ArturWieczorek marked this pull request as ready for review July 16, 2026 18:45
@ArturWieczorek
ArturWieczorek requested a review from a team as a code owner July 16, 2026 18:45
@ArturWieczorek ArturWieczorek changed the title WIP: Align report tables, format timestamps, and fix help typos Align report tables, format timestamps, and fix help typos Jul 16, 2026
Report timestamps are rendered with the default Show of UTCTime, which
keeps sub-second noise and is not a fixed width. Add a tool test suite
and assert formatReportTime yields a uniform, second-precision string;
the placeholder implementation added here fails it, and the fix follows
in the next commit.
Report tables used hardcoded header/underline literals and printed the
address column unpadded, so any value wider than the header shifted every
later column; one underline literal also had a stray space. Timestamps
were rendered with the default Show of UTCTime, keeping sub-second noise.

Add a renderTable helper that sizes each column to the widest of its
header and cells, and a formatReportTime that renders a uniform
second-precision timestamp; route the balance, latest, history and
transaction reports through them. Fix the help-text typos
(histiory/fof/gievn), the utxo-set 'paritioning' typo, and rename the
misspelled coaleseTxs. leftPad/rightPad now pad via Text.replicate so an
over-wide value no longer silently drops its padding.
Complete the misspelled-identifier rename missed on the first pass
(coaleseInputs/coalese -> coalesceInputs/coalesce), and set the balance
report's total row off with a divider again, reusing the header
underline so it stays aligned with the data-driven column widths.
@ArturWieczorek
ArturWieczorek force-pushed the artur/fix-dbtool-report-cosmetics branch from 0762536 to 7c7e537 Compare July 29, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cardano-db-tool: help-text typos, misaligned report tables, and a crude timestamp format

1 participant