mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-28 19:52:02 +00:00
feat(cli): add /btw slash command for ephemeral side questions
Allow users to ask quick "by the way" questions that use the current conversation context but don't pollute the main conversation history. Closes #2370 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
1359563f45
commit
3818f8acd4
6 changed files with 201 additions and 1 deletions
44
packages/cli/src/ui/components/messages/BtwMessage.tsx
Normal file
44
packages/cli/src/ui/components/messages/BtwMessage.tsx
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright 2025 Qwen Code
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import type React from 'react';
|
||||
import { Box, Text } from 'ink';
|
||||
import type { BtwProps } from '../../types.js';
|
||||
import Spinner from 'ink-spinner';
|
||||
import { Colors } from '../../colors.js';
|
||||
|
||||
export interface BtwDisplayProps {
|
||||
btw: BtwProps;
|
||||
}
|
||||
|
||||
/**
|
||||
* BtwMessage renders the /btw (by the way) sidebar response.
|
||||
* Shows an ephemeral question and answer that doesn't affect the main conversation.
|
||||
*/
|
||||
export const BtwMessage: React.FC<BtwDisplayProps> = ({ btw }) => (
|
||||
<Box flexDirection="column">
|
||||
<Box flexDirection="row">
|
||||
<Text color={Colors.Gray} dimColor>
|
||||
{'btw> '}
|
||||
</Text>
|
||||
<Text color={Colors.Gray}>{btw.question}</Text>
|
||||
</Box>
|
||||
<Box flexDirection="row" marginTop={0}>
|
||||
{btw.isPending ? (
|
||||
<Box>
|
||||
<Box marginRight={1}>
|
||||
<Spinner type="dots" />
|
||||
</Box>
|
||||
<Text color={Colors.AccentPurple}>Thinking...</Text>
|
||||
</Box>
|
||||
) : (
|
||||
<Box flexDirection="column">
|
||||
<Text color={Colors.AccentCyan}>{btw.answer}</Text>
|
||||
</Box>
|
||||
)}
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue