mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
fix(web): show composer status for Cursor (#1250)
This commit is contained in:
@@ -33,7 +33,7 @@ import { useComposerDraft } from '@/hooks/useComposerDraft'
|
||||
import { useComposerEnterBehavior } from '@/hooks/useComposerEnterBehavior'
|
||||
import { FloatingOverlay } from '@/components/ChatInput/FloatingOverlay'
|
||||
import { Autocomplete } from '@/components/ChatInput/Autocomplete'
|
||||
import { shouldShowComposerStatusBar, StatusBar } from '@/components/AssistantChat/StatusBar'
|
||||
import { StatusBar } from '@/components/AssistantChat/StatusBar'
|
||||
import { ComposerButtons } from '@/components/AssistantChat/ComposerButtons'
|
||||
import type { PendingSchedule } from '@/components/AssistantChat/ScheduleTimePicker'
|
||||
import { AttachmentItem } from '@/components/AssistantChat/AttachmentItem'
|
||||
@@ -1322,25 +1322,23 @@ export function HappyComposer(props: {
|
||||
<ComposerPrimitive.Root className="relative" onSubmit={handleSubmit}>
|
||||
{overlays}
|
||||
|
||||
{shouldShowComposerStatusBar(agentFlavor) ? (
|
||||
<StatusBar
|
||||
active={active}
|
||||
thinking={thinking}
|
||||
agentState={agentState}
|
||||
backgroundTaskCount={backgroundTaskCount}
|
||||
contextSize={contextSize}
|
||||
contextCacheRead={contextCacheRead}
|
||||
contextWindow={contextWindow}
|
||||
model={model}
|
||||
modelReasoningEffort={modelReasoningEffort}
|
||||
serviceTier={serviceTier}
|
||||
permissionMode={permissionMode}
|
||||
collaborationMode={collaborationMode}
|
||||
threadGoal={threadGoal}
|
||||
agentFlavor={agentFlavor}
|
||||
voiceStatus={voiceStatus}
|
||||
/>
|
||||
) : null}
|
||||
<StatusBar
|
||||
active={active}
|
||||
thinking={thinking}
|
||||
agentState={agentState}
|
||||
backgroundTaskCount={backgroundTaskCount}
|
||||
contextSize={contextSize}
|
||||
contextCacheRead={contextCacheRead}
|
||||
contextWindow={contextWindow}
|
||||
model={model}
|
||||
modelReasoningEffort={modelReasoningEffort}
|
||||
serviceTier={serviceTier}
|
||||
permissionMode={permissionMode}
|
||||
collaborationMode={collaborationMode}
|
||||
threadGoal={threadGoal}
|
||||
agentFlavor={agentFlavor}
|
||||
voiceStatus={voiceStatus}
|
||||
/>
|
||||
|
||||
{sendError ? (
|
||||
<div
|
||||
|
||||
@@ -1,17 +1,5 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { shouldShowCodexFastBadge, shouldShowComposerStatusBar } from './StatusBar'
|
||||
|
||||
describe('shouldShowComposerStatusBar', () => {
|
||||
it('hides the composer status bar for Cursor sessions', () => {
|
||||
expect(shouldShowComposerStatusBar('cursor')).toBe(false)
|
||||
})
|
||||
|
||||
it('shows the composer status bar for other agents', () => {
|
||||
expect(shouldShowComposerStatusBar('claude')).toBe(true)
|
||||
expect(shouldShowComposerStatusBar('codex')).toBe(true)
|
||||
expect(shouldShowComposerStatusBar(null)).toBe(true)
|
||||
})
|
||||
})
|
||||
import { shouldShowCodexFastBadge } from './StatusBar'
|
||||
|
||||
describe('shouldShowCodexFastBadge', () => {
|
||||
it('uses only the effective service tier', () => {
|
||||
|
||||
@@ -132,11 +132,6 @@ export function shouldShowCodexFastBadge(
|
||||
return agentFlavor === 'codex' && isFastServiceTier(serviceTier)
|
||||
}
|
||||
|
||||
/** Cursor native ACP does not emit usage_update; hide the bar to avoid empty/misleading UI. */
|
||||
export function shouldShowComposerStatusBar(agentFlavor: string | null | undefined): boolean {
|
||||
return agentFlavor !== 'cursor'
|
||||
}
|
||||
|
||||
export function StatusBar(props: {
|
||||
active: boolean
|
||||
thinking: boolean
|
||||
|
||||
Reference in New Issue
Block a user