feat(frontend): enhance chat streaming visuals with shimmer effect and fade tail
- Introduce a shimmer effect for in-progress step titles in chat components, providing visual feedback during processing. - Implement a trailing fade effect for the most recently streamed characters in chat markdown, enhancing the typing experience. - Update CSS styles to support the new shimmer and fade effects, ensuring smooth transitions and visual coherence. - Add tests to verify the functionality of the shimmer effect and the application of the fade tail in markdown rendering.
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
<div class="action-header no-results">
|
||||
<div class="action-title">
|
||||
<t-icon class="action-title-icon" :name="step.iconName" />
|
||||
<span class="action-name">{{ step.title }}</span>
|
||||
<span class="action-name" :class="{ 'is-running': step.pending }">{{ step.title }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="step.summaryHtml" class="search-results-summary-fixed">
|
||||
@@ -114,7 +114,7 @@
|
||||
<div class="action-header no-results">
|
||||
<div class="action-title">
|
||||
<t-icon class="action-title-icon" :name="step.iconName" />
|
||||
<span class="action-name">{{ step.title }}</span>
|
||||
<span class="action-name" :class="{ 'is-running': step.pending }">{{ step.title }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="step.summaryHtml" class="search-results-summary-fixed">
|
||||
|
||||
@@ -85,6 +85,32 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Streaming Shimmer (in-progress step titles) -->
|
||||
<section class="test-section">
|
||||
<h2>Streaming Shimmer</h2>
|
||||
<p class="test-hint">
|
||||
The "light sweep" applied to in-progress step titles in
|
||||
AgentStreamDisplay / RagPipelineProgress. Running steps shimmer; finished ones are static.
|
||||
</p>
|
||||
<div class="test-case shimmer-demo">
|
||||
<div class="action-card action-pending">
|
||||
<div class="action-title">
|
||||
<span class="action-name">正在检索知识库…</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="action-card action-pending">
|
||||
<div class="action-title">
|
||||
<span class="action-name">正在生成回答…</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="action-card">
|
||||
<div class="action-title">
|
||||
<span class="action-name is-done">检索完成(静态对照)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Custom Editor -->
|
||||
<section class="test-section">
|
||||
<h2>Custom Input</h2>
|
||||
@@ -441,6 +467,7 @@ watch(customInput, () => {
|
||||
@import '../../components/css/chat-markdown.less';
|
||||
@import '../../components/css/chat-citations.less';
|
||||
@import '../../components/css/chat-message-shared.less';
|
||||
@import '../../components/css/chat-timeline-loading.less';
|
||||
|
||||
.markdown-test-page {
|
||||
max-width: 860px;
|
||||
@@ -594,6 +621,22 @@ watch(customInput, () => {
|
||||
}
|
||||
}
|
||||
|
||||
.shimmer-demo {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 14px;
|
||||
|
||||
.action-card {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.action-name {
|
||||
font-size: 14px;
|
||||
line-height: 1.55;
|
||||
color: var(--td-text-color-secondary);
|
||||
}
|
||||
}
|
||||
|
||||
// Chat answer markdown — shared with botmsg / AgentStreamDisplay / embed
|
||||
.markdown-content {
|
||||
// Dev page intentionally uses the same chat Markdown mixin as runtime chat.
|
||||
|
||||
Reference in New Issue
Block a user