fix: polish streaming state and ui controls

This commit is contained in:
JOJO 2025-11-30 00:54:55 +08:00
parent 87ceaad92b
commit 3a7ed2e042
7 changed files with 23 additions and 15 deletions

View File

@ -940,9 +940,10 @@ const appOptions = {
if (action.tool.awaiting_content) {
return true;
}
const status = typeof action.tool.status === 'string'
? action.tool.status.toLowerCase()
: '';
const status =
typeof action.tool.status === 'string'
? action.tool.status.toLowerCase()
: '';
return !status || ['preparing', 'running', 'pending', 'queued'].includes(status);
});
});

View File

@ -82,9 +82,7 @@
@click="$emit('toggle-workspace')"
>
<span class="sr-only">{{ workspaceCollapsed ? '显示工作区' : '隐藏工作区' }}</span>
<span class="workspace-immersive-icon" aria-hidden="true">
<img :src="workspaceToggleIcon" alt="" />
</span>
<span class="workspace-immersive-icon icon" aria-hidden="true" :style="iconStyle('layers')"></span>
<span v-if="!collapsed" class="workspace-immersive-label">
{{ workspaceCollapsed ? '显示工作区' : '隐藏工作区' }}
</span>
@ -227,5 +225,4 @@ const iconStyle = (key: string) => (props.iconStyle ? props.iconStyle(key) : {})
const resolvedShowCollapseButton = computed(() => props.showCollapseButton);
const resolvedCollapseButtonVariant = computed(() => props.collapseButtonVariant);
const workspaceToggleIcon = new URL('../../../icons/layers.svg', import.meta.url).href;
</script>

View File

@ -140,7 +140,11 @@ export async function initializeLegacySocket(ctx: any) {
const action = ensureActiveTextAction();
if (action) {
action.streaming = false;
action.content = fullContent;
const fallback =
(typeof fullContent === 'string' && fullContent.length
? fullContent
: action.content) || '';
action.content = fallback;
}
msg.streamingText = '';
msg.currentStreamingType = null;

View File

@ -264,7 +264,9 @@ export const useChatStore = defineStore('chat', {
const action = msg.actions[i];
if (action.type === 'text' && action.streaming) {
action.streaming = false;
action.content = fullContent;
if (typeof fullContent === 'string' && fullContent.length) {
action.content = fullContent;
}
break;
}
}

View File

@ -197,6 +197,11 @@
font-size: 13px;
line-height: 1.6;
color: var(--claude-text-secondary);
scrollbar-width: none;
}
.thinking-content::-webkit-scrollbar {
display: none;
}
.collapsible-block {

View File

@ -86,7 +86,9 @@
padding: 10px 14px;
cursor: pointer;
font-size: 13px;
transition: color 0.2s ease, background-color 0.2s ease;
transition:
color 0.2s ease,
transform 0.2s ease;
}
.workspace-immersive-btn .workspace-immersive-icon {
@ -97,11 +99,6 @@
justify-content: center;
}
.workspace-immersive-btn .workspace-immersive-icon img {
width: 100%;
height: 100%;
}
.workspace-immersive-btn .workspace-immersive-label {
font-size: 13px;
font-weight: 500;
@ -111,6 +108,7 @@
.workspace-immersive-btn:focus-visible {
color: var(--claude-accent);
outline: none;
transform: translateY(-1px);
}
.workspace-immersive-btn.active {

View File

@ -17,6 +17,7 @@ export const ICONS = Object.freeze({
hammer: '/static/icons/hammer.svg',
info: '/static/icons/info.svg',
laptop: '/static/icons/laptop.svg',
layers: '/static/icons/layers.svg',
menu: '/static/icons/menu.svg',
monitor: '/static/icons/monitor.svg',
octagon: '/static/icons/octagon.svg',