Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

fix(frontend): announce RAG wait status from a persistent live region

lyingbugfcc4cd6a9f29
diff --git a/frontend/src/views/chat/components/RagPipelineProgress.style.test.mjs b/frontend/src/views/chat/components/RagPipelineProgress.style.test.mjs
index de591cb77..b29b837ee 100644
--- a/frontend/src/views/chat/components/RagPipelineProgress.style.test.mjs
+++ b/frontend/src/views/chat/components/RagPipelineProgress.style.test.mjs
@@ -69,6 +69,14 @@ test('rag pipeline shows a pending model-answer step after retrieval completes',
assert.match(source, /waitController\.dispose\(\)/)
})
+test('rag pipeline announces wait status from a region that outlives each row', () => {
+ const template = source.split('<script')[0]
+ assert.match(template, /class="sr-only" role="status" aria-live="polite"/)
+ assert.equal((template.match(/aria-live/g) || []).length, 1)
+ assert.match(source, /liveStatusText/)
+ assert.match(source, /\.sr-only \{[\s\S]*clip: rect\(0, 0, 0, 0\)/)
+})
+
test('done row appears only after the full turn completes', () => {
assert.match(source, /const showDoneRow = computed\(\(\) => \{[\s\S]*hasAnswer\.value/)
})
diff --git a/frontend/src/views/chat/components/RagPipelineProgress.vue b/frontend/src/views/chat/components/RagPipelineProgress.vue
index 0773e252a..7e75ef524 100644
--- a/frontend/src/views/chat/components/RagPipelineProgress.vue
+++ b/frontend/src/views/chat/components/RagPipelineProgress.vue
@@ -1,5 +1,9 @@
<template>
<div v-if="visible" ref="rootElement" class="rag-pipeline-progress">
+ <!-- Announcements need a region that outlives each wait row, otherwise screen
+ readers miss a live region that appears together with its own text. -->
+ <div class="sr-only" role="status" aria-live="polite">{{ liveStatusText }}</div>
+
<div v-if="showPrePipelineWait" class="tree-children">
<div class="tree-child tree-child-last streaming-loading-node">
<div class="tree-branch" />
@@ -411,6 +415,12 @@ const visible = computed(
() => steps.value.length > 0 || showPrePipelineWait.value || showThinkingStep.value,
)
+const liveStatusText = computed(() => {
+ if (showPrePipelineWait.value) return t('chat.preparingAnswer')
+ if (showWaitStep.value) return waitStepText.value
+ return ''
+})
+
const collapsedStatusText = computed(() => {
if (steps.value.length === 0) {
return hasThinking.value ? t('agentStream.toolStatus.thinkingDone') : ''
@@ -511,6 +521,18 @@ onBeforeUnmount(() => {
margin: 0;
}
+.sr-only {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ padding: 0;
+ margin: -1px;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ white-space: nowrap;
+ border: 0;
+}
+
.tree-container {
margin: 0 0 8px;
position: relative;