Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
:class="{
'!w-fit': collapsed,
locked: isLockedByOther,
'right-4': settings.get(moderationSettings.General.ChecklistPosition) === 'right',
'left-4': settings.get(moderationSettings.General.ChecklistPosition) === 'left',
'right-4': settings.get(moderationSettings.Checklist.Position) === 'right',
'left-4': settings.get(moderationSettings.Checklist.Position) === 'left',
}"
>
<div class="flex grow-0 flex-col gap-1">
Expand Down Expand Up @@ -1321,7 +1321,7 @@ onMounted(async () => {
window.addEventListener('keydown', handleKeybinds)
window.addEventListener('beforeunload', handleBeforeUnload)
document.addEventListener('visibilitychange', handleVisibilityChange)
if (settings.value.get(moderationSettings.General.ChecklistPosition) === 'right') {
if (settings.value.get(moderationSettings.Checklist.Position) === 'right') {
notifications.setNotificationLocation('left')
}

Expand Down Expand Up @@ -1618,7 +1618,13 @@ if (finishedId === projectV2.value.id) {
localStorage.removeItem('moderation-checklist-finished')
hasNextProject.value = moderationQueue.queueLength > 0
done.value = true
} else if (projectV2.value.status !== 'processing' && !reviewedAnyway.value) {
} else if (
!reviewedAnyway.value &&
!isEligibleQueueCandidate({
isProcessing: projectV2.value.status === 'processing',
locked: false,
})
) {
alreadyReviewed.value = true
}

Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/src/pages/[type]/[project].vue
Original file line number Diff line number Diff line change
Expand Up @@ -2486,7 +2486,7 @@ function handleKeybinds(event) {
if (!isStaff(auth.value.user)) return
if (
!showModerationChecklist.value &&
!modSettings.value.get(moderationSettings.General.ProjectKeybinds)
!modSettings.value.get(moderationSettings.Checklist.AlwaysAllowKeybinds)
)
return

Expand Down
8 changes: 7 additions & 1 deletion apps/frontend/src/services/moderation/queue-eligibility.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { AbstractModrinthClient } from '@modrinth/api-client'
import { moderationSettings } from '@modrinth/moderation'

import type { ModerationQueueService } from './queue.ts'

Expand All @@ -21,7 +22,12 @@ export interface EligibleQueueProject {
const BATCH_SIZE = 5

export function isEligibleQueueCandidate(result: QueueCandidateCheck | undefined): boolean {
if (!result?.isProcessing) return false
if (
!result ||
(!result.isProcessing &&
!useModerationSettings().value.get(moderationSettings.Checklist.IgnoreConditions))
)
return false
return !result.locked || !!result.expired || !!result.isOwnLock
}

Expand Down
45 changes: 27 additions & 18 deletions packages/moderation/src/data/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,6 @@ import { setting } from '../types/settings.ts'

const settings = {
General: {
ChecklistPosition: setting.asEnum({
type: 'enum',
id: 'checklist-position',
title: 'Checklist position',
description: 'Where the checklist should be displayed on the page',
entries: [
{ value: 'left', label: 'Left' },
{ value: 'right', label: 'Right' },
],
default: 'right',
}),
ProjectKeybinds: setting.asToggle({
type: 'toggle',
id: 'project-keybinds',
title: 'Enable project keybinds',
description: 'Weather certain keybinds should work without the checklist visible.',
default: false,
}),
PrivateMessageHighlight: setting.asToggle({
type: 'toggle',
id: 'private-message-highlight',
Expand Down Expand Up @@ -56,6 +38,33 @@ const settings = {
default: null,
}),
},
Checklist: {
Position: setting.asEnum({
type: 'enum',
id: 'checklist-position',
title: 'Position',
description: 'Where the checklist should be displayed on the page',
entries: [
{ value: 'left', label: 'Left' },
{ value: 'right', label: 'Right' },
],
default: 'right',
}),
AlwaysAllowKeybinds: setting.asToggle({
type: 'toggle',
id: 'checklist-always-allow-keybinds',
title: 'Always allow project keybinds',
description: 'Whether certain keybinds should work without the checklist visible.',
default: false,
}),
IgnoreConditions: setting.asToggle({
type: 'toggle',
id: 'checklist-ignore-conditions',
title: 'Ignore checklist conditions',
description: 'Allow moderating projects the checklist normally auto skips.',
default: false,
}),
},
} as const

export default settings
2 changes: 1 addition & 1 deletion packages/moderation/src/handles/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class Settings {

export function getMarginTarget(settings: Settings): string {
return settings.get(moderationSettings.General.AdjustPageAlignment) == 'always'
? settings.get(moderationSettings.General.ChecklistPosition) == 'right'
? settings.get(moderationSettings.Checklist.Position) == 'right'
? 'r'
: 'l'
: 'x'
Expand Down
Loading