mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-15 12:55:51 +00:00
fix(buddy): address CodeRabbit review findings
- buddy.ts: return type Promise<null> → Promise<React.ReactNode> to match LocalJSXCommandCall interface (CompanionCard path returns ReactElement, not null). - CompanionCard.tsx: clamp stat value to 0..100 before .repeat() to prevent negative count runtime error on out-of-range values. Import path alias suggestions (src/ vs ../) dismissed — project convention uses relative paths (verified against color.ts, help.ts). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,8 @@ const CARD_WIDTH = 40;
|
||||
const CARD_PADDING_X = 2;
|
||||
|
||||
function StatBar({ name, value }: { name: string; value: number }) {
|
||||
const filled = Math.round(value / 10);
|
||||
const clamped = Math.max(0, Math.min(100, value));
|
||||
const filled = Math.round(clamped / 10);
|
||||
const bar = '\u2588'.repeat(filled) + '\u2591'.repeat(10 - filled);
|
||||
return (
|
||||
<Text>
|
||||
|
||||
@@ -71,7 +71,7 @@ export async function call(
|
||||
onDone: LocalJSXCommandOnDone,
|
||||
context: ToolUseContext & LocalJSXCommandContext,
|
||||
args: string,
|
||||
): Promise<null> {
|
||||
): Promise<React.ReactNode> {
|
||||
const sub = args?.trim().toLowerCase() ?? ''
|
||||
const setState = context.setAppState
|
||||
|
||||
|
||||
Reference in New Issue
Block a user