Skip to main content

Crate gpui_kit_grid

Crate gpui_kit_grid 

Source
Expand description

gpui-kit-grid: a live-updating data grid for gpui-kit applications.

The core: a background ingest that owns the rows, background projection rebuilds, a custom-painted body with a colour-free text cache, and change highlight on a global tick.

GridWriter (any thread) → ingest task → StoreSnapshot → LiveGridState (view)
                                                      → Rebuild (background) → Projection

Re-exports§

pub use actions::init;

Modules§

actions
Commands of the grid, as GPUI Actions in the live_grid namespace, and its default key bindings.

Structs§

AggregateOrder
Groups by the aggregate of a column: the column needs an aggregate in the view. Ties, and groups without the aggregate, keep the key order.
AggregateRow
The aggregates of one group, or of the whole view for the totals: a view into the projection.
AggregateStyleContext
What LiveGridDelegate::aggregate_style knows about a visible aggregate cell.
AppendNewColumns
The default LayoutMerge: saved columns keep their order, width, visibility and zone; columns the schema no longer has are ignored, and a repeated id keeps its first entry. Schema columns the layout does not have go to the end of their zone, in schema order, with schema defaults.
AssetImageSource
The default image source: GPUI’s image loader (Window::use_asset::<ImgResourceLoader>), which reads and decodes in the background, renders an SVG in its own colours, and repaints the grid when an image is ready. An animated GIF shows its first frame.
AutofitContext
What an AutofitPolicy can measure for one column. Widths are text widths, without cell padding.
BackgroundRunner
Runs jobs on GPUI’s background executor.
BandInfo
A header band over a column.
BandedMove
A band stays together: a column moves only among the children of its innermost band, a band moves as a whole, and a zone change takes the whole top-level band.
Branch
A shown tree row with shown children.
CaptionTag
A tag before a group caption’s text: a pill in the application’s colours, such as a transit line’s, whose text LiveGridDelegate::group_caption_tag writes.
CellChange
A highlighted change of a cell: a data cell’s, a pinned cell’s, an aggregate cell’s, or every cell of a removed row while it fades out (RowChange::Removed, with HighlightPolicy::with_removal_fade).
CellEditHandle
Commits values of one cell from a handler of its element, such as a checkbox’s on_click or on_activate: the same path as an editor’s commit with no field. From CellElementContext::edit. Cheap to clone. Call it from an event handler, outside the grid’s update, never from render_cell.
CellElementContext
What LiveGridDelegate::render_cell knows about a visible cell of an Element or Control column.
CellStyle
Style of one cell, filled by the grid’s change paint (ChangePaint) and then by LiveGridDelegate::cell_style. Unset fields use the theme.
CellStyleContext
What LiveGridDelegate::cell_style knows about a cell.
CellTexts
The display text of the quick filter columns of one row, as the body paints it. Empty and Bool cells have no searchable text and are left out: the body shows Bool only as a check mark. An Icon cell is searched by its text.
CellTooltip
Tooltip content of a cell or a header cell: text, or an element built each time the tooltip draws.
CellTooltipContext
What LiveGridDelegate::tooltip knows about the hovered cell.
ChangePalette
The theme colours a ChangePainter works with, read once per frame. No colours of its own: semantic tokens of the theme.
ChangeSet
What changed between two snapshots, accumulated per subscriber.
CheckboxEditor
Toggles a Bool cell at once, with no field: F2, a double click on a Text column and a call commit the opposite value (Bool(true) for an empty cell) as EditorOpen::Commit, with no EditStart. Typing, Backspace and Delete take no edit. On a Control column the checkbox element toggles itself through CellElementContext::edit, Space included (on_activate).
ColumnBand
A titled header band over columns and nested bands (a multi-level header).
ColumnChooserContext
What a ColumnChooserFactory knows.
ColumnChooserPanel
The column chooser: a searchable list of the grid’s columns, by zone and band, with a checkbox to show or hide each and a grip to reorder. Changes apply at once, one LayoutChange { origin: User } each.
ColumnId
A stable column identifier for persisted layouts: the value of GridColumns::id. Unlike ColumnIx it survives schema changes, so saved layouts and sort keys refer to columns by it. Not for the hot path.
ColumnInfo
A schema column as the grid shows it now.
ColumnIx
The index of a column in the schema. Stable for the schema’s lifetime and used on the hot path. Persisted layouts use ColumnId instead.
ColumnMoveContext
One zone of the column layout, as a ColumnMovePolicy sees it.
ColumnOrder
The whole column order, as ColumnMovePolicy::normalize may change it: it can only reorder columns and change their zones. The grid then sorts the order by zone, keeping the order within each zone.
ColumnSet
A set of columns, up to 128.
ContainsAllTerms
Every whitespace-separated term occurs, ignoring case, in some column, as in AG Grid’s quick filter. Terms may occur in different columns.
ContainsAllTermsQuery
ContainsAllTerms compiled: lowercase terms without repeats. Without terms every row passes.
ContextMenuGestureContext
What a ContextMenuGesture knows about a press.
CsvFormat
Comma-separated values as RFC 4180 has them: fields separated by ,, every line ended by CRLF, a field in quotes when it holds the separator, a quote, CR or LF, inner quotes doubled. Leading and trailing spaces are kept without quotes.
DateEditor
Edits a Timestamp cell with a calendar under it.
DirectionalChanges
Paints the direction of an updated number: a rise in success, a fall in danger, each with an arrow (CellStyle::set_trend); an update without a direction in warning without one. Inserted and removed rows as UniformChanges.
DisplayedCells
The text painted in the cell: the same function the body paints with (Float with its column’s decimals, Bool(true) as “✓”). A summary cell is written by its value as any other: an aggregate Float as 1234.50.
DragPayload
Application data riding along a drag, and the label of its ghost.
DropBetweenRows
Before or after a data row by the half the pointer is in; in a tree the top third is before, the middle onto, the bottom third after. Onto group captions. Below the rows, after the last one; an empty grid takes Empty. Refuses in a sorted flat view, where a place between rows would not hold.
DropOnRows
Onto data rows (tree rows too), group captions and the empty area below the rows; any source.
EditError
Why a value is refused: the editor could not parse it, the delegate’s validate_edit refused it, or the application rejected the commit.
EditGestureContext
What an EditGesture knows about an input on a cell that could edit it: a cell of a column with an editor that the delegate’s is_editable lets edit.
EditId
One commit, until LiveGridState::resolve_edit answers it. Opaque, unique within its grid.
EditMessageContext
What LiveGridDelegate::render_edit_message knows about the open editor’s message.
EditPolicyContext
What an EditPolicy knows about the open edit.
EditValidateContext
What LiveGridDelegate::validate_edit knows about a commit.
EditableContext
What LiveGridDelegate::is_editable knows about a cell.
EditorCell
What an EditorField knows about its cell when it renders.
EditorStart
What a CellEditor knows about a start.
EveryGroupFooter
Every group has a footer.
ExpandGestureContext
What an ExpandGesture knows about a press.
Expansion
The expansion a projection is laid out for: the default depth, and the groups and tree rows the user toggled against it. The grid owns it, as it owns the quick filter, and sets it into each view (ViewSpec::expansion).
ExportCell
One exported cell: what a CellExporter writes.
ExportColumn
A column of an ExportTable: the application column, its header text, and how the grid shows it, for a spreadsheet format to match.
ExportControl
The progress and cancellation of one export, shared between the job that writes it and the application that waits for it. Clones share them.
ExportJob
A running export: its progress, its cancellation and, as a Future, its result.
ExportLines
A set of ExportLines: the lines a LineFilter writes.
ExportOutcome
A finished export: what it made, and how much it wrote.
ExportProgress
The rows an export has written of the rows it writes.
ExportRequest
What an export takes from the grid: the scope, the header line, the columns and how a text cell is written.
ExportRow
A row of an ExportTable: a row of the application, or a summary row of a grouped view (ExportLine).
ExportTable
The rows and columns an Exporter turns into text and an ExportFormat into a file.
FlushOutcome
What LiveGridState::flush waited for.
FocusBranches
Branches as captions: a tree row with shown children (a branch) takes the focus but not the selection, as a group caption does, and a command over one acts on the leaves of its subtree that pass the view, those under collapsed branches too, in the order of Projection::rows, with every column. Cmd/Ctrl+A, Shift ranges and drags leave branches out. Group captions and leaves behave as with FocusCaptions.
FocusCaptions
Captions take the focus, never the selection; a command over a caption acts on every live row of its group, collapsed subgroups included, in the order of Projection::rows, with every column. Data rows, tree rows with children included, are selectable, and a command over one acts on scoped_selection(). The default.
FocusedCell
The focused cell: the keyboard target inside the grid, a cell of a data row or a group caption.
FollowLiveValue
As StandardEditPolicy, but a draft the user has not touched follows the store: a new value replaces it (DraftAction::Replace); a touched draft is kept and shows the conflict.
FreeMove
Any column moves anywhere in its zone, out of its band too: a band then shows one header cell per run of its columns, as AG Grid does.
GridColumn
A column of the grid schema.
GridLayout
A saved grid layout: the columns by ColumnId in display order, each with its width, visibility and zone, the sort, and the grouping with the expansion of its groups.
GridMenuContext
What LiveGridDelegate::context_menu and LiveGridDelegate::primary_command know: the target, the command scope and the rows of the snapshot shown when the menu opened.
GridProgress
Progress of work the grid waits for: a load, a reload, a recalculation.
GridSchema
The columns shown by a grid, in their initial display order, with their header bands.
GridSelection
The selected rows or cells, by key. Cloning is O(1): the set is shared and copied on write.
GridStats
Counters for profiling a grid.
GridStore
The rows of one or more grids. Cloning shares the store.
GridStoreBuilder
Builds a GridStore with custom strategies.
GridTuning
Timing knobs of a grid.
GridWriter
Writes rows into a GridStore from any thread.
GroupBy
One level of a grouping: a column or a GroupKey, and the order of its groups by key.
GroupCaptionContext
What LiveGridDelegate::group_caption knows about a visible caption.
GroupId
A group’s position in one projection’s group table. Transient, like a display position: the identity of a group is its GroupPath.
GroupInfo
One group of a projection: a view into it.
GroupKey
Grouping by a function of the row rather than a column: a bucket of prices, the first letter of a name.
GroupOrderContext
What GroupOrder knows about a group when it orders siblings.
GroupPath
A group’s identity: the id of each level (a column’s ColumnId or a GroupKey id) with the group’s key value there, from the top level down. Never positions, so a group keeps its identity across rebuilds, sorts and snapshots.
GroupTable
The groups of a projection: a view into it.
HeaderTooltipContext
What LiveGridDelegate::header_tooltip knows about the hovered header cell.
HighlightPolicy
How long a change stays highlighted, in how many steps it fades, and how long a removed row fades out.
HoldReorder
Keep the order while the pointer is over the grid, at most max, and while the context menu or a cell editor is open, however long.
IconValue
An icon in a cell (CellValue::Icon): the asset path of its SVG (the path() of a gpui-kit IconNamed, or the application’s own asset) and the text that stands for it.
ImageValue
An image in a cell (CellValue::Image): its id, which the grid’s image source reads (an asset path, an absolute file path, an http(s):// URI or a key of the application’s own), and the text that stands for it.
Ingest
The single writer of the rows. Applies operations in order, diffs every replacement, writes change stamps and publishes snapshots.
InlineRunner
Runs jobs at once on the calling (UI) thread.
JsonLayoutCodec
The JSON format of GridLayout, compact by default.
KeyOrder
Groups in the order of their keys, each level in its direction: the default.
LayoutColumn
One column of a saved layout.
LayoutExpansion
The saved expansion of groups: the default depth, and the groups the user toggled against it. A toggled group is its key values from the top level down, one per level of the layout’s group_by; the levels name the columns, so a path holds values only.
LayoutGroup
One grouping level of a saved layout: a column and the order of its groups. Serialized as a sort key is: {"column": "instrument", "direction": "ascending"}.
LayoutLibrary
Named layouts per view id, for “Save Layout As…” and a layout picker, plus the layout each view opens with.
LayoutMergeContext
The schema as a LayoutMerge sees it: every column with its default width, visibility and zone, and whether it can be grouped.
LayoutParts
A set of LayoutParts.
LayoutReport
What applying a saved layout had to adjust to fit the current schema.
LayoutSort
One sort key of a saved layout.
LineFilter
Writes only some lines of a table, with another exporter or format: for example a copy without group footers and the totals, or the application’s rows alone. It wraps any clipboard format, and a grid takes it as any exporter (LiveGridState::with_exporter); it wraps any file format, and an export takes it as any format.
LineScopeContext
What SelectionPolicy::line_scope knows: the target line of a command in the projection on screen, the snapshot it is drawn from and the selection mode.
LinkValue
A link in a cell (CellValue::Link): the text the cell shows and the address it opens. Both borrow from the row: no allocation.
LiveGrid
A live grid element over a LiveGridState.
LiveGridHandle
A grid without its delegate type: columns, layout, sort, grouping, quick filter, counts, the held order, copy and export, and its events, all by column id. What a toolbar, a status bar or a column chooser needs.
LiveGridState
The state and view of a live grid.
LiveReorder
Show every new order at once (throttled by min_rebuild_interval); hold it only while the context menu or a cell editor is open: the row under the field stays where it is.
ManualReorder
Keep the order until the application applies it (for example from a “Refresh order” button); user actions still apply at once. An open context menu changes nothing: the order is held anyway.
NoGroupFooter
No group has a footer: the default.
NoRowDrag
No press drags rows. The default: without an application handling Drop, a drag would only get in the way of the selection.
NoRowDrop
The grid takes no drop. The default.
NumberEditor
Edits a cell as a number, on gpui-kit’s Input with a number mask. The kind follows the cell’s value (Int, Float, Decimal; Float for an empty cell) unless Self::with_kind sets it; an empty draft is Empty.
NumberFormat
How a column shows its numbers (GridColumn::with_number_format): the decimals of a Float. The default shows two, as the grid always did.
NumberHint
How the grid shows a number, for an export format to match it (ExportCell::number_hint): today the digits after the decimal point, from the column’s NumberFormat.
OpenInBrowser
Opens the address with App::open_url: natively in the system’s browser, on the web in a new tab. The default.
PopoverColumnChooser
The default: ColumnChooserPanel in the grid’s popover, focused on its search field or its list.
ProgressContext
What LiveGridDelegate::render_progress knows about the grid.
Projection
The display order of one view at one store version.
ProjectionScope
The selection within the projection on screen, in its order: rows a filter hides and rows removed since are left out; selected rows of a collapsed group are in. The default.
QuickFilter
A compiled quick filter over a set of columns. Cloning is cheap.
RawCells
Raw values that spreadsheets parse back: numbers without digit grouping with the decimals the grid shows, Bool as TRUE or FALSE. A summary cell is written by its value as any other: an aggregate Float as 1234.50, a Bool group key as TRUE.
Rebuild
Full filter, quick filter and sort of the whole snapshot.
Reload
A running reload, from GridWriter::begin_reload.
ReorderContext
What a ReorderPolicy knows when a new display order is ready.
ReplayLive
Replaces every row with the snapshot, then replays the live operations written meanwhile, so nothing newer than the snapshot is lost. Pinned rows written during the reload are replayed the same way.
RowDrag
The payload of a row drag: what GPUI carries while rows are dragged out of a grid. A drop target outside grids takes it with on_drop::<RowDrag<K>>.
RowDragContext
What LiveGridDelegate::drag_payload knows: the rows about to be dragged.
RowDragPressContext
A primary press on a data row, as a RowDragGesture sees it.
RowDropContext
A drag over the rows, as a RowDropPolicy sees it.
RowId
The storage slot of a row plus its generation. A RowId held by a stale projection stops resolving once its row is removed.
RowStamps
The change stamps of one row’s cells while any of them is hot (StoreSnapshot::stamps).
ScopedSelection
What a command acts on: the selection within its scope, in display order (crate::SelectionScope). Collect one from (key, columns) pairs.
SelectEditor
Edits a cell with one value of a closed set, picked from a searchable list under the cell.
SelectOption
One value a SelectEditor offers, with the text the list shows.
SelectedRowsDrag
LiveGrid’s two-phase gesture: the first press of a series, without Shift and without the platform toggle (Cmd on macOS, Ctrl elsewhere), on a data row selected before the press drags the selection once the pointer is 10 px away. A press on an unselected row selects it and drag-selects as before.
SelectionGestureContext
What a SelectionGesture knows about a press or a navigation command.
SelectionScopeContext
What a SelectionScope knows when a command asks what it acts on.
SortCycleContext
What a SortCycle knows about a header click.
Stamp
A packed change stamp: milliseconds since the store epoch in the upper 30 bits, the change in bits 0–1: 00 updated without a direction, 01 inserted, 10 updated up, 11 updated down. Zero means “never changed”.
StandardContextMenuGesture
The platform conventions: a right click, and on macOS a Ctrl+click without Cmd, open the menu, on the body and on the header alike. On macOS Cmd+click toggles the selection, so Ctrl+click is free.
StandardEditGesture
Excel’s: typing and a double click edit (not on a Control cell, whose element takes its own presses), a single click does not; Enter commits and moves down, Shift+Enter and ↑ up, ↓ down, Tab right, Shift+Tab left.
StandardEditPolicy
The default edit policy: leaving the editor commits a valid draft and cancels an invalid one; a draft is kept when the store changes the cell, and the conflict shows; an edited row that leaves the shown lines cancels the edit; an accepted value waits 5 s for the store; an error mark stays until the next edit.
StandardExpandGesture
A press on a chevron toggles, with Alt (Option on macOS) the line and everything below it, as Finder’s disclosure triangle; only the first press of a series counts. The second press of a double click on a caption toggles it (DevExpress, Windows Explorer). A press on a tree row’s cell does nothing here: a double click confirms, as on any row.
StandardSelectionGesture
Windows and macOS conventions; navigation selects, as in Excel.
StandardSortCycle
Ascending, then descending, then unsorted (the insertion order), as in AG Grid, Syncfusion and MUI X.
StoreOptions
Options of a GridStore.
StoreScope
The selection within the store: the rows on screen in display order, then selected rows a filter hides, in insertion order. Removed rows never are.
StoreSnapshot
An immutable view of every row at one store version.
StoreStats
Counters of a store’s write queue and ingest, for profiling (GridStore::stats).
StoreSubscription
A subscription to a GridStore’s snapshots.
TextEditor
Edits a cell as one line of text, on gpui-kit’s Input. Values: Text; an empty draft is Self::with_empty_value’s value, Empty by default: an empty cell has no value, as in Excel.
TextFile
Any clipboard Exporter as a file format: the whole text is written, then saved as UTF-8 without a byte order mark. Progress jumps from 0 to done.
TextStats
Hit and miss counters of the text caches: the grid’s font and, apart, each other weight a cell style asks for.
TreeFilterContext
What a tree filter rule knows about one row.
TreeSpec
How a view shows a tree.
TreeTotalsContext
What a tree totals rule knows about one row.
TsvExporter
Tab-separated values that Excel, Numbers and LibreOffice paste as cells.
UniformChanges
Paints a change by its kind alone: an inserted row in success, an updated cell in warning, a removed row in danger with muted text, as a background whose opacity fades with the change. The text colour stays, so the text cache is not split by fade step. The default.
ViewColumnIx
The on-screen position of a visible column, left to right across all zones. Transient: never stored and never persisted; the column itself (or its ColumnIx) is the identity.
ViewSpec
What the view shows: a filter, a quick filter and a multi-column sort, a grouping or a tree, aggregates and the expansion.
VisibleRowsAutofit
Fits the header title, the pinned rows, the aggregates and the data rows painted in the frame of the fit; rows off screen are not measured, so the cost does not grow with the row count (AG Grid does the same).
WeakLiveGridHandle
A LiveGridHandle that does not keep the grid alive.
WriteBatch
Operations collected by GridWriter::batch, written when its closure returns and published in one snapshot. Each method writes what the GridWriter method of the same name writes.

Enums§

AfterCommit
Where the focus goes after a commit.
Aggregate
The aggregate of a column, for group captions, group footers and the totals. Every job computes them afresh over the live rows; without a value to aggregate, they are Empty (a Count, Int(0)).
AggregateLine
The line of an aggregate cell, as LiveGridDelegate::aggregate_style sees it.
CellContent
What a column paints in its cells.
CellExport
The cell exporter of a grid: the built-in exporters dispatched statically, plus a custom one.
CellImage
What a CellImageSource has for an id now.
CellImages
The image source of a grid: the built-in one, or the application’s own. Static dispatch for the built-in source on the hot path.
CellMove
A move of the focus after a commit.
CellValue
A cell value. Numbers, points in time and borrowed text do not allocate.
ChangeDirection
The direction of a changed numeric value (GridRow::change_direction).
ChangePaint
How a grid paints highlighted changes: the built-in painters, dispatched without a virtual call on the hot path, or the application’s. The default is UniformChanges.
ColumnAlign
Horizontal alignment of a column.
ColumnZone
Where a column is shown.
CsvEncoding
How the text of a CSV file is encoded.
DisplayRow
One line of the shown order.
DraftAction
What happens to the draft when the edited cell’s value changes in the store.
DropLine
The line under a drag over the rows.
DropPlace
Where a drop lands relative to a row.
DropSource
What was dropped on a grid.
DropTarget
Where a drop lands, by identity.
EditCancelReason
Why an editor closed without EditCommit.
EditCommitKey
The Action that committed an editor: which key, as the editor’s key bindings name it (CommitEdit, CommitEditUp, CommitEditDown, CommitEditNext, CommitEditPrev).
EditEnd
How an edit that leaves the editor ends.
EditInput
What started an edit, as EditGesture and CellEditor see it.
EditOrigin
Who started an edit.
EditState
What a cell’s commits look like now.
EditorMark
The mark of an open editor: what its frame and its message show.
EditorOpen
What an editor does with a start.
EmptyExport
What an export of an empty scope does.
ExpandArea
Where a press lands on a line that expands: a group caption or a tree row with children.
ExpandDepth
How deep groups and tree rows are expanded by default. The groups and rows the user toggled against it are kept apart (Expansion).
ExpandEdit
How a press expands or collapses its line.
ExpandTarget
A group or a tree row to expand or collapse, by identity: a group by its path, a tree row by its key.
ExportError
Why an export did not finish.
ExportHeader
The header lines of an export. An enum, not a flag: the band titles above the column titles would be one more variant.
ExportLine
What an exported row is: a row of the application, or a summary row of a grouped view.
ExportScope
Which rows an export takes. A grid copies any of them with LiveGridState::copy_scope.
GestureInput
Where a selection gesture comes from.
GridArea
The part of the grid a press lands on.
GridHandleEvent
What a LiveGridEvent says without keys and columns.
GridTarget
What a press or the keyboard pointed at. Captured when the button goes down, so a re-sort before the menu is built cannot retarget it.
GroupOrigin
Who changed the grouping or the expansion, so a subscriber that keeps them itself and calls set_group_by or set_expanded can avoid a feedback loop.
HeaderLabel
What a column’s header cell shows. Wherever the header shows no text, the title still names the column: its tooltip, its accessible name, the column chooser, the menus and an export’s header.
ImageFit
How an image fits the room of its cell (the cell without its padding), as CSS object-fit. A column’s parameter: GridColumn::with_image_fit.
LayoutError
Why a layout was not read, written or applied. A grid keeps its current layout.
LayoutOrigin
Who changed the column layout, so a subscriber can avoid feedback loops.
LayoutPart
One part of the column layout.
LiveGridEvent
Events of a LiveGridState: K is the row key, C the column.
NumberKind
The kind of number a NumberEditor commits.
NumberPrecision
How many decimals RawCells writes for a Float.
Op
An operation written by a producer.
OwnedValue
An owned cell value: a group key kept across snapshots, an aggregate result.
PinnedEdge
The edge a pinned band sits at.
QuickFilterRule
A compiled quick filter: a built-in rule, dispatched statically, or an application one.
ReorderDecision
What to do with a new display order.
RowChange
What happened to the row when the stamp was written.
SelectableLine
A line the selection may take, as a SelectionPolicy sees it.
SelectionEdit
How a gesture changes the selection; the target always gets the focus.
SelectionMode
What a click or a key press selects.
SelectionOrigin
Why the selection or the focus changed, so a subscriber that sets the selection itself can avoid a feedback loop.
SortDirection
Sort direction of a column. Serialized as "ascending" or "descending".
SortOrigin
Why the sort changed, so a subscriber that keeps the sort itself and calls set_sort can avoid a feedback loop.
TreeFilter
Which rows of a filtered tree are shown. Without a filter and a quick filter every row passes and is shown.
TreeTotals
Which rows of a tree the totals add up. A parent often holds the sum of its children already, so adding every row would count it twice.
WriteCoalescing
How a store queues writes that arrive while its ingest is busy.

Constants§

MIN_COLUMN_WIDTH
The smallest width a column can have, whatever its own minimum.
PAGE_SIZE
Rows per page. Publishing a snapshot copies only the pages changed since the previous snapshot, and only while that snapshot is still held.

Traits§

AggregateFn
A custom aggregate for Aggregate::Custom: a weighted average, a median. Called in the background, from several threads of a large rebuild, once per group.
AutofitPolicy
Chooses the text width a column needs when it is autofitted (a double click on its resize handle, autofit_column, autofit_columns). The grid adds the cell padding and clamps to the column’s limits.
CellEditor
Edits the cells of a column (LiveGridState::with_editor). Asked once per edit start, on the UI thread, outside prepaint.
CellExporter
Writes the text of one exported cell.
CellImageSource
Finds the images of CellValue::Image cells by their ids.
ChangePainter
Paints a highlighted change into a cell’s default style, before the delegate’s cell_style adjusts it.
Clock
The clock change stamps and highlight ages are measured with. The store and every view over it read the same clock.
ColumnChooserFactory
Makes what the grid shows for “Choose columns…”.
ColumnMovePolicy
Decides which columns move together and where they may go, for header drags, move_column, move_band, zone changes and the move Actions.
ContextMenuGesture
Which press opens the context menu. Called once per press on the UI thread, on the body and on the header; the ShowContextMenu Action opens the menu whatever it says.
EditGesture
Which input opens the editor of an editable cell, and where the focus goes after a commit. Asked once per input on the UI thread.
EditPolicy
How an edit session behaves around its commit and under live data. Asked once per event on the UI thread.
EditorField
One open editor: its element in the cell, its draft and its focus.
ExpandGesture
Which press expands or collapses a group caption or a tree row. Called once per press on such a line, on the UI thread, after the ContextMenuGesture. A press on a caption still focuses it; a press on a tree row’s chevron leaves the focus and the selection as they are, as Finder’s disclosure triangle does; a press on a chevron is never a click. The keys (ExpandRow, CollapseRow, ←/→ on a caption) expand whatever it says.
ExportFormat
Turns an export table into the bytes of a file or a stream: CSV, TSV, or an application format such as xlsx written with the application’s own library.
Exporter
Turns an export table into text for the clipboard, or for a file with TextFile.
GridColumns
The set of columns of a row type, usually an application enum.
GridRow
A row of the grid. Rows are immutable snapshots shared through Arc.
GridValue
A cell value of the application’s own type (CellValue::Custom): a severity that sorts by rank, a tenor, a price in ticks, a time in the local zone. The type decides its order, its text and what an export writes; the row lends it, so a cell does not allocate.
GroupFooter
Which groups have a footer row under their rows. Called in the background, once per group.
GroupOrder
The order of sibling groups. Groups are first in the order of their keys, each level in its direction; compare sorts siblings stably from there, so Equal keeps the key order.
LayoutCodec
Turns a layout into text and back. Called once per import or export.
LayoutMerge
Resolves a saved layout against the current schema. Called once per import.
LinkOpener
Opens a link of the grid: a click on a CellValue::Link’s text, or Enter on its focused cell.
LiveGridDelegate
Presentation and command hooks of a grid.
ProjectionEngine
Builds projections. The default is Rebuild; incremental engines implement the same trait.
QuickFilterMatcher
How quick filter text matches rows. The default is ContainsAllTerms. Runs off the UI thread, so it is Send + Sync.
QuickFilterQuery
A compiled application quick filter, wrapped in QuickFilterRule::Custom.
ReloadPolicy
Resolves a reload: a fresh snapshot from the server (replace_all) against live operations producers wrote while it was loading.
ReorderPolicy
Decides when a new display order replaces the shown one, so rows do not jump under the user’s pointer more than the application wants.
RowDragGesture
Which presses on the rows may become a row drag. A press that may starts no drag-selection; past Self::threshold the drag starts, carrying the command scope of the pressed row. Asked once per press.
RowDropPolicy
Where a drag over the rows would land, or whether the grid refuses it. Asked on every move of a drag over the rows and once more at the drop; pinned bands, group footers and totals refuse without asking.
SelectionGesture
How a press or a navigation command edits the selection. Called once per gesture on the UI thread. Space toggles and Cmd/Ctrl+A selects all whatever it says.
SelectionPolicy
Which lines can be selected, and what a command over a line acts on: a group caption, or a tree row with children.
SelectionScope
Which selected rows and cells a command acts on: Enter, a double click, the primary menu command, copying. Called once per command on the UI thread.
SortCycle
How a header click changes the sort.
TaskRunner
Runs the view’s background jobs (projection rebuilds and compactions).
TreeFilterRule
A rule for TreeFilter::Custom. Called for every row in the background while the view has a filter or a quick filter; without them every row is shown and the rule is not called.
TreeTotalsRule
A rule for TreeTotals::Custom. Called for every shown row in the background.

Derive Macros§

GridColumns
Derives GridColumns for an enum of columns (feature derive). Derives GridColumns for an enum of columns (feature derive of gpui-kit-grid).