hedgequantx 2.7.92 → 2.7.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/app.js +13 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hedgequantx",
3
- "version": "2.7.92",
3
+ "version": "2.7.93",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
package/src/app.js CHANGED
@@ -199,9 +199,9 @@ const run = async () => {
199
199
 
200
200
  // Find max name length for alignment
201
201
  const maxNameLen = Math.max(...numbered.map(n => n.name.length));
202
- const colWidth = 4 + 1 + maxNameLen + 2; // [##] + space + name + gap
203
- const totalContentWidth = numCols * colWidth;
204
- const leftMargin = Math.max(2, Math.floor((innerWidth - totalContentWidth) / 2));
202
+ const itemWidth = 4 + 1 + maxNameLen; // [##] + space + name
203
+ const gap = 3; // gap between columns
204
+ const totalContentWidth = (itemWidth * numCols) + (gap * (numCols - 1));
205
205
 
206
206
  // New rectangle (banner is always closed)
207
207
  console.log(chalk.cyan('╔' + '═'.repeat(innerWidth) + '╗'));
@@ -223,19 +223,22 @@ const run = async () => {
223
223
  }
224
224
  }
225
225
 
226
- let line = ' '.repeat(leftMargin);
226
+ // Build line content
227
+ let content = '';
227
228
  for (let i = 0; i < lineParts.length; i++) {
228
229
  if (lineParts[i]) {
229
- line += chalk.cyan(lineParts[i].num) + ' ' + chalk.white(lineParts[i].name);
230
+ content += chalk.cyan(lineParts[i].num) + ' ' + chalk.white(lineParts[i].name);
230
231
  } else {
231
- line += ' '.repeat(4 + 1 + maxNameLen);
232
+ content += ' '.repeat(itemWidth);
232
233
  }
233
- if (i < lineParts.length - 1) line += ' ';
234
+ if (i < lineParts.length - 1) content += ' '.repeat(gap);
234
235
  }
235
236
 
236
- const lineLen = line.replace(/\x1b\[[0-9;]*m/g, '').length;
237
- const rightPad = Math.max(0, innerWidth - lineLen);
238
- console.log(chalk.cyan('║') + line + ' '.repeat(rightPad) + chalk.cyan('║'));
237
+ // Center the content
238
+ const contentLen = content.replace(/\x1b\[[0-9;]*m/g, '').length;
239
+ const leftPad = Math.floor((innerWidth - contentLen) / 2);
240
+ const rightPad = innerWidth - contentLen - leftPad;
241
+ console.log(chalk.cyan('║') + ' '.repeat(leftPad) + content + ' '.repeat(rightPad) + chalk.cyan('║'));
239
242
  }
240
243
 
241
244
  console.log(chalk.cyan('╠' + '─'.repeat(innerWidth) + '╣'));