moderator-toolbox-nxg-for-reddit / modules/massmoderation/components/ModtoolsToolbar

modules/massmoderation/components/ModtoolsToolbar

Functions

ModtoolsToolbar()

ModtoolsToolbar(__namedParameters): Element

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:109

Parameters

__namedParameters

ModtoolsToolbarProps

Returns

Element

Interfaces

ModtoolsToolbarControls

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:27

Imperative controls exposed to the parent after the toolbar mounts.

Properties

setHiddenCount

setHiddenCount: (n) => void

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:43

Updates the hidden item count; “unhide all” is shown only when this is > 0.

Parameters
n

number

Number of currently hidden items.

Returns

void

setSelectAll

setSelectAll: (checked, indeterminate) => void

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:33

Programmatically updates the select-all checkbox state.

Parameters
checked

boolean

Whether all visible items are selected.

indeterminate

boolean

Whether some (but not all) visible items are selected.

Returns

void

setSelectedCount

setSelectedCount: (n) => void

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:38

Updates the live count of currently selected items shown in the actions group.

Parameters
n

number

Number of items currently checked.

Returns

void

triggerAutoRefresh

triggerAutoRefresh: () => void

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:48

Resets the auto-refresh backoff and polls immediately. Call when an out-of-toolbar action (e.g. a per-item pretty-button) is taken, so the queue reconciles right away.

Returns

void


ModtoolsToolbarProps

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:52

Props for the ModtoolsToolbar component.

Properties

initialAutoRefresh

initialAutoRefresh: boolean

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:63

initialExpandosOpen

initialExpandosOpen: boolean

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:60

initialExpandReports

initialExpandReports: boolean

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:59

initialGroupBySubreddit

initialGroupBySubreddit: boolean

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:62

initialReportsThreshold

initialReportsThreshold: number

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:57

initialScoreThreshold

initialScoreThreshold: number

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:58

initialSortAscending

initialSortAscending: boolean

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:56

initialSortLocked

initialSortLocked: boolean

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:61

initialSortOrder

initialSortOrder: string

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:55

onActionButton

onActionButton: (type) => Promise<number>

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:80

Called when one of the spam/remove/approve/ignore bulk action buttons is clicked. Resolves with the number of items that were actioned.

Parameters
type

"negative" | "neutral" | "positive" | "ignore"

Returns

Promise<number>

onAutoRefreshChange

onAutoRefreshChange: (enabled) => void

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:98

Called when auto-refresh is toggled; parent should persist the new value.

Parameters
enabled

boolean

Returns

void

onAutoRefreshTick

onAutoRefreshTick: () => Promise<boolean>

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:104

Called each time the auto-refresh timer fires; parent should check for new queue items and reconcile the mod log. Resolves to true when something new was found (a new item or a new mod-log action), which resets the backoff to its minimum interval.

Returns

Promise<boolean>

onContentTypeFilter

onContentTypeFilter: (type) => void

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:106

Called when the content-type filter cycles (all / posts / comments).

Parameters
type

"all" | "posts" | "comments"

Returns

void

onGroupBySubreddit

onGroupBySubreddit: (enabled) => void

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:96

Called when the group-by-subreddit toggle changes.

Parameters
enabled

boolean

Returns

void

onHideSelected

onHideSelected: () => void

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:71

Called to hide all currently-selected items from the view.

Returns

void

onInvert

onInvert: () => void

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:67

Called when the user clicks the “invert” button to flip all checkbox states.

Returns

void

onMount

onMount: (controls) => void

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:65

Called once on mount with the imperative controls object.

Parameters
controls

ModtoolsToolbarControls

Returns

void

onOpenExpandos

onOpenExpandos: (open) => void

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:94

Called when the user toggles all expando boxes open or closed.

Parameters
open

boolean

Returns

void

onScoreThresholdChange

onScoreThresholdChange: (threshold) => void

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:84

Called when the score-threshold input changes.

Parameters
threshold

number

Returns

void

onSelectAll

onSelectAll: (checked) => void

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:69

Called when the select-all checkbox changes.

Parameters
checked

boolean

Returns

void

onSortChoice

onSortChoice: (order, toggleAsc) => void

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:90

Called when the user picks a sort order from the dropdown.

Parameters
order

string

The chosen sort field.

toggleAsc

boolean

true when the same field was selected again (toggles direction).

Returns

void

onSortLockChange

onSortLockChange: (locked) => void

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:92

Called when the sort-lock toggle changes.

Parameters
locked

boolean

Returns

void

onThresholdChange

onThresholdChange: (threshold) => void

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:82

Called when the reports-threshold input changes.

Parameters
threshold

number

Returns

void

onToggleReports

onToggleReports: (expanded) => void

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:75

Called when the expand/collapse reports toggle changes.

Parameters
expanded

boolean

Returns

void

onUnhideSelected

onUnhideSelected: () => void

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:73

Called to unhide all previously-hidden items.

Returns

void

viewingspam

viewingspam: boolean

Defined in: extension/data/modules/massmoderation/components/ModtoolsToolbar.tsx:54

Whether the current page is a spam/trials queue (hides the reports sort and threshold).