Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(composer): restore context window pill and goal selector

Steven Enamakelc2c321202e89
diff --git a/app/src/features/conversations/components/composer/ContextWindowPill.tsx b/app/src/features/conversations/components/composer/ContextWindowPill.tsx
index 83c54fc1fe..a464ad3bc0 100644
--- a/app/src/features/conversations/components/composer/ContextWindowPill.tsx
+++ b/app/src/features/conversations/components/composer/ContextWindowPill.tsx
@@ -52,8 +52,7 @@ export function ContextWindowPill({ usage }: { usage: ContextUsage }) {
const ratio = usage.limit > 0 ? Math.min(1, usage.used / usage.limit) : 0;
// Amber past three quarters, red past nine tenths: the points where the next
// long turn starts being at risk of truncation.
- const tone =
- ratio > 0.9 ? 'bg-coral-500' : ratio > 0.75 ? 'bg-amber-500' : 'bg-primary-500';
+ const tone = ratio > 0.9 ? 'bg-coral-500' : ratio > 0.75 ? 'bg-amber-500' : 'bg-primary-500';
return (
<TooltipProvider>
@@ -77,7 +76,9 @@ export function ContextWindowPill({ usage }: { usage: ContextUsage }) {
</button>
}
/>
- <TooltipContent side="top" className="min-w-52 p-2.5 text-xs">
+ {/* The vendored `TooltipContent` is an `inline-flex` row with `items-center`,
+ which would sit the heading beside the rows instead of above them. */}
+ <TooltipContent side="top" className="min-w-52 flex-col items-stretch gap-0 p-2.5 text-xs">
<p className="mb-1.5 font-medium">{t('conversations.composer.context.title')}</p>
<div className="flex flex-col gap-1">
<Row label={t('conversations.composer.context.input')} value={compact(usage.input)} />
diff --git a/app/src/features/conversations/components/composer/GoalSelector.tsx b/app/src/features/conversations/components/composer/GoalSelector.tsx
index c20e30e86e..29d0916606 100644
--- a/app/src/features/conversations/components/composer/GoalSelector.tsx
+++ b/app/src/features/conversations/components/composer/GoalSelector.tsx
@@ -9,8 +9,8 @@ import {
import { TargetIcon } from 'lucide-react';
import { useEffect, useState } from 'react';
-import { useT } from '../../../../lib/i18n/I18nContext';
import { Button } from '../../../../components/ui';
+import { useT } from '../../../../lib/i18n/I18nContext';
export type GoalSelectorProps = {
goal: string | null;
@@ -52,18 +52,14 @@ export function GoalSelector({ goal, onGoalChange, open, onOpenChange }: GoalSel
aria-label={t('conversations.composer.goal.title')}
className="text-muted-foreground hover:text-foreground hover:bg-muted flex h-7 min-w-0 shrink items-center gap-1.5 rounded-full px-2.5 text-xs transition-colors">
<TargetIcon className="size-3.5 shrink-0" />
- <span className="max-w-40 truncate">
- {goal ?? t('conversations.composer.goal.set')}
- </span>
+ <span className="max-w-40 truncate">{goal ?? t('conversations.composer.goal.set')}</span>
</button>
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="sm:max-w-md">
<DialogHeader>
<DialogTitle>{t('conversations.composer.goal.title')}</DialogTitle>
- <DialogDescription>
- {t('conversations.composer.goal.description')}
- </DialogDescription>
+ <DialogDescription>{t('conversations.composer.goal.description')}</DialogDescription>
</DialogHeader>
<textarea