Skip to content

Commit 7b7de06

Browse files
authored
🐛 fix: Stop guessing URL fields from key names in config form (#38)
The admin panel's text-field renderer was inferring URL-ness from a substring match on the field key (`url`, `endpoint`). The `endpoint` substring matched the modelSpec preset `endpoint` field — which is a categorical enum like `openAI`, not a URL. Rendering it as `<input type="url">` triggered browser autofill that swallowed uppercase keystrokes, making `openAI` and other camel-cased endpoint values impossible to type. Removes the keyword heuristic outright. LibreChat's configSchema today declares zero `.url()` validations, so no field in the form should be rendered as `type="url"`. If the schema ever tags a field with `.url()`, detection can be added at the schema-extraction layer at that point. Linear: AI-895
1 parent 8a44929 commit 7b7de06

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/components/configuration/FieldRenderer.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,6 @@ export function SingleFieldRenderer({
360360
if (controlType === 'text') {
361361
const stringValue = typeof currentValue === 'string' ? currentValue : '';
362362
const isMultiline = stringValue.includes('\n') || field.key.toLowerCase().includes('content');
363-
const isUrl =
364-
field.key.toLowerCase().includes('url') || field.key.toLowerCase().includes('endpoint');
365363

366364
if (isMultiline) {
367365
const control = (
@@ -392,8 +390,7 @@ export function SingleFieldRenderer({
392390
id={fieldId}
393391
value={stringValue}
394392
onChange={(v) => onChange(path, v)}
395-
placeholder={isUrl ? localize('com_ui_enter_url') : undefined}
396-
type={isUrl ? 'url' : 'text'}
393+
type="text"
397394
disabled={disabled}
398395
/>
399396
);

0 commit comments

Comments
 (0)