From 13103b49502e0f4b2b2e8636ba6fd615d87394ce Mon Sep 17 00:00:00 2001 From: coolbot <76798835+coolbot100s@users.noreply.github.com> Date: Mon, 28 Jul 2025 05:56:47 -0700 Subject: [PATCH] various moderation fixes and improvements (#4061) * Typo correction * show optimization button when present in additional categories * add more formatted link shortcuts * Add info text to env info stage * Only show gallery relevancy button when relevant. * add unsupported project type message to versions stage * Fix misuse of slug message. * Update unsupported_project.md * lint fix --- .../messages/checklist-text/side_types.md | 2 ++ .../moderation/data/messages/slug/misused.md | 6 ++++-- .../data/messages/status-alerts/private.md | 2 +- .../messages/versions/unsupported_project.md | 7 +++++++ packages/moderation/data/stages/categories.ts | 4 +++- packages/moderation/data/stages/gallery.ts | 1 + packages/moderation/data/stages/side-types.ts | 3 ++- packages/moderation/data/stages/versions.ts | 19 ++++++++++++++++++- packages/moderation/utils.ts | 5 +++++ 9 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 packages/moderation/data/messages/checklist-text/side_types.md create mode 100644 packages/moderation/data/messages/versions/unsupported_project.md diff --git a/packages/moderation/data/messages/checklist-text/side_types.md b/packages/moderation/data/messages/checklist-text/side_types.md new file mode 100644 index 000000000..7c15b85eb --- /dev/null +++ b/packages/moderation/data/messages/checklist-text/side_types.md @@ -0,0 +1,2 @@ +**Client:** `%PROJECT_CLIENT_SIDE%` \ +**Server:** `%PROJECT_SERVER_SIDE%` diff --git a/packages/moderation/data/messages/slug/misused.md b/packages/moderation/data/messages/slug/misused.md index 097e449ca..ebf8b2f64 100644 --- a/packages/moderation/data/messages/slug/misused.md +++ b/packages/moderation/data/messages/slug/misused.md @@ -1,3 +1,5 @@ -## Misuse of Slug +## Misuse of custom URL -Per section 5.2 of %RULES% must accurately represent your project. +We ask that you ensure your project's %PROJECT_SLUG_FLINK% accurately represents your project. +Your current slug of `%PROJECT_SLUG%` may not accurately match your project's Name or contain excess information. +A mismatched URL may make it more difficult for users to find your content. Abbreviations or similar are fine to use if applicable. If your preferred URL is not available, and you cannot find a matching public project, let us know in this moderation thread when you resubmit your project, and our moderation team may be able to free it up for your project. diff --git a/packages/moderation/data/messages/status-alerts/private.md b/packages/moderation/data/messages/status-alerts/private.md index a28626191..cb9cd608d 100644 --- a/packages/moderation/data/messages/status-alerts/private.md +++ b/packages/moderation/data/messages/status-alerts/private.md @@ -3,6 +3,6 @@ ## Private Use Under normal circumstances, your project would be rejected due to the issues listed above. -However, since your project is not intended for for public use, these requirements will be waived and your project will be unlisted. This means it will remain accessible through a direct link without appearing in public search results, allowing you to share it privately. +However, since your project is not intended for public use, these requirements will be waived and your project will be unlisted. This means it will remain accessible through a direct link without appearing in public search results, allowing you to share it privately. If you're okay with this, or submitted your project to be unlisted already, than no further action is necessary. If you would like to publish your project publicly, please address all moderation concerns before resubmitting this project. diff --git a/packages/moderation/data/messages/versions/unsupported_project.md b/packages/moderation/data/messages/versions/unsupported_project.md new file mode 100644 index 000000000..7c3c9283e --- /dev/null +++ b/packages/moderation/data/messages/versions/unsupported_project.md @@ -0,0 +1,7 @@ +## Unsupported Project + +Unfortunately, Modrinth does not currently support the upload of %INVALID_TYPE%. + +If you would like to publish this project in the future and help Modrinth grow, consider creating an [issue](https://github.com/modrinth/code/issues) suggesting support for this type of content. + +We appreciate your understanding and look forward to hosting your other creations. diff --git a/packages/moderation/data/stages/categories.ts b/packages/moderation/data/stages/categories.ts index 5ef5840b8..324d56634 100644 --- a/packages/moderation/data/stages/categories.ts +++ b/packages/moderation/data/stages/categories.ts @@ -31,7 +31,9 @@ const categories: Stage = { weight: 701, suggestedStatus: 'flagged', severity: 'low', - shouldShow: (project) => project.categories.includes('optimization'), + shouldShow: (project) => + project.categories.includes('optimization') || + project.additional_categories.includes('optimization'), message: async () => (await import('../messages/categories/inaccurate.md?raw')).default + (await import('../messages/categories/optimization_misused.md?raw')).default, diff --git a/packages/moderation/data/stages/gallery.ts b/packages/moderation/data/stages/gallery.ts index 6732ad0f3..35eae3320 100644 --- a/packages/moderation/data/stages/gallery.ts +++ b/packages/moderation/data/stages/gallery.ts @@ -25,6 +25,7 @@ const gallery: Stage = { weight: 901, suggestedStatus: 'flagged', severity: 'low', + shouldShow: (project) => project.gallery && project.gallery.length > 0, message: async () => (await import('../messages/gallery/not-relevant.md?raw')).default, } as ButtonAction, ], diff --git a/packages/moderation/data/stages/side-types.ts b/packages/moderation/data/stages/side-types.ts index 1dda8e85b..397d9d69f 100644 --- a/packages/moderation/data/stages/side-types.ts +++ b/packages/moderation/data/stages/side-types.ts @@ -7,7 +7,8 @@ const sideTypes: Stage = { id: 'environment', icon: GlobeIcon, guidance_url: 'https://modrinth.com/legal/rules#miscellaneous', - navigate: '/settings#side-types', + navigate: '/settings', + text: async () => (await import('../messages/checklist-text/side_types.md?raw')).default, actions: [ { id: 'side_types_inaccurate_modpack', diff --git a/packages/moderation/data/stages/versions.ts b/packages/moderation/data/stages/versions.ts index 951ac2879..9976fa968 100644 --- a/packages/moderation/data/stages/versions.ts +++ b/packages/moderation/data/stages/versions.ts @@ -150,7 +150,24 @@ const versions: Stage = { severity: `medium`, weight: 1004, message: async () => (await import('../messages/versions/broken_version.md?raw')).default, - }, + } as ButtonAction, + { + id: 'unsupported_project_type', + type: 'button', + label: `Unsupported`, + suggestedStatus: `rejected`, + severity: `medium`, + weight: 1005, + message: async () => + (await import('../messages/versions/unsupported_project.md?raw')).default, + relevantExtraInput: [ + { + label: 'Project Type', + required: true, + variable: 'INVALID_TYPE', + }, + ], + } as ButtonAction, ], } diff --git a/packages/moderation/utils.ts b/packages/moderation/utils.ts index 202b3ffa1..9aafa0588 100644 --- a/packages/moderation/utils.ts +++ b/packages/moderation/utils.ts @@ -317,6 +317,11 @@ export function flattenProjectVariables(project: Project): Record