mirror of
https://github.com/modrinth/code.git
synced 2026-08-25 09:04:55 +00:00
feat: requested moderation and tech review changes (#7019)
* feat: requested moderation and tech review changes * chore: run prepr * chore: run prepr --------- Signed-off-by: ThatGravyBoat <gravy@thatgravyboat.tech>
This commit is contained in:
@@ -115,6 +115,18 @@ const keybinds: { [id: string]: KeybindListener } = {
|
||||
scope: 'checklist',
|
||||
action: (ctx) => ctx.actions.tryReject(),
|
||||
},
|
||||
'tech-review-top': {
|
||||
keybind: 'ArrowUp',
|
||||
description: 'Go to top of the tech review card',
|
||||
scope: 'tech-review',
|
||||
action: (ctx) => ctx.actions.goToTop(),
|
||||
},
|
||||
'tech-review-bottom': {
|
||||
keybind: 'ArrowDown',
|
||||
description: 'Go to bottom of the tech review card',
|
||||
scope: 'tech-review',
|
||||
action: (ctx) => ctx.actions.goToBottom(),
|
||||
},
|
||||
}
|
||||
|
||||
export default keybinds
|
||||
|
||||
@@ -27,6 +27,13 @@ const settings = {
|
||||
description: 'Whether private messages should be highlighted in the chat.',
|
||||
default: true,
|
||||
}),
|
||||
SlicerButtonInVersions: setting.asToggle({
|
||||
type: 'toggle',
|
||||
id: 'slicer-button-in-versions',
|
||||
title: 'Show Slicer Button in Versions Table and Page',
|
||||
description: 'Whether the slicer button should be shown in the versions table and page.',
|
||||
default: false,
|
||||
}),
|
||||
AdjustPageAlignment: setting.asEnum({
|
||||
type: 'enum',
|
||||
id: 'adjust-page-alignment',
|
||||
|
||||
@@ -16,6 +16,11 @@ export interface ModerationActions {
|
||||
tryEditMessage: () => void
|
||||
}
|
||||
|
||||
export interface TechReviewActions {
|
||||
goToTop: () => void
|
||||
goToBottom: () => void
|
||||
}
|
||||
|
||||
export interface ModerationState {
|
||||
currentStage: number
|
||||
totalStages: number
|
||||
@@ -44,7 +49,15 @@ export type ModerationChecklistContext = {
|
||||
actions: ModerationActions
|
||||
}
|
||||
|
||||
export type ModerationContext = ModerationProjectContext | ModerationChecklistContext
|
||||
export type ModerationTechReviewContext = {
|
||||
scope: 'tech-review'
|
||||
actions: TechReviewActions
|
||||
}
|
||||
|
||||
export type ModerationContext =
|
||||
| ModerationProjectContext
|
||||
| ModerationChecklistContext
|
||||
| ModerationTechReviewContext
|
||||
|
||||
export interface KeybindDefinition {
|
||||
key: string
|
||||
@@ -58,7 +71,7 @@ export interface KeybindDefinition {
|
||||
export type BaseKeybindListener<T> = {
|
||||
keybind: KeybindDefinition | KeybindDefinition[] | string | string[]
|
||||
description: string
|
||||
scope: 'project' | 'checklist'
|
||||
scope: 'project' | 'checklist' | 'tech-review'
|
||||
enabled?: (ctx: T) => boolean
|
||||
action: (ctx: T) => void
|
||||
}
|
||||
@@ -69,7 +82,13 @@ export type KeybindProjectListener = BaseKeybindListener<ModerationProjectContex
|
||||
export type KeybindChecklistListener = BaseKeybindListener<ModerationChecklistContext> & {
|
||||
scope: 'checklist'
|
||||
}
|
||||
export type KeybindListener = KeybindProjectListener | KeybindChecklistListener
|
||||
export type KeybindTechReviewListener = BaseKeybindListener<ModerationTechReviewContext> & {
|
||||
scope: 'tech-review'
|
||||
}
|
||||
export type KeybindListener =
|
||||
| KeybindProjectListener
|
||||
| KeybindChecklistListener
|
||||
| KeybindTechReviewListener
|
||||
|
||||
export function parseKeybind(keybindString: string): KeybindDefinition {
|
||||
const parts = keybindString.split('+').map((p) => p.trim().toLowerCase())
|
||||
|
||||
Reference in New Issue
Block a user