mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
feat: add retired-provider warning banner in chat view
This commit is contained in:
parent
aebcaa263e
commit
dd593e1056
1 changed files with 19 additions and 5 deletions
|
|
@ -13,6 +13,7 @@ import { appendImages } from "@src/utils/imageUtils"
|
|||
import { getCostBreakdownIfNeeded } from "@src/utils/costFormatting"
|
||||
|
||||
import type { ClineAsk, ClineSayTool, ClineMessage, ExtensionMessage, AudioType } from "@roo-code/types"
|
||||
import { isRetiredProvider } from "@roo-code/types"
|
||||
|
||||
import { findLast } from "@roo/array"
|
||||
import { SuggestionItem } from "@roo-code/types"
|
||||
|
|
@ -226,6 +227,11 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
|
|||
[apiConfiguration, organizationAllowList],
|
||||
)
|
||||
|
||||
const isRetiredProviderActive = useMemo(
|
||||
() => !!apiConfiguration?.apiProvider && isRetiredProvider(apiConfiguration.apiProvider),
|
||||
[apiConfiguration?.apiProvider],
|
||||
)
|
||||
|
||||
// UI layout depends on the last 2 messages (since it relies on the content
|
||||
// of these messages, we are deep comparing) i.e. the button state after
|
||||
// hitting button sets enableButtons to false, and this effect otherwise
|
||||
|
|
@ -1515,7 +1521,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
|
|||
|
||||
if (enableButtons && primaryButtonText) {
|
||||
handlePrimaryButtonClick(inputValue, selectedImages)
|
||||
} else if (!sendingDisabled && !isProfileDisabled && hasInput) {
|
||||
} else if (!sendingDisabled && !isProfileDisabled && !isRetiredProviderActive && hasInput) {
|
||||
handleSendMessage(inputValue, selectedImages)
|
||||
}
|
||||
},
|
||||
|
|
@ -1596,6 +1602,12 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
|
|||
<CheckpointWarning warning={checkpointWarning} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{isRetiredProviderActive && (
|
||||
<div className="px-3">
|
||||
<RetiredProviderWarning />
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
) : (
|
||||
<div className="flex flex-col h-full justify-center p-6 min-h-0 overflow-y-auto gap-4 relative">
|
||||
|
|
@ -1757,7 +1769,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
|
|||
ref={textAreaRef}
|
||||
inputValue={inputValue}
|
||||
setInputValue={setInputValue}
|
||||
sendingDisabled={sendingDisabled || isProfileDisabled}
|
||||
sendingDisabled={sendingDisabled || isProfileDisabled || isRetiredProviderActive}
|
||||
selectApiConfigDisabled={sendingDisabled && clineAsk !== "api_req_failed"}
|
||||
placeholderText={placeholderText}
|
||||
selectedImages={selectedImages}
|
||||
|
|
@ -1780,9 +1792,11 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
|
|||
onEnqueueMessage={handleEnqueueCurrentMessage}
|
||||
/>
|
||||
|
||||
<div className="px-3">
|
||||
<RetiredProviderWarning />
|
||||
</div>
|
||||
{isRetiredProviderActive && !task && (
|
||||
<div className="px-3">
|
||||
<RetiredProviderWarning />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{isProfileDisabled && (
|
||||
<div className="px-3">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue