ArcanaWeb.ChunkResultsComponent (Arcana v2.0.1)

Copy Markdown View Source

Shared component for rendering retrieved chunks across the Advanced, Pipeline, and Loop sub-tabs of the Ask dashboard.

Features

  • Groups chunks by document with a compact header per document.
  • Shows document titles when available (falls back to a shortened UUID).
  • Click-to-expand details for each chunk, revealing the full text.
  • When :grounding is supplied, centers the snippet around the text the grounder cited from this chunk (instead of the first N chars).
  • Highlights chunks that the grounder used as a source.
  • Score rendered as score: 0.0246.

Usage

<ChunkResultsComponent.chunk_results
  chunks={@ask_context.results}
  document_titles={@ask_context.document_titles || %{}}
  grounding={Map.get(@ask_context, :grounding)}
  id="ask-chunks"
/>

Summary

Functions

chunk_results(assigns)

Attributes

  • chunks (:list) (required) - List of chunk maps with id/text/score/document_id/chunk_index.
  • document_titles (:map) - Map of document_id to display title. Defaults to %{}.
  • grounding (:any) - Optional %Arcana.Grounding.Result{}. Defaults to nil.
  • id (:string) - Defaults to "chunk-results".