Skip to content

Commit 74f2ef5

Browse files
dbieberclaude
andauthored
Fix note taking system selection values in settings UI (#101)
Update the settings UI to send lowercase system values to the backend when selecting from the dropdown. This ensures consistency between the UI labels and the values expected by the backend system. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 524ab09 commit 74f2ef5

File tree

1 file changed

+18
-26
lines changed
  • gonotego/settings-server/src

1 file changed

+18
-26
lines changed

gonotego/settings-server/src/App.tsx

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ import {
1313

1414
const SettingsUI = () => {
1515
const NOTE_TAKING_SYSTEMS = [
16-
'Roam Research',
17-
'RemNote',
18-
'IdeaFlow',
19-
'Mem',
20-
'Notion',
21-
'Twitter',
22-
'Email'
16+
{ display: 'Roam Research', value: 'roam' },
17+
{ display: 'RemNote', value: 'remnote' },
18+
{ display: 'IdeaFlow', value: 'ideaflow' },
19+
{ display: 'Mem', value: 'mem' },
20+
{ display: 'Notion', value: 'notion' },
21+
{ display: 'Twitter', value: 'twitter' },
22+
{ display: 'Email', value: 'email' }
2323
];
2424

2525
const [settings, setSettings] = useState({
@@ -210,22 +210,12 @@ const SettingsUI = () => {
210210

211211
const shouldShowSection = (section) => {
212212
const system = settings.NOTE_TAKING_SYSTEM;
213-
switch (section) {
214-
case 'roam':
215-
return system === 'Roam Research';
216-
case 'remnote':
217-
return system === 'RemNote';
218-
case 'ideaflow':
219-
return system === 'IdeaFlow';
220-
case 'mem':
221-
return system === 'Mem';
222-
case 'notion':
223-
return system === 'Notion';
224-
case 'twitter':
225-
return system === 'Twitter';
226-
default:
227-
return true;
228-
}
213+
return system === section;
214+
};
215+
216+
const getSystemDisplayName = (value) => {
217+
const system = NOTE_TAKING_SYSTEMS.find(sys => sys.value === value);
218+
return system ? system.display : value;
229219
};
230220

231221
return (
@@ -270,13 +260,15 @@ const SettingsUI = () => {
270260
onValueChange={(value) => handleChange('NOTE_TAKING_SYSTEM', value)}
271261
>
272262
<SelectTrigger>
273-
<SelectValue placeholder="Select a note-taking system" />
263+
<SelectValue placeholder="Select a note-taking system">
264+
{settings.NOTE_TAKING_SYSTEM ? getSystemDisplayName(settings.NOTE_TAKING_SYSTEM) : ""}
265+
</SelectValue>
274266
</SelectTrigger>
275267
<SelectContent>
276268
<SelectGroup>
277269
{NOTE_TAKING_SYSTEMS.map(system => (
278-
<SelectItem key={system} value={system}>
279-
{system}
270+
<SelectItem key={system.value} value={system.value}>
271+
{system.display}
280272
</SelectItem>
281273
))}
282274
</SelectGroup>

0 commit comments

Comments
 (0)