Commit fc12bfc3 authored by AI-甘富林's avatar AI-甘富林

样式修改

parent 7ca78b1b
......@@ -138,12 +138,12 @@ const IMAGE_ATTACHMENT_EXTENSIONS = new Set([".png", ".jpg", ".jpeg", ".webp", "
const DOCUMENT_ATTACHMENT_EXTENSIONS = new Set([".pdf", ".ppt", ".pptx", ".xls", ".xlsx", ".csv", ".tsv", ".doc", ".docx", ".txt", ".md", ".json", ".mp3"]);
const SUPPORTED_ATTACHMENT_EXTENSIONS = new Set([...IMAGE_ATTACHMENT_EXTENSIONS, ...DOCUMENT_ATTACHMENT_EXTENSIONS]);
const COMPOSER_ATTACHMENT_ACCEPT = [...SUPPORTED_ATTACHMENT_EXTENSIONS].join(",");
const COMPOSER_TEXTAREA_DEFAULT_MIN_HEIGHT = 48;
const COMPOSER_TEXTAREA_SAFE_MIN_HEIGHT = 38;
const COMPOSER_TEXTAREA_MAX_HEIGHT = 188;
const COMPOSER_TEXTAREA_DEFAULT_RATIO = 0.145;
const COMPOSER_TEXTAREA_MIN_RATIO = 0.12;
const COMPOSER_TEXTAREA_MAX_RATIO = 0.32;
const COMPOSER_TEXTAREA_DEFAULT_MIN_HEIGHT = 38;
const COMPOSER_TEXTAREA_SAFE_MIN_HEIGHT = 30;
const COMPOSER_TEXTAREA_MAX_HEIGHT = 150;
const COMPOSER_TEXTAREA_DEFAULT_RATIO = 0.116;
const COMPOSER_TEXTAREA_MIN_RATIO = 0.096;
const COMPOSER_TEXTAREA_MAX_RATIO = 0.256;
function getComposerTextareaBounds(workspaceHeight: number): { min: number; max: number } {
const safeWorkspaceHeight = Number.isFinite(workspaceHeight) && workspaceHeight > 0 ? workspaceHeight : 0;
......@@ -313,6 +313,24 @@ function buildUserMessage(content: string): UiChatMessage {
};
}
function formatMessageTimestamp(value: string): string {
const date = new Date(value);
if (Number.isNaN(date.getTime())) {
return value;
}
const pad = (part: number) => String(part).padStart(2, "0");
return [
date.getFullYear(),
pad(date.getMonth() + 1),
pad(date.getDate())
].join("-") + " " + [
pad(date.getHours()),
pad(date.getMinutes()),
pad(date.getSeconds())
].join(":");
}
function buildAssistantPlaceholder(statusLabel: string): UiChatMessage {
return {
id: createClientMessageId("assistant"),
......@@ -549,7 +567,7 @@ function renderExpertIcon(expertKey: ExpertVisualKey): ReactNode {
function getIntentSuggestionIcon(platform?: string): ReactNode {
const normalized = platform?.trim().toLowerCase();
if (normalized === "xiaohongshu") {
if (normalized === "xiaohongshu" || normalized === "xhs" || normalized === "rednote") {
return <RedBookIcon />;
}
if (normalized === "douyin") {
......@@ -2199,7 +2217,7 @@ export default function App() {
const [isComposerDragOver, setIsComposerDragOver] = useState(false);
const [isComposerResizeActive, setIsComposerResizeActive] = useState(false);
const [composerTextareaRatio, setComposerTextareaRatio] = useState(COMPOSER_TEXTAREA_DEFAULT_RATIO);
const [composerTextareaHeight, setComposerTextareaHeight] = useState(96);
const [composerTextareaHeight, setComposerTextareaHeight] = useState(77);
const [composerWorkspaceHeight, setComposerWorkspaceHeight] = useState(0);
const [copiedToken, setCopiedToken] = useState("");
const activeStreamRef = useRef<ActiveStreamState | null>(null);
......@@ -4773,6 +4791,7 @@ export default function App() {
</div>
) : null}
</div>
<span className="message-timestamp" aria-hidden="true">{formatMessageTimestamp(message.createdAt)}</span>
{message.role === "assistant" && canCopyMessage ? (
<div className="message-card-actions">
<button
......@@ -4825,7 +4844,7 @@ export default function App() {
</div>
);
const conversationStatusNotice = showInlineStartupNotice ? (
<div className={"notice" + (chatLaunchState === "error" ? " error" : " toast-notice")}>
<div className={"notice" + (chatLaunchState === "error" ? " error" : " toast-notice")} role={chatLaunchState === "error" ? "alert" : "status"} aria-live="polite">
{startupCurtainStatus}
</div>
) : null;
......@@ -4843,20 +4862,11 @@ export default function App() {
{pendingHomeIntentSuggestion.suggestion.projectDisplayName}
{ui.suggestionSwitchSuffix}
</p>
<span>
{pendingHomeIntentSuggestion.suggestion.reason}
{pendingHomeIntentSuggestion.suggestion.matchedAliases.length
? ` · ${pendingHomeIntentSuggestion.suggestion.matchedAliases.join(" / ")}`
: ""}
</span>
</div>
<div className="home-intent-suggestion-actions">
<button type="button" className="secondary" disabled={homeIntentDecisionPending} onClick={() => void continuePendingHomePromptInHome()}>
{ui.suggestionContinue}
</button>
<button type="button" className="secondary home-intent-suggestion-dismiss" disabled={homeIntentDecisionPending} onClick={dismissPendingHomeIntentSuggestion}>
{ui.suggestionDismiss}
</button>
<button type="button" disabled={homeIntentDecisionPending} onClick={() => void switchExpertAndContinuePendingHomePrompt()}>
{ui.suggestionSwitchAction}
</button>
......@@ -5155,8 +5165,8 @@ export default function App() {
</div>
</aside>
<div className={"main-shell" + (isConversationView ? " conversation-main-layout" : "") + (viewMode === "settings" ? " settings-main-shell" : "")}>
{infoText ? <div className="notice toast-notice">{infoText}</div> : null}
{errorText ? <div className="notice error">{errorText}</div> : null}
{infoText ? <div className="notice toast-notice" role="status" aria-live="polite">{infoText}</div> : null}
{errorText ? <div className="notice error" role="alert">{errorText}</div> : null}
<main className={"content-area" + (isConversationView ? " conversation-content-area" : "")}>
{isConversationView ? (
<section className="chat-panel conversation-panel">
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment