Fix sats output
This commit is contained in:
Binary file not shown.
@@ -486,12 +486,21 @@ export function ActionWizardScreen(): React.ReactElement {
|
||||
// Check if TextInput should have exclusive focus (variables step with content focus)
|
||||
const textInputHasFocus = currentStepData?.type === 'variables' && focusArea === 'content';
|
||||
|
||||
// Handle keyboard navigation
|
||||
/**
|
||||
* Handle TextInput submit (Enter key) - moves to next variable or buttons.
|
||||
*/
|
||||
const handleTextInputSubmit = useCallback(() => {
|
||||
if (focusedInput < variables.length - 1) {
|
||||
setFocusedInput(prev => prev + 1);
|
||||
} else {
|
||||
setFocusArea('buttons');
|
||||
setFocusedButton('next');
|
||||
}
|
||||
}, [focusedInput, variables.length]);
|
||||
|
||||
// Handle Tab key when in TextInput mode (separate from main useInput to allow Tab navigation)
|
||||
useInput((input, key) => {
|
||||
// When TextInput has focus, only handle Tab to navigate away
|
||||
if (textInputHasFocus) {
|
||||
if (key.tab) {
|
||||
// Move to next variable or to buttons
|
||||
if (focusedInput < variables.length - 1) {
|
||||
setFocusedInput(prev => prev + 1);
|
||||
} else {
|
||||
@@ -499,10 +508,15 @@ export function ActionWizardScreen(): React.ReactElement {
|
||||
setFocusedButton('next');
|
||||
}
|
||||
}
|
||||
// Let TextInput handle all other input
|
||||
return;
|
||||
// Escape to go back to content from anywhere
|
||||
if (key.escape && focusArea === 'buttons') {
|
||||
setFocusArea('content');
|
||||
}
|
||||
}, { isActive: textInputHasFocus });
|
||||
|
||||
// Handle keyboard navigation for non-TextInput modes
|
||||
// IMPORTANT: Disable when TextInput should have focus to allow character input
|
||||
useInput((input, key) => {
|
||||
// Tab to switch between content and buttons
|
||||
if (key.tab) {
|
||||
if (focusArea === 'content') {
|
||||
@@ -575,7 +589,7 @@ export function ActionWizardScreen(): React.ReactElement {
|
||||
if (input === 'n' && currentStepData?.type === 'inputs') {
|
||||
setAvailableUtxos(prev => prev.map(u => ({ ...u, selected: false })));
|
||||
}
|
||||
});
|
||||
}, { isActive: !textInputHasFocus });
|
||||
|
||||
// Get action details
|
||||
const action = template?.actions?.[actionIdentifier ?? ''];
|
||||
@@ -630,6 +644,7 @@ export function ActionWizardScreen(): React.ReactElement {
|
||||
<TextInput
|
||||
value={variable.value}
|
||||
onChange={value => updateVariable(index, value)}
|
||||
onSubmit={handleTextInputSubmit}
|
||||
focus={focusArea === 'content' && focusedInput === index}
|
||||
placeholder={`Enter ${variable.name}...`}
|
||||
/>
|
||||
@@ -637,6 +652,11 @@ export function ActionWizardScreen(): React.ReactElement {
|
||||
</Box>
|
||||
))}
|
||||
</Box>
|
||||
<Box marginTop={1}>
|
||||
<Text color={colors.textMuted} dimColor>
|
||||
Enter: Next field • Tab: Go to buttons
|
||||
</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user