`codeOnly` where the listed facts already stand above it, in the explanation card. The * source does not push the first graph facts out: a listed answer shows both (K14).
({ packet, citation, codeOnly = false, language = 'en' }: { packet: PreparedExplanationContext; citation?: ReturnType<typeof citedInterpretation>; codeOnly?: boolean; language?: 'en' | 'de' })
| 159 | /** `codeOnly` where the listed facts already stand above it, in the explanation card. The |
| 160 | * source does not push the first graph facts out: a listed answer shows both (K14). */ |
| 161 | function PacketSource({ packet, citation, codeOnly = false, language = 'en' }: { packet: PreparedExplanationContext; citation?: ReturnType<typeof citedInterpretation>; codeOnly?: boolean; language?: 'en' | 'de' }): JSX.Element { |
| 162 | const code = packet.evidence.filter(item => item.source === 'code').slice(0, 3); |
| 163 | const facts = codeOnly ? [] : packet.evidence.filter(item => item.source !== 'code').slice(0, 3); |
| 164 | return <> |
| 165 | {packet.limitations.map((limit, index) => <p className="cbm-chat-evidence-note" key={index}>{evidenceNote(limit, language)}</p>)} |
| 166 | {citation ? <pre>{citation.quote}</pre> : [...code, ...facts].map(item => <div key={item.id}> |
| 167 | {item.location && <small>{item.location.path}:{item.location.startLine}-{item.location.endLine}</small>}<pre>{item.text}</pre> |
| 168 | </div>)} |
| 169 | </>; |
| 170 | } |
| 171 | |
| 172 | /** A typed limit applies on blur or Enter, clamped into the model policy. */ |
| 173 | function TokenLimitField({ id, label, value, min, max, step, onCommit }: { id: string; label: string; value: number; min: number; max: number; step: number; onCommit: (value: number) => void }): JSX.Element { |
nothing calls this directly
no test coverage detected