Skip to main content

Pattern · Composites

Result Grid

Application recipe composed from public TermRock building blocks; domain state and effects remain host-owned.

Kind
paint
Input
interactive
Canvas
120×40

Live preview

Loading terminal preview.

Static terminal poster. Choose Run live to start the Rust demo.

Ghosttyresult-grid/basic
Loading terminal poster…
○ loading posterNo input — rendered state only
Result Grid · exact mounted Rust story

01 · Purpose

What it is for

Application recipe composed from public TermRock building blocks; domain state and effects remain host-owned.

Best fit: Composites · composite · DataTable

02 · Behavior

What the mounted story proves

  1. 01

    ResultGrid

    Representative 120×40 terminal state.

  2. 02

    Passive paint

    No keyboard or pointer action is claimed by this representative story.

  3. 03

    Evidence stays explicit

    0 covered · 9 partial · 5 missing axes.

03 · Implement

Install, then start from exact code

Install

cargo add termrock --git https://github.com/tailrocks/termrock.git --rev 5283c2acf9154d0cfcd37b1ffe821c00faf90ea2

Add TermRock once. Keep domain effects in the host application.

Minimal implementation

Exact Rust setup used by result-grid/basic.

Open to load code.

04 · Adapt

Variants and composition

Public building blocks

DataTable

Supporting types

ColumnModel · ColumnPin · CopyPayload · DataColumn · DataColumnWidth · DataTableToolbar · FilterSpec · InspectorField · SortSpec · StatefulWidget

05 · Reference

API, tokens, accessibility

API

ResultGridOpen source ↗

Tokens

DesignSystemInspect exact story code for roles and capability projection.

Accessibility

Input contract mountedNo input claim in the representative story.

Contract

Evidence in progress0/23 axes covered

06 · Go deeper

Advanced guidance

Authored implementation guidance

Database / query result component built on DataTable. Host projects a visible window of typed cells; TermRock paints safe display, status/stats chrome, and emits export / inspect / page / edit requests.

When to use / when not

Use ResultGridPrefer
SQL / analytics query results—
Generic interactive gridDataTable
Display-only moderate tableTable
Structured object treeObjectInspector

Ownership

ConcernOwner
Execute query, page, decode typesHost
Safe null / binary / secret displayResultGrid format helpers
Selection, sort chrome, virtual windowEmbedded DataTableState
Clipboard / file exportHost via outcomes

Typed cells

ResultCellKind: Null · Bool · Integer · Float · Text · Binary · Json · Timestamp · Uuid · Secret · Other.

Binary never dumps raw bytes by default (blob(N B)). Secrets render as •••• until host allows ResultRedaction::RevealSecrets.

ObjectInspector bridge

result_row_to_inspector_fields(schema, row, redaction, ascii) projects a row into inspector fields for cell detail panels.

Outcomes (requests)

  • Export (CSV/TSV/JSON/Markdown) · Copy
  • Inspect · Cell detail
  • Page next/prev · Refresh · Retry
  • Edit start/commit · Sort · Stats focus
  • Reveal secrets toggle
Ownership boundary

TermRock owns reusable terminal rendering and interaction state. The host owns domain data, policy, persistence, authorization, and side effects.

Evidence status

0 covered, 9 partial, and 5 missing contract axes. Missing evidence is not a behavior claim.