moderator-toolbox-nxg-for-reddit / modules/modmatrix/schema

modules/modmatrix/schema

Functions

buildActionGroupMap()

buildActionGroupMap(subredditActions): Map<string, string>

Defined in: extension/data/modules/modmatrix/schema.ts:355

Maps action code -> top-level group label. Codes not in any group map to ‘Other’.

Parameters

subredditActions

Record<string, { title: string; }>

Returns

Map<string, string>


buildColumnGroups()

buildColumnGroups(sortedActionCodes, groupMap): ColumnGroup[]

Defined in: extension/data/modules/modmatrix/schema.ts:384

Builds an ordered list of column groups from the sorted action codes.

Parameters

sortedActionCodes

string[]

groupMap

Map<string, string>

Returns

ColumnGroup[]


sortActionCodes()

sortActionCodes(actionCodes, subredditActions): string[]

Defined in: extension/data/modules/modmatrix/schema.ts:322

Returns actionCodes sorted so that codes whose titles match entries in actionGroups appear first in group order, with any unrecognised codes appended at the end.

Parameters

actionCodes

string[]

subredditActions

Record<string, { title: string; }>

Returns

string[]

Interfaces

ActionInfo

Defined in: extension/data/modules/modmatrix/schema.ts:6

Display metadata for a single mod-log action type.

Properties

className

className: string

Defined in: extension/data/modules/modmatrix/schema.ts:10

CSS class name applied to the icon element.

title

title: string

Defined in: extension/data/modules/modmatrix/schema.ts:8

Human-readable label (e.g. “Remove post”).


ColumnGroup

Defined in: extension/data/modules/modmatrix/schema.ts:377

A column group as used by MatrixTable.

Properties

codes

codes: string[]

Defined in: extension/data/modules/modmatrix/schema.ts:379

isOther

isOther: boolean

Defined in: extension/data/modules/modmatrix/schema.ts:380

label

label: string

Defined in: extension/data/modules/modmatrix/schema.ts:378


GroupDef

Defined in: extension/data/modules/modmatrix/schema.ts:97

A top-level action group used to organise columns in the matrix.

Properties

items?

optional items?: string[]

Defined in: extension/data/modules/modmatrix/schema.ts:100

Direct action titles that belong to this group (without sub-groups).

label

label: string

Defined in: extension/data/modules/modmatrix/schema.ts:98

subs?

optional subs?: SubGroupDef[]

Defined in: extension/data/modules/modmatrix/schema.ts:102

Optional sub-groups for finer categorisation.


MatrixState

Defined in: extension/data/modules/modmatrix/schema.ts:34

Complete application state for the Mod Log Matrix feature.

Properties

actionFilter

actionFilter: string[] | null

Defined in: extension/data/modules/modmatrix/schema.ts:44

Active action filter; null shows all action types.

currentSorting

currentSorting: SortState

Defined in: extension/data/modules/modmatrix/schema.ts:45

error

error: boolean

Defined in: extension/data/modules/modmatrix/schema.ts:57

firstEntry

firstEntry: ModLogEntry | null

Defined in: extension/data/modules/modmatrix/schema.ts:51

The oldest log entry received in the current fetch, used for the status bar.

hideZeroColumns

hideZeroColumns: boolean

Defined in: extension/data/modules/modmatrix/schema.ts:61

hideZeroMods

hideZeroMods: boolean

Defined in: extension/data/modules/modmatrix/schema.ts:62

highlightThreshold

highlightThreshold: number

Defined in: extension/data/modules/modmatrix/schema.ts:60

Moderator rows whose percentage falls below this value are highlighted; 0 disables highlighting.

lastEntry

lastEntry: ModLogEntry | null

Defined in: extension/data/modules/modmatrix/schema.ts:53

The most recent log entry received in the current fetch, used for the status bar.

loading

loading: boolean

Defined in: extension/data/modules/modmatrix/schema.ts:56

maxDate

maxDate: number | null

Defined in: extension/data/modules/modmatrix/schema.ts:49

End of the selected date range as a millisecond Unix timestamp, or null if not yet set.

minDate

minDate: number | null

Defined in: extension/data/modules/modmatrix/schema.ts:47

Start of the selected date range as a millisecond Unix timestamp, or null if not yet set.

modFilter

modFilter: string[] | null

Defined in: extension/data/modules/modmatrix/schema.ts:42

Active moderator filter; null shows all moderators.

modTimeline

modTimeline: Record<string, number[]>

Defined in: extension/data/modules/modmatrix/schema.ts:64

Per-moderator daily action counts indexed by day offset from minDate.

showPercentages

showPercentages: boolean

Defined in: extension/data/modules/modmatrix/schema.ts:58

showSparklines

showSparklines: boolean

Defined in: extension/data/modules/modmatrix/schema.ts:67

subredditActions

subredditActions: Record<string, ActionInfo>

Defined in: extension/data/modules/modmatrix/schema.ts:40

All action types seen in the subreddit’s mod log, keyed by action code.

subredditModerators

subredditModerators: Record<string, Record<string, number>>

Defined in: extension/data/modules/modmatrix/schema.ts:38

Per-moderator action counts, keyed by action code.

subredditName

subredditName: string | null

Defined in: extension/data/modules/modmatrix/schema.ts:36

subredditUrl

subredditUrl: string | null

Defined in: extension/data/modules/modmatrix/schema.ts:35

timelineDays

timelineDays: number

Defined in: extension/data/modules/modmatrix/schema.ts:66

Number of days in the timeline, computed from the date range.

total

total: number

Defined in: extension/data/modules/modmatrix/schema.ts:55

Total number of log entries processed in the current fetch.


ModLogEntry

Defined in: extension/data/modules/modmatrix/schema.ts:14

A single entry from the Reddit mod log API (/r/{sub}/about/log).

Extends

Properties

action

action: string

Defined in: extension/data/api/resources/subreddits.ts:44

API action type code (e.g. removelink, banuser).

Inherited from

RedditModLogEntry.action

created_utc

created_utc: number

Defined in: extension/data/api/resources/subreddits.ts:48

Unix timestamp of the action in seconds.

Inherited from

RedditModLogEntry.created_utc

id

id: string

Defined in: extension/data/modules/modmatrix/schema.ts:19

mod

mod: string

Defined in: extension/data/api/resources/subreddits.ts:46

Username of the moderator who performed the action.

Inherited from

RedditModLogEntry.mod

target_body?

optional target_body?: string

Defined in: extension/data/modules/modmatrix/schema.ts:16

Preview text of the targeted item, if available.

target_fullname?

optional target_fullname?: string

Defined in: extension/data/modules/modmatrix/schema.ts:18

Reddit fullname of the targeted item (e.g. t3_abc), if available.


SortState

Defined in: extension/data/modules/modmatrix/schema.ts:26

Current column sort configuration.

Properties

direction

direction: -1 | 1

Defined in: extension/data/modules/modmatrix/schema.ts:30

1 = descending (highest first), -1 = ascending.

key

key: string | null

Defined in: extension/data/modules/modmatrix/schema.ts:28

The column being sorted, or null for the default (unsorted) order.


SubGroupDef

Defined in: extension/data/modules/modmatrix/schema.ts:90

A leaf sub-group within a top-level GroupDef.

Properties

items

items: string[]

Defined in: extension/data/modules/modmatrix/schema.ts:93

Action titles (not codes) that belong to this sub-group.

label

label: string

Defined in: extension/data/modules/modmatrix/schema.ts:91

Type Aliases

MatrixAction

MatrixAction = { maxDate: number; minDate: number; type: "SET_DATE_RANGE"; } | { type: "START_FETCH"; } | { entries: ModLogEntry[]; type: "PROCESS_BATCH"; } | { type: "FINISH_FETCH"; } | { type: "SET_ERROR"; } | { type: "RESET_DATA"; } | { modFilter: string[] | null; type: "SET_MOD_FILTER"; } | { actionFilter: string[] | null; type: "SET_ACTION_FILTER"; } | { direction: 1 | -1; key: SortKey; type: "SET_SORT"; } | { hideZeroColumns?: boolean; hideZeroMods?: boolean; highlightThreshold?: number; showPercentages?: boolean; showSparklines?: boolean; type: "SET_DISPLAY_OPTIONS"; }

Defined in: extension/data/modules/modmatrix/schema.ts:70


SortKey

SortKey = string

Defined in: extension/data/modules/modmatrix/schema.ts:23

Sort key: ‘name’ | ‘total’ | ‘pct’ | ‘grp:GroupLabel’ | an action code string

Variables

actionGroups

const actionGroups: GroupDef[]

Defined in: extension/data/modules/modmatrix/schema.ts:105