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) → ProjectionRe-exports§
pub use actions::init;
Modules§
- actions
- Commands of the grid, as GPUI Actions in the
live_gridnamespace, and its default key bindings.
Structs§
- Aggregate
Order - 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.
- Aggregate
Row - The aggregates of one group, or of the whole view for the totals: a view into the projection.
- Aggregate
Style Context - What
LiveGridDelegate::aggregate_styleknows about a visible aggregate cell. - Append
NewColumns - 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. - Asset
Image Source - 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. - Autofit
Context - What an
AutofitPolicycan measure for one column. Widths are text widths, without cell padding. - Background
Runner - Runs jobs on GPUI’s background executor.
- Band
Info - A header band over a column.
- Banded
Move - 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.
- Caption
Tag - 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_tagwrites. - Cell
Change - 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, withHighlightPolicy::with_removal_fade). - Cell
Edit Handle - Commits values of one cell from a handler of its element, such as a
checkbox’s
on_clickoron_activate: the same path as an editor’s commit with no field. FromCellElementContext::edit. Cheap to clone. Call it from an event handler, outside the grid’s update, never fromrender_cell. - Cell
Element Context - What
LiveGridDelegate::render_cellknows about a visible cell of anElementorControlcolumn. - Cell
Style - Style of one cell, filled by the grid’s change paint
(
ChangePaint) and then byLiveGridDelegate::cell_style. Unset fields use the theme. - Cell
Style Context - What
LiveGridDelegate::cell_styleknows about a cell. - Cell
Texts - The display text of the quick filter columns of one row, as the body
paints it.
EmptyandBoolcells have no searchable text and are left out: the body showsBoolonly as a check mark. AnIconcell is searched by its text. - Cell
Tooltip - Tooltip content of a cell or a header cell: text, or an element built each time the tooltip draws.
- Cell
Tooltip Context - What
LiveGridDelegate::tooltipknows about the hovered cell. - Change
Palette - The theme colours a
ChangePainterworks with, read once per frame. No colours of its own: semantic tokens of the theme. - Change
Set - What changed between two snapshots, accumulated per subscriber.
- Checkbox
Editor - Toggles a
Boolcell at once, with no field: F2, a double click on aTextcolumn and a call commit the opposite value (Bool(true)for an empty cell) asEditorOpen::Commit, with noEditStart. Typing, Backspace and Delete take no edit. On aControlcolumn the checkbox element toggles itself throughCellElementContext::edit, Space included (on_activate). - Column
Band - A titled header band over columns and nested bands (a multi-level header).
- Column
Chooser Context - What a
ColumnChooserFactoryknows. - Column
Chooser Panel - 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. - Column
Id - A stable column identifier for persisted layouts: the value of
GridColumns::id. UnlikeColumnIxit survives schema changes, so saved layouts and sort keys refer to columns by it. Not for the hot path. - Column
Info - A schema column as the grid shows it now.
- Column
Ix - The index of a column in the schema. Stable for the schema’s lifetime and
used on the hot path. Persisted layouts use
ColumnIdinstead. - Column
Move Context - One zone of the column layout, as a
ColumnMovePolicysees it. - Column
Order - The whole column order, as
ColumnMovePolicy::normalizemay 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. - Column
Set - A set of columns, up to 128.
- Contains
AllTerms - Every whitespace-separated term occurs, ignoring case, in some column, as in AG Grid’s quick filter. Terms may occur in different columns.
- Contains
AllTerms Query ContainsAllTermscompiled: lowercase terms without repeats. Without terms every row passes.- Context
Menu Gesture Context - What a
ContextMenuGestureknows 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. - Date
Editor - Edits a
Timestampcell with a calendar under it. - Directional
Changes - Paints the direction of an updated number: a rise in
success, a fall indanger, each with an arrow (CellStyle::set_trend); an update without a direction inwarningwithout one. Inserted and removed rows asUniformChanges. - Displayed
Cells - The text painted in the cell: the same function the body paints with
(
Floatwith its column’s decimals,Bool(true)as “✓”). A summary cell is written by its value as any other: an aggregateFloatas1234.50. - Drag
Payload - Application data riding along a drag, and the label of its ghost.
- Drop
Between Rows - 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. - Drop
OnRows - Onto data rows (tree rows too), group captions and the empty area below the rows; any source.
- Edit
Error - Why a value is refused: the editor could not parse it, the delegate’s
validate_editrefused it, or the application rejected the commit. - Edit
Gesture Context - What an
EditGestureknows about an input on a cell that could edit it: a cell of a column with an editor that the delegate’sis_editablelets edit. - EditId
- One commit, until
LiveGridState::resolve_editanswers it. Opaque, unique within its grid. - Edit
Message Context - What
LiveGridDelegate::render_edit_messageknows about the open editor’s message. - Edit
Policy Context - What an
EditPolicyknows about the open edit. - Edit
Validate Context - What
LiveGridDelegate::validate_editknows about a commit. - Editable
Context - What
LiveGridDelegate::is_editableknows about a cell. - Editor
Cell - What an
EditorFieldknows about its cell when it renders. - Editor
Start - What a
CellEditorknows about a start. - Every
Group Footer - Every group has a footer.
- Expand
Gesture Context - What an
ExpandGestureknows 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). - Export
Cell - One exported cell: what a
CellExporterwrites. - Export
Column - A column of an
ExportTable: the application column, its header text, and how the grid shows it, for a spreadsheet format to match. - Export
Control - The progress and cancellation of one export, shared between the job that writes it and the application that waits for it. Clones share them.
- Export
Job - A running export: its progress, its cancellation and, as a
Future, its result. - Export
Lines - A set of
ExportLines: the lines aLineFilterwrites. - Export
Outcome - A finished export: what it made, and how much it wrote.
- Export
Progress - The rows an export has written of the rows it writes.
- Export
Request - What an export takes from the grid: the scope, the header line, the columns and how a text cell is written.
- Export
Row - A row of an
ExportTable: a row of the application, or a summary row of a grouped view (ExportLine). - Export
Table - The rows and columns an
Exporterturns into text and anExportFormatinto a file. - Flush
Outcome - What
LiveGridState::flushwaited for. - Focus
Branches - 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 withFocusCaptions. - Focus
Captions - 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 onscoped_selection(). The default. - Focused
Cell - The focused cell: the keyboard target inside the grid, a cell of a data row or a group caption.
- Follow
Live Value - 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. - Free
Move - 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.
- Grid
Column - A column of the grid schema.
- Grid
Layout - A saved grid layout: the columns by
ColumnIdin display order, each with its width, visibility and zone, the sort, and the grouping with the expansion of its groups. - Grid
Menu Context - What
LiveGridDelegate::context_menuandLiveGridDelegate::primary_commandknow: the target, the command scope and the rows of the snapshot shown when the menu opened. - Grid
Progress - Progress of work the grid waits for: a load, a reload, a recalculation.
- Grid
Schema - The columns shown by a grid, in their initial display order, with their header bands.
- Grid
Selection - The selected rows or cells, by key. Cloning is O(1): the set is shared and copied on write.
- Grid
Stats - Counters for profiling a grid.
- Grid
Store - The rows of one or more grids. Cloning shares the store.
- Grid
Store Builder - Builds a
GridStorewith custom strategies. - Grid
Tuning - Timing knobs of a grid.
- Grid
Writer - Writes rows into a
GridStorefrom any thread. - GroupBy
- One level of a grouping: a column or a
GroupKey, and the order of its groups by key. - Group
Caption Context - What
LiveGridDelegate::group_captionknows 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. - Group
Info - One group of a projection: a view into it.
- Group
Key - Grouping by a function of the row rather than a column: a bucket of prices, the first letter of a name.
- Group
Order Context - What
GroupOrderknows about a group when it orders siblings. - Group
Path - A group’s identity: the id of each level (a column’s
ColumnIdor aGroupKeyid) 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. - Group
Table - The groups of a projection: a view into it.
- Header
Tooltip Context - What
LiveGridDelegate::header_tooltipknows about the hovered header cell. - Highlight
Policy - How long a change stays highlighted, in how many steps it fades, and how long a removed row fades out.
- Hold
Reorder - 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. - Icon
Value - An icon in a cell (
CellValue::Icon): the asset path of its SVG (thepath()of a gpui-kitIconNamed, or the application’s own asset) and the text that stands for it. - Image
Value - An image in a cell (
CellValue::Image): its id, which the grid’s image source reads (an asset path, an absolute file path, anhttp(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.
- Inline
Runner - Runs jobs at once on the calling (UI) thread.
- Json
Layout Codec - The JSON format of
GridLayout, compact by default. - KeyOrder
- Groups in the order of their keys, each level in its direction: the default.
- Layout
Column - One column of a saved layout.
- Layout
Expansion - 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. - Layout
Group - 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"}. - Layout
Library - Named layouts per view id, for “Save Layout As…” and a layout picker, plus the layout each view opens with.
- Layout
Merge Context - The schema as a
LayoutMergesees it: every column with its default width, visibility and zone, and whether it can be grouped. - Layout
Parts - A set of
LayoutParts. - Layout
Report - What applying a saved layout had to adjust to fit the current schema.
- Layout
Sort - One sort key of a saved layout.
- Line
Filter - 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. - Line
Scope Context - What
SelectionPolicy::line_scopeknows: the target line of a command in the projection on screen, the snapshot it is drawn from and the selection mode. - Link
Value - A link in a cell (
CellValue::Link): the text the cell shows and the address it opens. Both borrow from the row: no allocation. - Live
Grid - A live grid element over a
LiveGridState. - Live
Grid Handle - 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.
- Live
Grid State - The state and view of a live grid.
- Live
Reorder - 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. - Manual
Reorder - 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.
- NoGroup
Footer - No group has a footer: the default.
- NoRow
Drag - No press drags rows. The default: without an application handling
Drop, a drag would only get in the way of the selection. - NoRow
Drop - The grid takes no drop. The default.
- Number
Editor - Edits a cell as a number, on gpui-kit’s
Inputwith a number mask. The kind follows the cell’s value (Int,Float,Decimal;Floatfor an empty cell) unlessSelf::with_kindsets it; an empty draft isEmpty. - Number
Format - How a column shows its numbers (
GridColumn::with_number_format): the decimals of aFloat. The default shows two, as the grid always did. - Number
Hint - 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’sNumberFormat. - Open
InBrowser - Opens the address with
App::open_url: natively in the system’s browser, on the web in a new tab. The default. - Popover
Column Chooser - The default:
ColumnChooserPanelin the grid’s popover, focused on its search field or its list. - Progress
Context - What
LiveGridDelegate::render_progressknows about the grid. - Projection
- The display order of one view at one store version.
- Projection
Scope - 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.
- Quick
Filter - 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,
BoolasTRUEorFALSE. A summary cell is written by its value as any other: an aggregateFloatas1234.50, aBoolgroup key asTRUE. - Rebuild
- Full filter, quick filter and sort of the whole snapshot.
- Reload
- A running reload, from
GridWriter::begin_reload. - Reorder
Context - What a
ReorderPolicyknows when a new display order is ready. - Replay
Live - 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>>. - RowDrag
Context - What
LiveGridDelegate::drag_payloadknows: the rows about to be dragged. - RowDrag
Press Context - A primary press on a data row, as a
RowDragGesturesees it. - RowDrop
Context - A drag over the rows, as a
RowDropPolicysees it. - RowId
- The storage slot of a row plus its generation. A
RowIdheld 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). - Scoped
Selection - What a command acts on: the selection within its scope, in display order
(
crate::SelectionScope). Collect one from(key, columns)pairs. - Select
Editor - Edits a cell with one value of a closed set, picked from a searchable list under the cell.
- Select
Option - One value a
SelectEditoroffers, with the text the list shows. - Selected
Rows Drag - 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.
- Selection
Gesture Context - What a
SelectionGestureknows about a press or a navigation command. - Selection
Scope Context - What a
SelectionScopeknows when a command asks what it acts on. - Sort
Cycle Context - What a
SortCycleknows 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:
00updated without a direction,01inserted,10updated up,11updated down. Zero means “never changed”. - Standard
Context Menu Gesture - 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.
- Standard
Edit Gesture - Excel’s: typing and a double click edit (not on a
Controlcell, 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. - Standard
Edit Policy - 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.
- Standard
Expand Gesture - 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.
- Standard
Selection Gesture - Windows and macOS conventions; navigation selects, as in Excel.
- Standard
Sort Cycle - Ascending, then descending, then unsorted (the insertion order), as in AG Grid, Syncfusion and MUI X.
- Store
Options - Options of a
GridStore. - Store
Scope - 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.
- Store
Snapshot - An immutable view of every row at one store version.
- Store
Stats - Counters of a store’s write queue and ingest, for profiling
(
GridStore::stats). - Store
Subscription - A subscription to a
GridStore’s snapshots. - Text
Editor - Edits a cell as one line of text, on gpui-kit’s
Input. Values:Text; an empty draft isSelf::with_empty_value’s value,Emptyby default: an empty cell has no value, as in Excel. - Text
File - Any clipboard
Exporteras a file format: the whole text is written, then saved as UTF-8 without a byte order mark. Progress jumps from 0 to done. - Text
Stats - Hit and miss counters of the text caches: the grid’s font and, apart, each other weight a cell style asks for.
- Tree
Filter Context - What a tree filter rule knows about one row.
- Tree
Spec - How a view shows a tree.
- Tree
Totals Context - What a tree totals rule knows about one row.
- TsvExporter
- Tab-separated values that Excel, Numbers and LibreOffice paste as cells.
- Uniform
Changes - Paints a change by its kind alone: an inserted row in
success, an updated cell inwarning, a removed row indangerwith 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. - View
Column Ix - 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. - View
Spec - What the view shows: a filter, a quick filter and a multi-column sort, a grouping or a tree, aggregates and the expansion.
- Visible
Rows Autofit - 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).
- Weak
Live Grid Handle - A
LiveGridHandlethat does not keep the grid alive. - Write
Batch - Operations collected by
GridWriter::batch, written when its closure returns and published in one snapshot. Each method writes what theGridWritermethod of the same name writes.
Enums§
- After
Commit - 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(aCount,Int(0)). - Aggregate
Line - The line of an aggregate cell, as
LiveGridDelegate::aggregate_stylesees it. - Cell
Content - What a column paints in its cells.
- Cell
Export - The cell exporter of a grid: the built-in exporters dispatched statically, plus a custom one.
- Cell
Image - What a
CellImageSourcehas for an id now. - Cell
Images - 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.
- Cell
Move - A move of the focus after a commit.
- Cell
Value - A cell value. Numbers, points in time and borrowed text do not allocate.
- Change
Direction - The direction of a changed numeric value (
GridRow::change_direction). - Change
Paint - 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. - Column
Align - Horizontal alignment of a column.
- Column
Zone - Where a column is shown.
- CsvEncoding
- How the text of a CSV file is encoded.
- Display
Row - One line of the shown order.
- Draft
Action - What happens to the draft when the edited cell’s value changes in the store.
- Drop
Line - The line under a drag over the rows.
- Drop
Place - Where a drop lands relative to a row.
- Drop
Source - What was dropped on a grid.
- Drop
Target - Where a drop lands, by identity.
- Edit
Cancel Reason - Why an editor closed without
EditCommit. - Edit
Commit Key - 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.
- Edit
Input - What started an edit, as
EditGestureandCellEditorsee it. - Edit
Origin - Who started an edit.
- Edit
State - What a cell’s commits look like now.
- Editor
Mark - The mark of an open editor: what its frame and its message show.
- Editor
Open - What an editor does with a start.
- Empty
Export - What an export of an empty scope does.
- Expand
Area - Where a press lands on a line that expands: a group caption or a tree row with children.
- Expand
Depth - How deep groups and tree rows are expanded by default. The groups and
rows the user toggled against it are kept apart (
Expansion). - Expand
Edit - How a press expands or collapses its line.
- Expand
Target - A group or a tree row to expand or collapse, by identity: a group by its path, a tree row by its key.
- Export
Error - Why an export did not finish.
- Export
Header - The header lines of an export. An enum, not a flag: the band titles above the column titles would be one more variant.
- Export
Line - What an exported row is: a row of the application, or a summary row of a grouped view.
- Export
Scope - Which rows an export takes. A grid copies any of them with
LiveGridState::copy_scope. - Gesture
Input - Where a selection gesture comes from.
- Grid
Area - The part of the grid a press lands on.
- Grid
Handle Event - What a
LiveGridEventsays without keys and columns. - Grid
Target - 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.
- Group
Origin - Who changed the grouping or the expansion, so a subscriber that keeps
them itself and calls
set_group_byorset_expandedcan avoid a feedback loop. - Header
Label - 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.
- Image
Fit - 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. - Layout
Error - Why a layout was not read, written or applied. A grid keeps its current layout.
- Layout
Origin - Who changed the column layout, so a subscriber can avoid feedback loops.
- Layout
Part - One part of the column layout.
- Live
Grid Event - Events of a
LiveGridState:Kis the row key,Cthe column. - Number
Kind - The kind of number a
NumberEditorcommits. - Number
Precision - How many decimals
RawCellswrites for aFloat. - Op
- An operation written by a producer.
- Owned
Value - An owned cell value: a group key kept across snapshots, an aggregate result.
- Pinned
Edge - The edge a pinned band sits at.
- Quick
Filter Rule - A compiled quick filter: a built-in rule, dispatched statically, or an application one.
- Reorder
Decision - What to do with a new display order.
- RowChange
- What happened to the row when the stamp was written.
- Selectable
Line - A line the selection may take, as a
SelectionPolicysees it. - Selection
Edit - How a gesture changes the selection; the target always gets the focus.
- Selection
Mode - What a click or a key press selects.
- Selection
Origin - Why the selection or the focus changed, so a subscriber that sets the selection itself can avoid a feedback loop.
- Sort
Direction - Sort direction of a column. Serialized as
"ascending"or"descending". - Sort
Origin - Why the sort changed, so a subscriber that keeps the sort itself and
calls
set_sortcan avoid a feedback loop. - Tree
Filter - Which rows of a filtered tree are shown. Without a filter and a quick filter every row passes and is shown.
- Tree
Totals - 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.
- Write
Coalescing - 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§
- Aggregate
Fn - 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. - Autofit
Policy - 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. - Cell
Editor - Edits the cells of a column (
LiveGridState::with_editor). Asked once per edit start, on the UI thread, outside prepaint. - Cell
Exporter - Writes the text of one exported cell.
- Cell
Image Source - Finds the images of
CellValue::Imagecells by their ids. - Change
Painter - Paints a highlighted change into a cell’s default style, before the
delegate’s
cell_styleadjusts it. - Clock
- The clock change stamps and highlight ages are measured with. The store and every view over it read the same clock.
- Column
Chooser Factory - Makes what the grid shows for “Choose columns…”.
- Column
Move Policy - Decides which columns move together and where they may go, for header
drags,
move_column,move_band, zone changes and the move Actions. - Context
Menu Gesture - Which press opens the context menu. Called once per press on the UI
thread, on the body and on the header; the
ShowContextMenuAction opens the menu whatever it says. - Edit
Gesture - 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.
- Edit
Policy - How an edit session behaves around its commit and under live data. Asked once per event on the UI thread.
- Editor
Field - One open editor: its element in the cell, its draft and its focus.
- Expand
Gesture - 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. - Export
Format - 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. - Grid
Columns - 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. - Grid
Value - 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. - Group
Footer - Which groups have a footer row under their rows. Called in the background, once per group.
- Group
Order - The order of sibling groups. Groups are first in the order of their
keys, each level in its direction;
comparesorts siblings stably from there, soEqualkeeps the key order. - Layout
Codec - Turns a layout into text and back. Called once per import or export.
- Layout
Merge - Resolves a saved layout against the current schema. Called once per import.
- Link
Opener - Opens a link of the grid: a click on a
CellValue::Link’s text, or Enter on its focused cell. - Live
Grid Delegate - Presentation and command hooks of a grid.
- Projection
Engine - Builds projections. The default is
Rebuild; incremental engines implement the same trait. - Quick
Filter Matcher - How quick filter text matches rows. The default is
ContainsAllTerms. Runs off the UI thread, so it isSend + Sync. - Quick
Filter Query - A compiled application quick filter, wrapped in
QuickFilterRule::Custom. - Reload
Policy - Resolves a reload: a fresh snapshot from the server (
replace_all) against live operations producers wrote while it was loading. - Reorder
Policy - 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.
- RowDrag
Gesture - Which presses on the rows may become a row drag. A press that may starts
no drag-selection; past
Self::thresholdthe drag starts, carrying the command scope of the pressed row. Asked once per press. - RowDrop
Policy - 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.
- Selection
Gesture - 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.
- Selection
Policy - Which lines can be selected, and what a command over a line acts on: a group caption, or a tree row with children.
- Selection
Scope - 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.
- Sort
Cycle - How a header click changes the sort.
- Task
Runner - Runs the view’s background jobs (projection rebuilds and compactions).
- Tree
Filter Rule - 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. - Tree
Totals Rule - A rule for
TreeTotals::Custom. Called for every shown row in the background.
Derive Macros§
- Grid
Columns - Derives
GridColumnsfor an enum of columns (featurederive). DerivesGridColumnsfor an enum of columns (featurederiveof gpui-kit-grid).