bingocode 1.1.72 → 1.1.73

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bingocode",
3
- "version": "1.1.72",
3
+ "version": "1.1.73",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "claude": "bin/claude-win.cjs",
@@ -11,7 +11,7 @@ import path from 'path';
11
11
  import os from 'os';
12
12
  import { ensureSingletonLocalServer } from '../server/ensureSingletonLocalServer.ts';
13
13
  // New: Common UI elements and top toolbar
14
- import { TopBar, BottomBar, Panel, Hint, Kbd, SecondaryMenu, StateDisplay, ScrollBar } from '../manager/CliMenuUi.tsx';
14
+ import { TopBar, BottomBar, Panel, Hint, Kbd, SecondaryMenu, StateDisplay, ScrollBar, truncate, safePadEnd } from '../manager/CliMenuUi.tsx';
15
15
  import { WelcomeV2 } from '../components/LogoV2/WelcomeV2.tsx';
16
16
  import { TopToolbar } from '../manager/TopToolbar.tsx';
17
17
 
@@ -696,21 +696,15 @@ export const CliMenuManager: React.FC = () => {
696
696
  return out.join('\n');
697
697
  }
698
698
 
699
- // 新增:历史列表格式化(单行定宽 + 省略)
700
- function ellipsis(str: string, max: number) {
701
- const s = String(str ?? '');
702
- if (max <= 0) return '';
703
- if (s.length <= max) return s;
704
- return s.slice(0, Math.max(0, max - 1)) + '…';
705
- }
706
699
  function makeHistoryLabel(item: any, width: number, isMarked: boolean) {
707
700
  const star = isMarked ? '★ ' : '';
708
- const ts = String(item.createdAt || '').slice(0, 16).replace('T',' ');
701
+ const ts = String(item.createdAt || '').slice(0, 16).replace('T', ' ');
709
702
  const cnt = String(item.messageCount ?? 0).padStart(3, ' ');
710
- // 预留:前缀(星标+时间) + 双空格 + 末尾计数 + 单空格
711
- const reserved = star.length + ts.length + 2 + 1 + cnt.length;
703
+ // Reserved width for: prefix(star+time) + spacer(2) + suffix(1+cnt)
704
+ // Star is width 2, ts is width 16, spacer is 2, cnt is 3, padding is 1. Total = 24
705
+ const reserved = 24;
712
706
  const titleMax = Math.max(8, width - reserved);
713
- const title = ellipsis(String(item.title || ''), titleMax).padEnd(titleMax, ' ');
707
+ const title = safePadEnd(truncate(String(item.title || ''), titleMax), titleMax);
714
708
  return `${star}${ts} ${title} ${cnt}`;
715
709
  }
716
710
 
@@ -1065,7 +1059,7 @@ export const CliMenuManager: React.FC = () => {
1065
1059
  const slicedItems = groupedHistoryItems.slice(start, start + HIST_VISIBLE);
1066
1060
 
1067
1061
  return (
1068
- <Box width={VIEW_W} height={MID_H} flexDirection="row">
1062
+ <Box width={VIEW_W} height={MID_H} flexDirection="row" position="relative">
1069
1063
  <Box flexDirection="column" flexGrow={1} paddingX={1}>
1070
1064
  <SelectInput
1071
1065
  key={`${historyCursor ?? 'first'}:${slicedItems.length}:${start}`}
@@ -1093,7 +1087,7 @@ export const CliMenuManager: React.FC = () => {
1093
1087
  <Hint>{i18nMap[lang].historyHint}</Hint>
1094
1088
  </Box>
1095
1089
  </Box>
1096
- <ScrollBar total={groupedHistoryItems.length} offset={start} height={MID_H} />
1090
+ <ScrollBar total={groupedHistoryItems.length} offset={start} height={MID_H - 2} />
1097
1091
  </Box>
1098
1092
  );
1099
1093
  }