feat: 清除header的阴影;取消发送按钮的空值disabled检查;新增删除clearSkill,tag的逻辑;
This commit is contained in:
parent
32f581cf50
commit
7e3901fe21
|
|
@ -90,13 +90,15 @@ export default function ChatPage() {
|
|||
"absolute top-0 right-0 left-0 z-30 mx-[20px] grid h-[58px] shrink-0 grid-cols-3 items-center rounded-t-[20px] border-b py-[15px]",
|
||||
isNewThread
|
||||
? "bg-background/0 backdrop-blur-none"
|
||||
: "bg-background/80 shadow-xs backdrop-blur",
|
||||
: "bg-background/80 backdrop-blur",
|
||||
)}
|
||||
>
|
||||
{/* 返回查看结果左箭头 */}
|
||||
<div className="flex h-full w-full items-center text-sm font-medium">
|
||||
<button
|
||||
className="bg-transparent"
|
||||
<Button
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
className="h-full px-[10px] py-[5px] text-sm font-medium"
|
||||
onClick={() => setShowExitDialog(true)}
|
||||
>
|
||||
<svg
|
||||
|
|
@ -114,7 +116,7 @@ export default function ChatPage() {
|
|||
strokeLinejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
</Button>
|
||||
</div>
|
||||
<div className="flex h-full w-full items-center justify-center overflow-hidden text-sm font-medium">
|
||||
<ThreadTitle threadId={threadId} thread={thread} />
|
||||
|
|
|
|||
|
|
@ -1077,18 +1077,23 @@ export const PromptInputSubmit = ({
|
|||
: false;
|
||||
|
||||
// 正在 streaming 时不允许发送
|
||||
const isStreaming = status === "streaming" || status === "submitted";
|
||||
// const isStreaming = status === "streaming" || status === "submitted";
|
||||
|
||||
const isDisabled = disabled || !hasContent || isStreaming;
|
||||
// const isDisabled = disabled || !hasContent || isStreaming;
|
||||
|
||||
let Icon = <ArrowUpIcon className="size-4" />;
|
||||
|
||||
let text: string = "发送";
|
||||
|
||||
if (status === "submitted") {
|
||||
Icon = <Loader2Icon className="size-4 animate-spin" />;
|
||||
text = "生成中...";
|
||||
} else if (status === "streaming") {
|
||||
Icon = <SquareIcon className="size-4" />;
|
||||
text = "停止";
|
||||
} else if (status === "error") {
|
||||
Icon = <XIcon className="size-4" />;
|
||||
text = "错误";
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
@ -1097,19 +1102,19 @@ export const PromptInputSubmit = ({
|
|||
// 被button{bgc:#fff}覆盖了,只能加"!"
|
||||
className={cn(
|
||||
"h-[40px] w-[140px] rounded-[10px] border-0 font-bold transition-all",
|
||||
isDisabled
|
||||
? "cursor-not-allowed !bg-gray-200 text-gray-400"
|
||||
: "!bg-[#F0E8FB] text-[#8E47F0] hover:!bg-[#8E47F0] hover:text-[#FFFFFF]",
|
||||
// isDisabled
|
||||
// ? "cursor-not-allowed !bg-gray-200 text-gray-400":
|
||||
"!bg-[#F0E8FB] text-[#8E47F0] hover:!bg-[#8E47F0] hover:text-[#FFFFFF]",
|
||||
className,
|
||||
)}
|
||||
size={size}
|
||||
type="submit"
|
||||
variant={variant}
|
||||
disabled={isDisabled}
|
||||
// disabled={isDisabled}
|
||||
{...props}
|
||||
>
|
||||
{children ?? Icon}
|
||||
发送
|
||||
{/* {children ?? Icon} */}
|
||||
{text}
|
||||
</InputGroupButton>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -826,7 +826,7 @@ export function InputBox({
|
|||
variant="outline"
|
||||
status={status}
|
||||
/>
|
||||
{/* TODO: 神秘空div */}
|
||||
{/* MARK: 神秘空div */}
|
||||
{/* {!isNewThread && (
|
||||
<div className="bg-background absolute right-0 -bottom-[17px] left-0 z-0 h-4"></div>
|
||||
)} */}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ export const enUS: Translations = {
|
|||
delete: "Delete",
|
||||
rename: "Rename",
|
||||
share: "Share",
|
||||
fullScreen: "fullScreen",
|
||||
closeFullScreen: "closeFullScreen",
|
||||
openInNewWindow: "Open in new window",
|
||||
close: "Close",
|
||||
more: "More",
|
||||
|
|
|
|||
|
|
@ -60,9 +60,13 @@ export function useIframeSkill(): UseIframeSkillReturn {
|
|||
window.parent.postMessage(message, "*");
|
||||
}, []);
|
||||
|
||||
// 清除选中
|
||||
// 清除选中并发送 skill_id=0 给主页
|
||||
const clearSkill = useCallback(() => {
|
||||
setSelectedSkill(null);
|
||||
// 发送 skill_id=0 给主页,通知取消选择
|
||||
const message = { type: MESSAGE_TYPES.SELECT_SKILL, skill_id: "0" };
|
||||
console.log("[useIframeSkill] clearSkill, sending skill_id=0:", message);
|
||||
window.parent.postMessage(message, "*");
|
||||
}, []);
|
||||
|
||||
return { selectedSkill, sendSelectSkill, openSkillDialog, clearSkill };
|
||||
|
|
|
|||
Loading…
Reference in New Issue