Skip to content

Commit ac140fc

Browse files
committed
fix(frontend/inventory+history): align skeleton column counts with #792 tables (closes #896)
PR #792 added the "Monthly Cost" column to two history tables and to the active-commitments table, but the skeleton-loader call sites + their explanatory comments still referenced the pre-#792 column counts. The shimmer placeholders therefore render with one fewer cell than the real table on first paint, and the comments are out of sync with the rendered <th> lists. - history.ts:217 — purchase-history skeleton: showSkeletonRows 3rd arg 11 -> 12; comment lists the 12 rendered columns (adds "Monthly Cost"). - history.ts:224 — pending-approval queue skeleton: showSkeletonRows 3rd arg 8 -> 12; comment lists the 12 rendered columns (Date / Account / Provider / Service / Count / Term / Payment / Monthly Cost / Upfront Cost / Monthly Savings / Created by / Actions). - inventory.ts:86 — active-commitments skeleton comment: "10 cols" -> "11 cols" to match ACTIVE_COMMITMENTS_COLS (the call site already uses the constant, so this is comment-only). Verified against the rendered <th> lists in renderHistoryList (history.ts:650-663), the pending-approval queue (history.ts:946-959), and renderActiveCommitmentsTable's headers array (inventory.ts:156). Test suite (10 suites / 202 tests) and tsc --noEmit both pass.
1 parent 74148ec commit ac140fc

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

‎frontend/src/history.ts‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -210,18 +210,19 @@ export async function loadHistory(): Promise<void> {
210210
// Issue #344 T3: skeleton rows for the purchase-history table. 8
211211
// rows matches the typical first-page row count so the skeleton
212212
// doesn't shrink dramatically when real data arrives. Column count
213-
// (11) mirrors the rendered table headers in renderHistoryList:
213+
// (12) mirrors the rendered table headers in renderHistoryList:
214214
// Status / Date / Provider / Service / Type / Region / Count /
215-
// Term / Upfront Cost / Monthly Savings / Plan.
215+
// Term / Upfront Cost / Monthly Cost / Monthly Savings / Plan.
216216
const listEl = document.getElementById('history-list');
217-
if (listEl) showSkeletonRows(listEl, 8, 11);
218-
// Pending-approval queue card (issue #340 sub-task): 3 rows x 8
219-
// cols matches the queue table shape (Date / Provider / Service /
220-
// Count / Upfront / Monthly Savings / Created by / Actions). The
221-
// queue is typically much shorter than the full history list, so
222-
// 3 rows is a sensible skeleton size.
217+
if (listEl) showSkeletonRows(listEl, 8, 12);
218+
// Pending-approval queue card (issue #340 sub-task): 3 rows x 12
219+
// cols matches the queue table shape (Date / Account / Provider /
220+
// Service / Count / Term / Payment / Monthly Cost / Upfront Cost /
221+
// Monthly Savings / Created by / Actions). The queue is typically
222+
// much shorter than the full history list, so 3 rows is a sensible
223+
// skeleton size.
223224
const queueEl = document.getElementById('purchases-approval-queue');
224-
if (queueEl) showSkeletonRows(queueEl, 3, 8);
225+
if (queueEl) showSkeletonRows(queueEl, 3, 12);
225226

226227
try {
227228
// Provider/account filters live in state.ts now (mutated by topbar chips).

‎frontend/src/inventory.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export async function loadActiveCommitments(): Promise<void> {
110110
// account chip is single-select; forward only when exactly one is active.
111111
const accountID = accountIDs.length === 1 ? accountIDs[0] : undefined;
112112

113-
// 5 rows × 10 cols matches the rendered table shape (see
113+
// 5 rows × 11 cols matches the rendered table shape (see
114114
// renderActiveCommitmentsTable). The renderer wipes the container's
115115
// children for a clean handoff from the skeleton.
116116
showSkeletonRows(container, 5, ACTIVE_COMMITMENTS_COLS);

0 commit comments

Comments
 (0)