fix: remove duplicate notebook names in agent selects - use flat list instead of optgroup
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m31s

This commit is contained in:
Antigravity
2026-05-09 21:20:47 +00:00
parent a8ad442a93
commit 89fba4638f

View File

@@ -495,12 +495,12 @@ export function AgentDetailView({
> >
<option value="">{t('agents.form.selectNotebook')}</option> <option value="">{t('agents.form.selectNotebook')}</option>
{notebooks.filter(nb => !nb.parentId).map(nb => ( {notebooks.filter(nb => !nb.parentId).map(nb => (
<optgroup key={nb.id} label={nb.name}> <>
<option value={nb.id}>{nb.name}</option> <option key={nb.id} value={nb.id}>{nb.name}</option>
{notebooks.filter(c => c.parentId === nb.id).map(child => ( {notebooks.filter(c => c.parentId === nb.id).map(child => (
<option key={child.id} value={child.id}> {child.name}</option> <option key={child.id} value={child.id}> {child.name}</option>
))} ))}
</optgroup> </>
))} ))}
</select> </select>
</div> </div>
@@ -651,12 +651,12 @@ export function AgentDetailView({
<select value={targetNotebookId} onChange={e => setTargetNotebookId(e.target.value)} className={selectCls}> <select value={targetNotebookId} onChange={e => setTargetNotebookId(e.target.value)} className={selectCls}>
<option value="">{t('agents.form.inbox')}</option> <option value="">{t('agents.form.inbox')}</option>
{notebooks.filter(nb => !nb.parentId).map(nb => ( {notebooks.filter(nb => !nb.parentId).map(nb => (
<optgroup key={nb.id} label={nb.name}> <>
<option value={nb.id}>{nb.name}</option> <option key={nb.id} value={nb.id}>{nb.name}</option>
{notebooks.filter(c => c.parentId === nb.id).map(child => ( {notebooks.filter(c => c.parentId === nb.id).map(child => (
<option key={child.id} value={child.id}> {child.name}</option> <option key={child.id} value={child.id}> {child.name}</option>
))} ))}
</optgroup> </>
))} ))}
</select> </select>
</div> </div>