Skip to content

Commit ef631c8

Browse files
committed
refactor: extract table utilities to dedicated _table.ts file
- Create new src/_table.ts with ResponsiveTable class and formatting functions - Move table-related utilities from _utils.ts to _table.ts: - ResponsiveTable class with responsive design and compact mode support - formatNumber(), formatCurrency() for data formatting - formatModelsDisplay(), formatModelsDisplayMultiline() for model display - pushBreakdownRows() for model breakdown table rows - TableRow, TableOptions, TableCellAlign types - Update imports in all command files to use _table.ts instead of _utils.ts - Keep only non-table utilities in _utils.ts (unreachable, getFileModifiedTime) - Move all table-related tests to _table.ts with comprehensive coverage - Improve type safety with dedicated TableCellAlign type for cell alignment This refactoring improves code organization by separating table-related utilities from general utilities, following the single responsibility principle. All tests pass and functionality remains unchanged.
1 parent 348b253 commit ef631c8

10 files changed

Lines changed: 824 additions & 815 deletions

File tree

‎src/_live-rendering.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ import prettyMs from 'pretty-ms';
1616
import stringWidth from 'string-width';
1717
import { BURN_RATE_THRESHOLDS } from './_consts.ts';
1818
import { calculateBurnRate, projectBlockUsage } from './_session-blocks.ts';
19+
import { formatCurrency, formatModelsDisplay, formatNumber } from './_table.ts';
1920
import { centerText, createProgressBar, drawEmoji } from './_terminal-utils.ts';
2021
import { getTotalTokens } from './_token-utils.ts';
21-
import { formatCurrency, formatModelsDisplay, formatNumber } from './_utils.ts';
2222

2323
/**
2424
* Get rate indicator (HIGH/MODERATE/NORMAL) based on burn rate

0 commit comments

Comments
 (0)