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)
|
// Check if TextInput should have exclusive focus (variables step with content focus)
|
||||||
const textInputHasFocus = currentStepData?.type === 'variables' && focusArea === 'content';
|
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) => {
|
useInput((input, key) => {
|
||||||
// When TextInput has focus, only handle Tab to navigate away
|
|
||||||
if (textInputHasFocus) {
|
|
||||||
if (key.tab) {
|
if (key.tab) {
|
||||||
// Move to next variable or to buttons
|
|
||||||
if (focusedInput < variables.length - 1) {
|
if (focusedInput < variables.length - 1) {
|
||||||
setFocusedInput(prev => prev + 1);
|
setFocusedInput(prev => prev + 1);
|
||||||
} else {
|
} else {
|
||||||
@@ -499,10 +508,15 @@ export function ActionWizardScreen(): React.ReactElement {
|
|||||||
setFocusedButton('next');
|
setFocusedButton('next');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Let TextInput handle all other input
|
// Escape to go back to content from anywhere
|
||||||
return;
|
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
|
// Tab to switch between content and buttons
|
||||||
if (key.tab) {
|
if (key.tab) {
|
||||||
if (focusArea === 'content') {
|
if (focusArea === 'content') {
|
||||||
@@ -575,7 +589,7 @@ export function ActionWizardScreen(): React.ReactElement {
|
|||||||
if (input === 'n' && currentStepData?.type === 'inputs') {
|
if (input === 'n' && currentStepData?.type === 'inputs') {
|
||||||
setAvailableUtxos(prev => prev.map(u => ({ ...u, selected: false })));
|
setAvailableUtxos(prev => prev.map(u => ({ ...u, selected: false })));
|
||||||
}
|
}
|
||||||
});
|
}, { isActive: !textInputHasFocus });
|
||||||
|
|
||||||
// Get action details
|
// Get action details
|
||||||
const action = template?.actions?.[actionIdentifier ?? ''];
|
const action = template?.actions?.[actionIdentifier ?? ''];
|
||||||
@@ -630,6 +644,7 @@ export function ActionWizardScreen(): React.ReactElement {
|
|||||||
<TextInput
|
<TextInput
|
||||||
value={variable.value}
|
value={variable.value}
|
||||||
onChange={value => updateVariable(index, value)}
|
onChange={value => updateVariable(index, value)}
|
||||||
|
onSubmit={handleTextInputSubmit}
|
||||||
focus={focusArea === 'content' && focusedInput === index}
|
focus={focusArea === 'content' && focusedInput === index}
|
||||||
placeholder={`Enter ${variable.name}...`}
|
placeholder={`Enter ${variable.name}...`}
|
||||||
/>
|
/>
|
||||||
@@ -637,6 +652,11 @@ export function ActionWizardScreen(): React.ReactElement {
|
|||||||
</Box>
|
</Box>
|
||||||
))}
|
))}
|
||||||
</Box>
|
</Box>
|
||||||
|
<Box marginTop={1}>
|
||||||
|
<Text color={colors.textMuted} dimColor>
|
||||||
|
Enter: Next field • Tab: Go to buttons
|
||||||
|
</Text>
|
||||||
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user