Skip to content

Commit

Permalink
feat: add new comment for link-only answers
Browse files Browse the repository at this point in the history
  • Loading branch information
double-beep authored Jun 25, 2024
1 parent c5d31d4 commit 9b6387e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
14 changes: 12 additions & 2 deletions src/Configuration.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { flagCategories } from './FlagTypes';
import {
Store,
Cached,
CachedCategory,
CachedFlag
} from './UserscriptTools/Store';
import { Flags } from './FlagTypes';
import { Flags, flagCategories } from './FlagTypes';

import { FlagNames, displayStacksToast } from './shared';

Expand Down Expand Up @@ -80,6 +79,17 @@ function setupDefaults(): void {
if (!Store.categories.length
|| !('id' in Store.categories[0])) {
cacheCategories();

// update default link-only comment!
const linkOnly = Store.flagTypes.find(({ id }) => id === 6);
const defaultComment = flagCategories[2].FlagTypes[0].comments?.low;
if (linkOnly // link only flag type has not been removed
&& defaultComment
&& linkOnly.comments?.low.includes('target page is unavailable') // using old comment
) {
linkOnly.comments.low = defaultComment;
Store.updateFlagTypes();
}
}

// PostOther can be replaced with PlagiarizedContent
Expand Down
8 changes: 5 additions & 3 deletions src/FlagTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,12 @@ export const flagCategories: FlagCategory[] = [
displayName: 'Link Only',
reportType: FlagNames.VLQ,
comments: {
// comment by Yunnosch: https://chat.stackoverflow.com/transcript/message/57442309
low: 'A link to a solution is welcome, but please ensure your answer is useful without it: '
+ '[add context around the link](//meta.stackexchange.com/a/8259) so your fellow users will '
+ 'have some idea what it is and why it is there, then quote the most relevant part of the page '
+ 'you are linking to in case the target page is unavailable. '
+ 'You need to provide at least a technical summary of *how* the problem is solved, so that '
+ 'it can be reproduced even without the link. It is not enough to advertise *what* it '
+ 'achieves. Also please [add context around the link](//meta.stackexchange.com/a/8259) '
+ 'so your fellow users will have some idea what it is and why it is there. '
+ `[Answers that are little more than a link may be deleted.](${deletedAnswers})`,
},
feedbacks: { Smokey: 'naa-', Natty: 'tp', Guttenberg: '', 'Generic Bot': 'track' },
Expand Down

0 comments on commit 9b6387e

Please sign in to comment.