fix(footer): suppress hint when status line active, hide on exit prompts

- Hide "? for shortcuts" when a custom status line is configured
  (status line already occupies the top row, hint is redundant)
- Hide status line during Ctrl+C/D exit prompts to keep footer
  at one row during exit flow
- Matches upstream Claude Code suppressHint + exitMessage behavior
This commit is contained in:
wenshao 2026-04-08 21:03:21 +08:00
parent 63a14ae909
commit 2a28132fed

View file

@ -52,8 +52,11 @@ export const Footer: React.FC = () => {
const contextWindowSize = const contextWindowSize =
config.getContentGeneratorConfig()?.contextWindowSize; config.getContentGeneratorConfig()?.contextWindowSize;
// Hide "? for shortcuts" when a custom status line is active (it already
// occupies the top row, so the hint is redundant). Matches upstream behavior.
const suppressHint = !!statusLineText;
// Left bottom row: high-priority messages > approval mode > hint. // Left bottom row: high-priority messages > approval mode > hint.
// Matches upstream layout where status line and hints coexist vertically.
const leftBottomContent = uiState.ctrlCPressedOnce ? ( const leftBottomContent = uiState.ctrlCPressedOnce ? (
<Text color={theme.status.warning}>{t('Press Ctrl+C again to exit.')}</Text> <Text color={theme.status.warning}>{t('Press Ctrl+C again to exit.')}</Text>
) : uiState.ctrlDPressedOnce ? ( ) : uiState.ctrlDPressedOnce ? (
@ -67,7 +70,7 @@ export const Footer: React.FC = () => {
) : showAutoAcceptIndicator !== undefined && ) : showAutoAcceptIndicator !== undefined &&
showAutoAcceptIndicator !== ApprovalMode.DEFAULT ? ( showAutoAcceptIndicator !== ApprovalMode.DEFAULT ? (
<AutoAcceptIndicator approvalMode={showAutoAcceptIndicator} /> <AutoAcceptIndicator approvalMode={showAutoAcceptIndicator} />
) : ( ) : suppressHint ? null : (
<Text color={theme.text.secondary}>{t('? for shortcuts')}</Text> <Text color={theme.text.secondary}>{t('? for shortcuts')}</Text>
); );
@ -117,7 +120,9 @@ export const Footer: React.FC = () => {
> >
{/* Left column — status line on top, hints/mode on bottom */} {/* Left column — status line on top, hints/mode on bottom */}
<Box flexDirection="column" flexShrink={isNarrow ? 0 : 1}> <Box flexDirection="column" flexShrink={isNarrow ? 0 : 1}>
{statusLineText && ( {statusLineText &&
!uiState.ctrlCPressedOnce &&
!uiState.ctrlDPressedOnce && (
<Text dimColor wrap="truncate"> <Text dimColor wrap="truncate">
{statusLineText} {statusLineText}
</Text> </Text>