@miphamai/cli 0.19.5 → 0.20.0

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.
@@ -1,6 +1,7 @@
1
1
  import React, { useState, useMemo, useEffect } from 'react'
2
2
  import { Box, Text, useInput } from 'ink'
3
3
  import TextInput from 'ink-text-input'
4
+ import { useI18n } from '../i18n-context'
4
5
  import { getCommandList } from './commands.js'
5
6
 
6
7
  interface CommandPickerProps {
@@ -29,6 +30,7 @@ export function CommandPicker({
29
30
  onClose,
30
31
  maxVisible = PAGE_SIZE,
31
32
  }: CommandPickerProps) {
33
+ const { t } = useI18n()
32
34
  const allCommands = useMemo(() => getCommandList(), [])
33
35
  const [filter, setFilter] = useState(initialFilter)
34
36
  const [cursorIdx, setCursorIdx] = useState(0)
@@ -92,14 +94,14 @@ export function CommandPicker({
92
94
  {/* Title */}
93
95
  <Box marginBottom={1}>
94
96
  <Text bold color="cyan">
95
- Commands
97
+ {t('ui.command_picker.title')}
96
98
  </Text>
97
- <Text dimColor> ↑↓ navigate · Enter select · Esc close</Text>
99
+ <Text dimColor> {t('ui.command_picker.nav_help')}</Text>
98
100
  </Box>
99
101
 
100
102
  {/* Command list */}
101
103
  <Box flexDirection="column" marginBottom={1}>
102
- {visible.length === 0 && <Text dimColor> No commands match "{filter}"</Text>}
104
+ {visible.length === 0 && <Text dimColor> {t('ui.command_picker.no_matches', { filter })}</Text>}
103
105
  {visible.map((cmd, i) => {
104
106
  const globalIdx = i + scrollStart
105
107
  const isCursor = globalIdx === cursorIdx
@@ -119,8 +121,11 @@ export function CommandPicker({
119
121
  {filtered.length > maxVisible && (
120
122
  <Box marginBottom={1}>
121
123
  <Text dimColor>
122
- {scrollStart + 1}–{Math.min(scrollStart + maxVisible, filtered.length)} of{' '}
123
- {filtered.length} commands
124
+ {t('ui.command_picker.scroll_indicator', {
125
+ start: String(scrollStart + 1),
126
+ end: String(Math.min(scrollStart + maxVisible, filtered.length)),
127
+ total: String(filtered.length),
128
+ })}
124
129
  </Text>
125
130
  </Box>
126
131
  )}
@@ -137,7 +142,7 @@ export function CommandPicker({
137
142
  onSelect(selected.name)
138
143
  }
139
144
  }}
140
- placeholder="Type to filter commands..."
145
+ placeholder={t('ui.command_picker.placeholder')}
141
146
  />
142
147
  </Box>
143
148
  </Box>