Pathfinderby Commenda
AI elements

Markdown

A shared streaming-safe reply renderer with compact typography, code blocks, tables, and record references.

Q3 filings for Acme

Here is everything due this quarter. Two filings need your input, and one is already filed. See the filing calendar, or ask about Acme Pte Ltd.

What I checked

  • Your GST registration is active
  • Two ledger exports are missing
    • Sales ledger export
    • Purchase ledger export
  1. Upload both ledger exports
  2. Review the draft return
  3. Approve the filing

Returns are due one month after the end of each accounting period.

The filing ID is GSTF5-2026-Q3.

sql
-- Filings due this quarter
SELECT entity, filing, due_date
FROM filings
WHERE due_date < '2027-01-01'
  AND status = 'not_started'
ORDER BY due_date;
FilingEntityDueAmount
GST F5 return · Q3Acme Pte LtdOct 3112,400.00
Confirmation statementMeridian UK LtdNov 1413.00
VAT return · Q3Meridian UK LtdDec 78,240.50

Want me to draft a request to your bookkeeper for the two ledger exports?

Usage

Example.tsx
import { Markdown } from '@commenda/pathfinder/markdown';

<Markdown content={messagePart.text} isStreaming={status === 'streaming'} />;

Pass each text part without flattening tool calls, attachments, or other message parts into Markdown. The renderer needs no chat provider or AI SDK runtime.

Streaming

Incomplete fences and formatting remain readable while content arrives. Finished blocks use the same components and styles as static content.

References

Resolve known record URLs using application data. Pathfinder renders the reference and preview; the application supplies routing and data access.

Example.tsx
<Markdown
  content={messagePart.text}
  referenceConfig={{
    resolve: (href, label) =>
      href === '/entities/acme'
        ? {
            label,
            href,
            previewConfig: {
              title: 'Acme Pte Ltd',
              content: <EntitySummary entity={entity} />,
            },
          }
        : undefined,
  }}
/>;

Use an icon in the resolved reference to add the correct Pathfinder flag to an entity in a table. The renderer does not infer countries from names.

Tables

Tables use compact Pathfinder cell styles, a pinned first column, horizontal scrolling, copy as TSV, CSV/Markdown downloads, and an expanded dialog. Use Markdown alignment markers (---:) for numeric columns. Rich cell overrides can use existing Pathfinder cells; sorting, editing, and pagination belong in the standalone Table component.

API reference

PropTypeBehavior
contentConditionalstringRequired; choose one. children preserves the existing MessageResponse calling pattern
childrenConditionalstringRequired; choose one. children preserves the existing MessageResponse calling pattern
isStreamingbooleanEnables incomplete Markdown handling; defaults to false
isAnimatingbooleanCompatibility alias; explicit isStreaming wins. Does not add word animation
componentsMarkdownComponentsTyped overrides for prose, headings, links, lists, tables/cells, and images
referenceConfigObjectView fields—
codeConfigObjectView fields—
referenceConfigObject fields
FieldTypeRequirement
resolve(href: string, label: string) => InlineReferencePropsRequired
codeConfigObject fields
FieldTypeRequirement
showLineNumbersbooleanOptional

Custom renderers are trusted application code and own their accessibility and URL handling. Raw HTML is not a supported extension mechanism. Math, diagrams, custom tool cards, and executable previews are outside Phase 1; their fences render as code.

Design and accessibility rules

  • MARKDOWN-01: Body 13/20; h1/h2 use Heading/15, h3–h6 use Copy/13 Strong. Paragraph gaps 12px; lists 4px between items. No library-default typography.
  • MARKDOWN-02: Use this renderer for chat, briefing, and human threads. Keep the application's original message text.
  • MARKDOWN-03: Code is inert. Unsafe navigation schemes and executable HTML are not rendered. External links use native browser navigation; app-specific confirmation is an explicit link override.
  • MARKDOWN-REF-01: Record references have strong body text and a neutral underline. Preview data belongs to the application.
  • MARKDOWN-TABLE-01: Subtle tray, compact semantic table, pinned first column, copy/export/expand controls.
  • Streaming marks the content busy but does not announce every token. The conversation layer owns meaningful reply announcements.

Migration notes

Example.tsx
// Existing text and stream state can be reused without converting messages.
<Markdown isAnimating={isLiveAssistant && isLastSegment}>
  {segment.part.text}
</Markdown>;

components remains available. Product-specific question fences, math/Mermaid plugins, link-confirmation providers, and word animations are not silently copied; document those separately before migrating a consumer. See the AI content integration guide.

On this page