bingocode 1.1.66 → 1.1.67

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.66",
3
+ "version": "1.1.67",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "claude": "bin/claude-win.cjs",
@@ -141,6 +141,19 @@ export const ProviderPanel: React.FC<{
141
141
  loadPresets();
142
142
  }, [loadProviders, loadPresets]);
143
143
 
144
+ // Key processing for Page Up/Down in scrolling lists
145
+ useEffect(() => {
146
+ const handler = (buf: Buffer) => {
147
+ const s = buf.toString();
148
+ if (stage === 'add_select_preset' || stage === 'slot_select_model') {
149
+ if (s === 'j') setListOffset(prev => prev + 1);
150
+ if (s === 'k') setListOffset(prev => Math.max(0, prev - 1));
151
+ }
152
+ };
153
+ process.stdin.on('data', handler);
154
+ return () => process.stdin.off('data', handler);
155
+ }, [stage]);
156
+
144
157
  // ESC 处理:子页返回列表;列表再触发 onBack(或退出)
145
158
  useEffect(() => {
146
159
  const handler = (buf: Buffer) => {
@@ -404,7 +417,7 @@ export const ProviderPanel: React.FC<{
404
417
  </Box>
405
418
  <ScrollBar total={items.length} offset={start} height={MAX_VISIBLE} />
406
419
  </Box>
407
- <Hint>↑↓: Select · ESC: Back</Hint>
420
+ <Hint>↑↓: Select · j Next Page · k Prev Page · ESC: Back</Hint>
408
421
  </Box>
409
422
  );
410
423
  }
@@ -628,7 +641,7 @@ export const ProviderPanel: React.FC<{
628
641
  : null;
629
642
  const modelDisplayName = entry?.label || entry?.modelId || 'Unconfigured';
630
643
  const status = entry ? `${providerName} / ${modelDisplayName}` : 'Unconfigured';
631
- const label = `[${s}] ${safePadEnd(status, 30)} — ${SLOT_DESCS[s]}`;
644
+ const label = `[${s}] ${safePadEnd(status, 28)} — ${SLOT_DESCS[s]}`;
632
645
  return { label, value: s };
633
646
  });
634
647
  return (
@@ -705,6 +718,10 @@ export const ProviderPanel: React.FC<{
705
718
  );
706
719
  }
707
720
 
721
+ const MAX_VISIBLE_MODELS = 8;
722
+ const start = Math.min(listOffset, Math.max(0, items.length - MAX_VISIBLE_MODELS));
723
+ const sliced = items.slice(start, start + MAX_VISIBLE_MODELS);
724
+
708
725
  return (
709
726
  <Box flexDirection="column" flexGrow={1}>
710
727
  <Title color="cyan">Configure Slot [{currentSlotName}] — Select Model</Title>
@@ -713,7 +730,7 @@ export const ProviderPanel: React.FC<{
713
730
  <Box flexDirection="row" flexGrow={1}>
714
731
  <Box flexDirection="column" flexGrow={1}>
715
732
  <SelectInput
716
- items={items}
733
+ items={sliced}
717
734
  onSelect={it => {
718
735
  const val = it.value as string;
719
736
  if (val.startsWith('__header__')) return;
@@ -727,9 +744,9 @@ export const ProviderPanel: React.FC<{
727
744
  }}
728
745
  />
729
746
  </Box>
730
- <ScrollBar total={items.length} offset={0} height={10} />
747
+ <ScrollBar total={items.length} offset={start} height={MAX_VISIBLE_MODELS} />
731
748
  </Box>
732
- <Hint>↑↓: Select Model · Enter: Confirm · ESC: Back</Hint>
749
+ <Hint>↑↓: Select · j Next Page · k Prev Page · ESC: Back</Hint>
733
750
  </Box>
734
751
  );
735
752
  }
@@ -218,7 +218,21 @@ export const CliMenuManager: React.FC = () => {
218
218
  const [theme, setTheme] = useTheme();
219
219
 
220
220
  // Language
221
- const [lang, setLang] = useState<Lang>(() => getGlobalConfig().language || 'en');
221
+ const [lang, setLang] = useState<Lang>('en');
222
+
223
+ useEffect(() => {
224
+ if (configReady) {
225
+ try {
226
+ const cfg = getGlobalConfig();
227
+ if (cfg.language && (cfg.language === 'en' || cfg.language === 'zh')) {
228
+ setLang(cfg.language as Lang);
229
+ }
230
+ } catch (e) {
231
+ // Silently fail if config has issues
232
+ }
233
+ }
234
+ }, [configReady]);
235
+
222
236
  const t = i18nMap[lang].menu;
223
237
 
224
238
  // Top time