Moderation Changes Phase 2.-1 (#6833)

* better default state handling

* make next stage button work for going to next project

* fix skill issue

* actually fix initial values this time,
make single line inputs with varying lengths (text input and dropdown) use their widest possible length instead of whatever the hell they used to be

* loaders in progress

* loaders and versions test (probably dont use them as the messages suck and idrk what they should do quick fix/message wise)

* WIP the wip

* good enough for now slug taken improvements

* trim all those extra newlines

* viewedness

* batch prefetch queue + technically slightly faster checklist init

* show all valid alternative project types regardless of current project type

* Hide moderation permissions stage when it should be, and I'm sure this won't cause any issues

* Hide moderation permissions stage when it should be, and I'm sure this won't cause any issues

* gimme them versions

* better moderation permission stage shown check?

* betterer moderation permission stage shown check?

* bettererer moderation permission stage shown check? + also began deleting legacy checklist types

* fix certain stages being able to be considered viewed before being viewed

* more removals + i forgot to remove an import last commit

* changed nothing™️

* remove severities + bandaid post-approval message priorities + dependencies

* fix message preview tooltips

* next stage = next project when done

* insufficient description custom fix

* fix that thing coolbot told me was broken I forgot what it was oops

* oh there was a second bug there

* make alternate versions and incorrect project type required cuz they are

* re-navigate button also damn that's a lot of other stuff that pnpm fix... fixed?

* you cant just quick fix a slug into a taken one

* maybe lets not just try and set a slug to something entirely invalid?

* what if we just didn't drop ur queue :smart:

* more queue upgrades

* tweaks

* I love unbreaking things

* un-nuked renavigate button

* prepr

* prepr worked this time i think

* undo more mistakes

* i love intellij refactoring

* ok i think we're good
This commit is contained in:
chyz
2026-08-07 23:40:11 +00:00
committed by GitHub
parent e4cbec6b2c
commit 5072c1d298
77 changed files with 3596 additions and 3502 deletions
+5 -1
View File
@@ -1,3 +1,4 @@
import keybinds from '../data/keybinds.ts'
import {
type KeybindDefinition,
type KeybindListener,
@@ -5,7 +6,6 @@ import {
type ModerationContext,
normalizeKeybind,
} from '../types/keybinds.ts'
import keybinds from '../data/keybinds.ts'
function normalizeKeybinds(
keybind: KeybindDefinition | KeybindDefinition[] | string | string[],
@@ -58,6 +58,9 @@ export class Keybinds {
continue
}
// The scope check above guarantees ctx matches keybind's expected context shape,
// but TS can't correlate that narrowing across these two independently-typed variables.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if (keybind.enabled && !keybind.enabled(ctx as any)) {
continue
}
@@ -66,6 +69,7 @@ export class Keybinds {
const matches = definitions.some((def) => matchesKeybind(event, def))
if (matches) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
keybind.action(ctx as any)
const shouldPrevent = definitions.some((def) => def.preventDefault !== false)
+9 -5
View File
@@ -1,12 +1,12 @@
import { isValidFor, type SettingDefinitionBase } from '../types/settings.ts'
import { moderationSettings } from '../index.ts'
import { isValidFor, type SettingDefinitionBase } from '../types/settings.ts'
export class Settings {
private readonly settings: { [id: string]: any }
private readonly settings: { [id: string]: unknown }
private readonly onChange: () => void
constructor(
settings: { [id: string]: any } | undefined = undefined,
settings: { [id: string]: unknown } | undefined = undefined,
onChange: () => void = () => {},
) {
this.settings = settings || {}
@@ -16,11 +16,15 @@ export class Settings {
get<T>(definition: SettingDefinitionBase<T>): T {
const value = this.settings[definition.id]
return (isValidFor(definition, value) ? value : undefined) ?? definition.default
return (
(isValidFor(definition as SettingDefinitionBase<unknown>, value)
? (value as T)
: undefined) ?? definition.default
)
}
set<T>(definition: SettingDefinitionBase<T>, value?: T): void {
const previous = this.settings[definition.id] ?? definition.default
const previous = (this.settings[definition.id] as T | undefined) ?? definition.default
this.settings[definition.id] = value
definition.onChange?.(previous, value ?? definition.default)
this.onChange()