fix(flags): move reply flag below link and auto-geo on /bant/

Hide the flag selector on /bant/ while still publishing geographic location, and place the reply modal flag field after the link field.
This commit is contained in:
Tommaso Casaburi
2026-05-24 23:38:15 +07:00
parent 2030b8c5bb
commit 633542a1f7
5 changed files with 105 additions and 19 deletions
@@ -1,5 +1,10 @@
import { describe, expect, it } from 'vitest';
import { getCommentFlagOptionsForDirectory, getCommentFlagPublishOptionsFromSelection, getCommentFlagRequestFromSelection } from '../comment-flag-selection';
import {
getCommentFlagOptionsForDirectory,
getCommentFlagPublishOptionsForDirectory,
getCommentFlagPublishOptionsFromSelection,
getCommentFlagRequestFromSelection,
} from '../comment-flag-selection';
describe('comment-flag-selection', () => {
it('does not expose options for boards without flags', () => {
@@ -16,6 +21,29 @@ describe('comment-flag-selection', () => {
).toEqual([{ label: 'Geographic Location', value: 'country:auto' }]);
});
it('does not expose a flag selector on /bant/ but still publishes geographic location', () => {
expect(
getCommentFlagOptionsForDirectory({
directoryCode: 'bant',
features: { hasFlags: true },
title: '/bant/ - International/Random',
}),
).toEqual([]);
expect(
getCommentFlagPublishOptionsForDirectory({
directoryCode: 'bant',
features: { hasFlags: true },
title: '/bant/ - International/Random',
}),
).toEqual({
challengeRequest: {
challengeAnswers: ['bitsocial-flags:5chan:flag:country:auto'],
},
flairs: [{ type: 'country', code: 'auto', text: 'flag:country:auto' }],
});
});
it('matches the 4chan /pol/ flag order', () => {
const options = getCommentFlagOptionsForDirectory({
directoryCode: 'pol',