forked from vhaudiquet/rhema-claw
feat(web/claw): a working line until the turn speaks
The web surface drops a turn's tool rows and thinking trace (only consent and attachment cards render), so the span between a turn's first event and its first text delta showed a bare name over empty space. Now a small ring plus `<agent> is working…` sits below where the reply will land, on screen exactly while `live.reply` is empty. The first delta takes the line away and the streaming cursor takes over from there; the two never show together. Text already streamed keeps the line gone for the rest of the turn, and a consent card waiting on the human does not stop it, the turn still being live. The gap between send and the turn's first event stays bare: no live block exists there yet, and that is the POST round-trip, not the model. The ring is a tokened CSS spinner, muted under the accent name, with role=status and a prefers-reduced-motion fallback to a static ring. Verified against a scripted claw (thinking_delta, tool_start, then a text_delta): the line shows through the tool phase and is gone with the cursor on the reply.
This commit is contained in:
1 parent
178d0af82b
commit
d306527792
1 file changed
+40
@@ -519,6 +519,10 @@ function streamTone(status: StreamStatus): 'ok' | 'warn' | 'error' {
|
|||||||
@download-attachment="(id, name) => emit('downloadAttachment', id, name)"
|
@download-attachment="(id, name) => emit('downloadAttachment', id, name)"
|
||||||
/>
|
/>
|
||||||
<AppMarkdown v-if="live.reply" :text="live.reply" streaming class="reply" />
|
<AppMarkdown v-if="live.reply" :text="live.reply" streaming class="reply" />
|
||||||
|
<p v-if="!live.reply" class="working" role="status">
|
||||||
|
<span class="spinner" aria-hidden="true" />
|
||||||
|
{{ agentName }} is working…
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -755,6 +759,42 @@ function streamTone(status: StreamStatus): 'ok' | 'warn' | 'error' {
|
|||||||
color: var(--accent-text);
|
color: var(--accent-text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* While the turn runs but no reply text has landed yet. Tool rows and
|
||||||
|
the thinking trace never render on this surface, so this line is the
|
||||||
|
turn's only pulse between its first event and its first delta — the
|
||||||
|
streaming cursor takes over once text arrives, and the line goes.
|
||||||
|
Reduced motion gets the static ring. */
|
||||||
|
.working {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
margin: 4px 0 0;
|
||||||
|
color: var(--text3);
|
||||||
|
font-size: 12.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.spinner {
|
||||||
|
flex: none;
|
||||||
|
width: 12px;
|
||||||
|
height: 12px;
|
||||||
|
border: 2px solid var(--border-strong);
|
||||||
|
border-top-color: var(--accent);
|
||||||
|
border-radius: 50%;
|
||||||
|
animation: spin 0.8s linear infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes spin {
|
||||||
|
to {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
.spinner {
|
||||||
|
animation: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* A consent card: the agent asking its human something — distinct
|
/* A consent card: the agent asking its human something — distinct
|
||||||
from a tool row, toned by its resolution. */
|
from a tool row, toned by its resolution. */
|
||||||
.consent-card {
|
.consent-card {
|
||||||
|
|||||||
Reference in new issue
Block a user