Repository navigation
fix(cli): show ⌥T instead of alt+T on macOS for thinking expansion #5802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
ffde6e5
e9b75c6
350c94c
ebe604d
b82e70c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,8 @@ | |
| import { render } from 'ink-testing-library'; | ||
| import { ThinkMessage, ThinkMessageContent } from './ConversationMessages.js'; | ||
|
|
||
| const toggleKeyHint = process.platform === 'darwin' ? 'option+t' : 'alt+t'; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] Tests mirror the component's Consider adding a test that stubs Additionally, the "should render full text when committed and expanded" test (line 37) asserts content is shown but doesn't verify the collapse hint text ( — qwen3.7-max via Qwen Code /review |
||
|
|
||
| describe('<ThinkMessage />', () => { | ||
| const defaultProps = { | ||
| text: 'Analyzing the code structure', | ||
|
|
@@ -19,7 +21,7 @@ describe('<ThinkMessage />', () => { | |
| ); | ||
| const output = lastFrame(); | ||
| expect(output).toContain('Thinking'); | ||
| expect(output).not.toContain('alt+t to expand'); | ||
| expect(output).not.toContain(`${toggleKeyHint} to expand`); | ||
| }); | ||
|
|
||
| it('should render collapsed line when committed and not expanded', () => { | ||
|
|
@@ -28,7 +30,7 @@ describe('<ThinkMessage />', () => { | |
| ); | ||
| const output = lastFrame(); | ||
| expect(output).toContain('Thinking'); | ||
| expect(output).toContain('alt+t to expand'); | ||
| expect(output).toContain(`${toggleKeyHint} to expand`); | ||
| expect(output).not.toContain('Analyzing the code structure'); | ||
| }); | ||
|
|
||
|
|
@@ -45,7 +47,7 @@ describe('<ThinkMessage />', () => { | |
| <ThinkMessage {...defaultProps} isPending={false} />, | ||
| ); | ||
| const output = lastFrame(); | ||
| expect(output).toContain('alt+t to expand'); | ||
| expect(output).toContain(`${toggleKeyHint} to expand`); | ||
| expect(output).not.toContain('Analyzing the code structure'); | ||
| }); | ||
|
|
||
|
|
@@ -61,7 +63,7 @@ describe('<ThinkMessage />', () => { | |
| const output = lastFrame(); | ||
| expect(output).toContain('Thought for'); | ||
| expect(output).toContain('15s'); | ||
| expect(output).toContain('alt+t to expand'); | ||
| expect(output).toContain(`${toggleKeyHint} to expand`); | ||
| }); | ||
|
|
||
| it('should show present-tense duration while pending (streaming)', () => { | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -22,6 +22,8 @@ import { formatDuration } from '../../utils/displayUtils.js'; | |||||
|
|
||||||
| export const THINKING_ICON = '∴ '; | ||||||
|
|
||||||
| const toggleKeyHint = process.platform === 'darwin' ? 'option+t' : 'alt+t'; | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] Consider exporting the constant from this module (same pattern as
Suggested change
Then in both test files: import { toggleKeyHint } from './messages/ConversationMessages.js';— qwen3.7-max via Qwen Code /review |
||||||
|
|
||||||
| interface UserMessageProps { | ||||||
| text: string; | ||||||
| } | ||||||
|
|
@@ -329,7 +331,7 @@ export const ThinkMessage: React.FC<ThinkMessageProps> = ({ | |||||
| return ( | ||||||
| <Text dimColor italic> | ||||||
| {THINKING_ICON} | ||||||
| {label} {t('(alt+t to expand)')} | ||||||
| {label} {t('({{keyHint}} to expand)', { keyHint: toggleKeyHint })} | ||||||
| </Text> | ||||||
| ); | ||||||
| } | ||||||
|
|
@@ -370,7 +372,8 @@ export const ThinkMessage: React.FC<ThinkMessageProps> = ({ | |||||
| <Box flexDirection="column"> | ||||||
| <Text dimColor italic> | ||||||
| {THINKING_ICON} | ||||||
| {expandedLabel} {t('(alt+t to collapse)')} | ||||||
| {expandedLabel}{' '} | ||||||
| {t('({{keyHint}} to collapse)', { keyHint: toggleKeyHint })} | ||||||
| </Text> | ||||||
| <Box paddingLeft={2} flexDirection="column"> | ||||||
| <MarkdownDisplay | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Suggestion] Same cross-platform test gap as
ConversationMessages.test.tsx— this constant mirrors the component's conditional, so only the host platform's branch is exercised. Consider mockingprocess.platformto verify both branches.— qwen3.7-max via Qwen Code /review