fix: polish streaming state and ui controls
This commit is contained in:
parent
87ceaad92b
commit
3a7ed2e042
@ -940,9 +940,10 @@ const appOptions = {
|
|||||||
if (action.tool.awaiting_content) {
|
if (action.tool.awaiting_content) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
const status = typeof action.tool.status === 'string'
|
const status =
|
||||||
? action.tool.status.toLowerCase()
|
typeof action.tool.status === 'string'
|
||||||
: '';
|
? action.tool.status.toLowerCase()
|
||||||
|
: '';
|
||||||
return !status || ['preparing', 'running', 'pending', 'queued'].includes(status);
|
return !status || ['preparing', 'running', 'pending', 'queued'].includes(status);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -82,9 +82,7 @@
|
|||||||
@click="$emit('toggle-workspace')"
|
@click="$emit('toggle-workspace')"
|
||||||
>
|
>
|
||||||
<span class="sr-only">{{ workspaceCollapsed ? '显示工作区' : '隐藏工作区' }}</span>
|
<span class="sr-only">{{ workspaceCollapsed ? '显示工作区' : '隐藏工作区' }}</span>
|
||||||
<span class="workspace-immersive-icon" aria-hidden="true">
|
<span class="workspace-immersive-icon icon" aria-hidden="true" :style="iconStyle('layers')"></span>
|
||||||
<img :src="workspaceToggleIcon" alt="" />
|
|
||||||
</span>
|
|
||||||
<span v-if="!collapsed" class="workspace-immersive-label">
|
<span v-if="!collapsed" class="workspace-immersive-label">
|
||||||
{{ workspaceCollapsed ? '显示工作区' : '隐藏工作区' }}
|
{{ workspaceCollapsed ? '显示工作区' : '隐藏工作区' }}
|
||||||
</span>
|
</span>
|
||||||
@ -227,5 +225,4 @@ const iconStyle = (key: string) => (props.iconStyle ? props.iconStyle(key) : {})
|
|||||||
const resolvedShowCollapseButton = computed(() => props.showCollapseButton);
|
const resolvedShowCollapseButton = computed(() => props.showCollapseButton);
|
||||||
const resolvedCollapseButtonVariant = computed(() => props.collapseButtonVariant);
|
const resolvedCollapseButtonVariant = computed(() => props.collapseButtonVariant);
|
||||||
|
|
||||||
const workspaceToggleIcon = new URL('../../../icons/layers.svg', import.meta.url).href;
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -140,7 +140,11 @@ export async function initializeLegacySocket(ctx: any) {
|
|||||||
const action = ensureActiveTextAction();
|
const action = ensureActiveTextAction();
|
||||||
if (action) {
|
if (action) {
|
||||||
action.streaming = false;
|
action.streaming = false;
|
||||||
action.content = fullContent;
|
const fallback =
|
||||||
|
(typeof fullContent === 'string' && fullContent.length
|
||||||
|
? fullContent
|
||||||
|
: action.content) || '';
|
||||||
|
action.content = fallback;
|
||||||
}
|
}
|
||||||
msg.streamingText = '';
|
msg.streamingText = '';
|
||||||
msg.currentStreamingType = null;
|
msg.currentStreamingType = null;
|
||||||
|
|||||||
@ -264,7 +264,9 @@ export const useChatStore = defineStore('chat', {
|
|||||||
const action = msg.actions[i];
|
const action = msg.actions[i];
|
||||||
if (action.type === 'text' && action.streaming) {
|
if (action.type === 'text' && action.streaming) {
|
||||||
action.streaming = false;
|
action.streaming = false;
|
||||||
action.content = fullContent;
|
if (typeof fullContent === 'string' && fullContent.length) {
|
||||||
|
action.content = fullContent;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -197,6 +197,11 @@
|
|||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
color: var(--claude-text-secondary);
|
color: var(--claude-text-secondary);
|
||||||
|
scrollbar-width: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.thinking-content::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.collapsible-block {
|
.collapsible-block {
|
||||||
|
|||||||
@ -86,7 +86,9 @@
|
|||||||
padding: 10px 14px;
|
padding: 10px 14px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 13px;
|
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 {
|
.workspace-immersive-btn .workspace-immersive-icon {
|
||||||
@ -97,11 +99,6 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.workspace-immersive-btn .workspace-immersive-icon img {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.workspace-immersive-btn .workspace-immersive-label {
|
.workspace-immersive-btn .workspace-immersive-label {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
@ -111,6 +108,7 @@
|
|||||||
.workspace-immersive-btn:focus-visible {
|
.workspace-immersive-btn:focus-visible {
|
||||||
color: var(--claude-accent);
|
color: var(--claude-accent);
|
||||||
outline: none;
|
outline: none;
|
||||||
|
transform: translateY(-1px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.workspace-immersive-btn.active {
|
.workspace-immersive-btn.active {
|
||||||
|
|||||||
@ -17,6 +17,7 @@ export const ICONS = Object.freeze({
|
|||||||
hammer: '/static/icons/hammer.svg',
|
hammer: '/static/icons/hammer.svg',
|
||||||
info: '/static/icons/info.svg',
|
info: '/static/icons/info.svg',
|
||||||
laptop: '/static/icons/laptop.svg',
|
laptop: '/static/icons/laptop.svg',
|
||||||
|
layers: '/static/icons/layers.svg',
|
||||||
menu: '/static/icons/menu.svg',
|
menu: '/static/icons/menu.svg',
|
||||||
monitor: '/static/icons/monitor.svg',
|
monitor: '/static/icons/monitor.svg',
|
||||||
octagon: '/static/icons/octagon.svg',
|
octagon: '/static/icons/octagon.svg',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user