Skip to content

Commit

Permalink
gracefully handle summarization errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkeldenker committed Mar 1, 2024
1 parent a0e371b commit c9f48ca
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions frontend/src/routes/search/Summary.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,18 @@
</button>

<p class="line-clamp-3" aria-live="polite" aria-busy={inProgress ? 'true' : 'false'}>
{#if tokens.length > 0}
{#each tokens as tok}
<span transition:fade={{ duration: 500 }}>{tok}</span>
{/each}
{:else}
{#if inProgress && tokens.length === 0}
<span class="flex">
<span class="inline-block animate-bounce [animation-delay:000ms]">.</span>
<span class="inline-block animate-bounce [animation-delay:100ms]">.</span>
<span class="inline-block animate-bounce [animation-delay:200ms]">.</span>
</span>
{:else if !inProgress && tokens.length === 0}
<span>No summary available</span>
{:else}
{#each tokens as tok}
<span transition:fade={{ duration: 500 }}>{tok}</span>
{/each}
{/if}
</p>
</Callout>

0 comments on commit c9f48ca

Please sign in to comment.