Skip to content

ListViewContextState

Defined in: packages/react/src/collections/listView/ListViewContext.tsx:21

The shared list-view state every list.* slot contribution reads via useListViewContext() — collection identity, URL state, selection, per-browser density (Decision 29, cookie-backed per Decision 42), visible columns, and the Inspect-peek opener (Decision 27). Row-scoped data (docs for list.row.actions/list.bulkActions) stays a SlotOutlet contributedProps prop instead — it varies per contribution call, so it cannot live in one shared context value. The current page’s rows similarly stay a ListViewLayout/DataTable prop, never context — nothing reading useListViewContext() needs the whole page, only the ids selection already carries.

TDoc extends TDocument = TDocument

optional activeViewHiddenFilter?: object

Defined in: packages/react/src/collections/listView/ListViewContext.tsx:80

The active view’s hidden-filter summary (VexClientViewConfig.hasHiddenFilter/hiddenFilterCount, Decision 25), or undefined when no view is active or it declares no hidden filter — drives SavedListViewHiddenFilterBadge (ListViewToolbar, Step 12).

count: number

optional description?: string


collection: CollectionConfig

Defined in: packages/react/src/collections/listView/ListViewContext.tsx:23

The resolved collection config.


columnMenuEntries: object[]

Defined in: packages/react/src/collections/listView/ListViewContext.tsx:76

Every READABLE column (Decision 47 — widened from “hideable only”), for the columns menu; each tagged hideable for the checkbox’s enabled/disabled state. Renamed from hideableColumns.

field: string

hideable: boolean

label: string


columns: ColumnEntry<string>[]

Defined in: packages/react/src/collections/listView/ListViewContext.tsx:53

The active view’s FULL column list (Decision 48), always complete — every one of the collection’s own data fields, exactly once, in display order, each a ColumnEntry (possibly carrying width/pinned/hidden overrides). Threads straight to DataTable’s own columns prop and drives the columns menu’s row sequence/checkbox/pin-control state. Replaces the separate visibleColumns/columnOrder/onVisibleColumnsChange/ onColumnOrderChange fields Step 20 shipped — one array, one general setter (onColumnsChange below), no atomic-pair race possible anymore.


density: ListDensity

Defined in: packages/react/src/collections/listView/ListViewContext.tsx:38

Per-browser table density (Decision 29), cookie-backed (Decision 42) — seeded from CollectionListView’s initialPreferences prop, never read from useLocalStorage.


optional effectiveFilterWhere?: VexWhereNodeOf<unknown>

Defined in: packages/react/src/collections/listView/ListViewContext.tsx:148

The filter ListViewFilterBuilder/ListViewFilterChips/the eye toggle should DISPLAY and let the user edit — distinct from urlState.filter alone (developer-reported follow-up, access-system-fields.md Decision 11): a SHARED view’s own saved filter never reaches urlState.filter for an unmodified link (its state isn’t URL-embedded the way a local view’s is), so without this, a readable shared filter was invisible — no chips, no eye toggle, no “Filter N” count — for EVERY caller, not just one who can’t read a field in it. urlState.filter (set or explicitly cleared) always wins when present; otherwise, an ACTIVE, FULLY READABLE shared view’s own where (activeView.hasHiddenFilter === false) substitutes — editing it writes a real urlState.filter, same as editing any other filter. undefined for a declared (config/default) view’s hidden filter OR an unreadable shared one — both stay SavedListViewHiddenFilterBadge-only, by design, never a chip.


filterValueTitles: Record<string, string | null>

Defined in: packages/react/src/collections/listView/ListViewContext.tsx:97

Resolved titles for every relationship/upload id a filter row/chip currently needs to display (Decision 50) — keyed by raw id, seeded from CollectionListView’s initialFilterValueTitles prop (NextAdminPage’s own collectListViewFilterRelationshipValues server prefetch). undefined for an id neither the server nor this session’s own setFilterValueTitle calls have resolved yet — relationship/upload FilterInputs and ListViewFilterChips.tsx both fall back to the raw id in that case, never a blocking state.


hasActiveView: boolean

Defined in: packages/react/src/collections/listView/ListViewContext.tsx:78

Whether a saved view (config/shared/local) is currently active (Step 12: urlState.view decodes to a merged view’s id).


isSearchFetching: boolean

Defined in: packages/react/src/collections/listView/ListViewContext.tsx:82

Whether a search fetch is currently in flight for the ACTIVE search (not a background find refetch) — ListViewSearch’s own in-input spinner reads this while the previous page’s rows stay on screen (keep-previous-data). false while no search is active at all.


onColumnsChange: (columns) => void

Defined in: packages/react/src/collections/listView/ListViewContext.tsx:55

Replaces the full columns array AND pushes urlState.setCols — the ONE setter every IN-PLACE column-layout interaction uses (ListViewColumnsAction/DataTableColumnsMenu’s drag/checkbox/pin control, DataTable’s own resize handle).

ColumnEntry<string>[]

void


onColumnsStateChange: (columns) => void

Defined in: packages/react/src/collections/listView/ListViewContext.tsx:68

Same columns-replacing shape as onColumnsChange, but LOCAL STATE ONLY — no urlState.setCols write. Used by a view SWITCH (SavedListViewTabs.tsx’s applyView, ListViewModifiedControls.tsx’s save-as-copy), which writes cols= itself as ONE field in urlState.applyView’s single atomic URL write, diffed against the TARGET view’s own baseline — not the STALE pre-switch one onColumnsChange’s own urlState.setCols call would’ve used (developer-reported: switching FROM a shared/config view left a redundant cols=, since a separate setCols call here diffs against the OLD view’s baseline).

ColumnEntry<string>[]

void


onDensityChange: (density) => void

Defined in: packages/react/src/collections/listView/ListViewContext.tsx:40

Replaces the density preference; the caller (CollectionListView) updates its own state AND writes it into the consolidated vex-admin cookie (writeListViewDensityCookie, Decision 51) so the next server render matches with no flash. Read by vex.list.columns (this step’s ListViewColumnsAction.tsx) alongside density itself.

ListDensity

void


optional onInspect?: (id) => void

Defined in: packages/react/src/collections/listView/ListViewContext.tsx:84

Opens the Inspect peek for a document id (Decision 27, wired in Step 13). undefined until then.

string

void


onPeekWidthChange: (width, source?) => void

Defined in: packages/react/src/collections/listView/ListViewContext.tsx:74

Persists a new width (drag/keyboard commit, Reset, or a view switch restoring the target view’s own saved width) via writeListViewPeekWidthCookie. source (default "user") distinguishes a genuine resize (marks peekWidthTouched) from Reset/a tab-click restoring a specific view’s own saved width ("view" — persists the same way but never counts as the user having touched the ACTIVE view’s width).

number | undefined

"user" | "view"

void


peekWidth: number

Defined in: packages/react/src/collections/listView/ListViewContext.tsx:70

The peek panel’s live width in px (Decision, developer-approved “peek-resize”) — the cookie’s current value, mirroring columns above.


peekWidthTouched: boolean

Defined in: packages/react/src/collections/listView/ListViewContext.tsx:72

Whether the user has explicitly resized the peek (drag/keyboard/double-click) since the active view last changed (Decision, binding, “peek-resize-save-rule”) — false for a passive view-sync re-seed or a Reset/tab-click restore. Drives whether Save starts persisting a peekWidth into a view that never had one of its own.


selection: object

Defined in: packages/react/src/collections/listView/ListViewContext.tsx:27

Row selection.

canDelete: boolean

Whether the caller may delete documents in this collection.

selectedDocs: TDoc[]

The currently-selected rows, resolved from selectedIds against the loaded page.

selectedIds: string[]

The ids of currently-selected rows (DataTable’s onSelectionChange).

setSelectedIds: (ids) => void

Replaces the current selection.

string[]

void


setFilterValueTitle: (id, title) => void

Defined in: packages/react/src/collections/listView/ListViewContext.tsx:106

Records one id’s resolved title — called directly by the relationship/upload FilterInputs’ own picker onSelect (the common “user just picked it” path, title already known from the picker’s own document list) and by their one-shot cold-load fallback query. null records a confirmed not-found/denied id (so the raw-id fallback renders immediately instead of re-querying every render).

string

string | null

void


optional staleFilterField?: string

Defined in: packages/react/src/collections/listView/ListViewContext.tsx:131

Set (to the field that was dropped) when a USER-added filter condition — a URL filter=, or a LOCAL view’s own saved filter (its full state is always URL-embedded, Decision 41, indistinguishable from a raw URL filter) — named a field the caller can no longer read (access-system-fields.md Decision 11) and resolveListViewQueryState dropped it rather than sending a condition the server would reject. Never set for a declared/config view’s own hidden filter (stays exempt, applied regardless of readability) OR a SHARED view’s own saved filter (ALSO exempt — a declared filter per Decision 11’s literal grouping, same as config; see effectiveFilterWhere’s own doc for how a shared view’s filter is surfaced instead, readable or not). Same dismissible-notice shape as staleSortField/staleSearchField.


optional staleSearchField?: string

Defined in: packages/react/src/collections/listView/ListViewContext.tsx:116

Same as staleSortField, for searchField.


optional staleSortField?: string

Defined in: packages/react/src/collections/listView/ListViewContext.tsx:114

Set (to the field that was dropped) when the active view’s own sort.field no longer exists/leads no declared index and fell back to the collection default (polish fix, Decision 7, resolveListViewQueryState/resolveEffectiveViewState) — drives StaleSavedListViewNotice’s dismissible toolbar notice. undefined when sort needed no correction.


urlState: UseListViewUrlStateReturn

Defined in: packages/react/src/collections/listView/ListViewContext.tsx:25

This list’s URL state (useListViewUrlState, this step).


viewPrefetch: UseListViewPrefetchReturn

Defined in: packages/react/src/collections/listView/ListViewContext.tsx:86

Tab hover/focus prefetch handlers + the in-flight pendingViewId (Decision 46, Step 19) — SavedListViewTabs wires its TabsTriggers to this.