Skip to content

Commit 9727320

Browse files
Drop the public tag picker and the dead metadata-tags field
Portal membership is submissions.portal_id, not a tag: the backend force-seeds the portal's own slug into every submission's tags, and the documents/list gallery matches portal_id regardless of what a submitter types. The submission form's free-form tag selector therefore only let the public invent junk tags — removed, along with its TagSelector components. Editor-set mandatoryTags from the form block still ride along invisibly (curated cross-portal comment galleries keep working). The SaveShareModal's permanently disabled "Tags (coming soon)" metadata field goes too: nothing in the stack ever writes map-metadata tags, and metadata tags are deliberately not a gallery mechanism. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 1ba4c33 commit 9727320

4 files changed

Lines changed: 21 additions & 139 deletions

File tree

app/src/app/components/Forms/CommentFormTagSelector.tsx

Lines changed: 0 additions & 47 deletions
This file was deleted.

app/src/app/components/Forms/SubmissionForm.tsx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ import {useFormState} from '@/app/store/formState';
44
import {Blockquote, Box, Button, Dialog, Flex, Spinner, TextArea} from '@radix-ui/themes';
55
import {AcknowledgementField} from './AcknowledgementField';
66
import {FormField} from './FormField';
7-
import {CommentFormTagSelector} from './CommentFormTagSelector';
87
import {MapSelector} from './MapSelector';
98
import {useTurnstile} from '@/app/hooks/useTurnstile';
10-
import {useLayoutEffect, useRef} from 'react';
9+
import {useEffect, useLayoutEffect, useRef} from 'react';
1110
import {FIELD_ORDER, FIELD_REGISTRY} from './fieldRegistry';
1211

1312
export interface CustomFieldSpec {
@@ -75,6 +74,14 @@ export const SubmissionForm: React.FC<SubmissionFormProps> = ({
7574
setFormRef(formRef);
7675
}, [formRef]);
7776

77+
// Editor-set block tags still ride along on the submission (for curated
78+
// cross-portal galleries), just without a public tag-picker UI — portal
79+
// membership itself is the submission's portal_id, not a tag.
80+
const setTags = useFormState(state => state.setTags);
81+
useEffect(() => {
82+
mandatoryTags.forEach(tag => setTags(tag, 'add'));
83+
}, [mandatoryTags, setTags]);
84+
7885
if (!portalId || !fields) {
7986
// No form config for this portal (or a form block on a non-portal page).
8087
return null;
@@ -196,16 +203,7 @@ export const SubmissionForm: React.FC<SubmissionFormProps> = ({
196203
<Flex direction="column" gap="4">
197204
<ContentHeader title="Add Your Comment" />
198205
{submissionFields.map(renderField)}
199-
<Flex
200-
direction={{
201-
initial: 'column',
202-
md: 'row',
203-
}}
204-
gap="4"
205-
>
206-
<CommentFormTagSelector mandatoryTags={mandatoryTags} />
207-
<MapSelector allowListModules={allowListModules} />
208-
</Flex>
206+
<MapSelector allowListModules={allowListModules} />
209207
{aboutFields.length > 0 && <ContentHeader title="Tell us about yourself" />}
210208
<Flex direction="column" gap="4" width="100%">
211209
{aboutFields.map(renderField)}

app/src/app/components/Forms/TagSelector.tsx

Lines changed: 0 additions & 58 deletions
This file was deleted.

app/src/app/components/Toolbar/SaveShareModal/MapDetailsSection.tsx

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {DocumentMetadata} from '@/app/utils/api/apiHandlers/types';
2-
import {Box, Button, Flex, Grid, Heading, Text, TextArea, TextField} from '@radix-ui/themes';
2+
import {Box, Button, Flex, Heading, Text, TextArea, TextField} from '@radix-ui/themes';
33
import {MapStatusButtons} from '../../Topbar/MapStatus';
44
import * as Accordion from '@radix-ui/react-accordion';
55
import {useState} from 'react';
@@ -53,27 +53,16 @@ export const MapDetailsSection: React.FC<{
5353
</Button>
5454
</Accordion.AccordionTrigger>
5555
<Accordion.AccordionContent className="AccordionContent">
56-
<Grid columns="2" gap="2">
57-
<Box>
58-
<Text>Group</Text>
59-
<TextField.Root
60-
className="flex-1 w-full"
61-
value={mapMetadata.group ?? ''}
62-
placeholder="Group"
63-
disabled={!isEditing}
64-
onChange={e => onChange({group: e.target.value})}
65-
/>
66-
</Box>
67-
<Box>
68-
<Text>Tags (coming soon)</Text>
69-
<TextField.Root
70-
className="flex-1 w-full"
71-
value={mapMetadata.tags?.join(', ') ?? ''}
72-
placeholder="Tags"
73-
disabled={true}
74-
/>
75-
</Box>
76-
</Grid>
56+
<Box>
57+
<Text>Group</Text>
58+
<TextField.Root
59+
className="flex-1 w-full"
60+
value={mapMetadata.group ?? ''}
61+
placeholder="Group"
62+
disabled={!isEditing}
63+
onChange={e => onChange({group: e.target.value})}
64+
/>
65+
</Box>
7766
<Box>
7867
<Text>Comments</Text>
7968
<TextArea

0 commit comments

Comments
 (0)