feat: show notebook tree hierarchy in note move, tabs, and agent config
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m32s
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m32s
- note-card.tsx: parent/child notebook dropdown with indentation - notes-tabs-view.tsx: tree-structured notebook picker with check marks - agent-detail-view.tsx: source/target notebook selects with optgroup tree - Add notebook-tree-select.tsx shared utility component
This commit is contained in:
@@ -97,7 +97,7 @@ interface AgentDetailViewProps {
|
||||
_count: { actions: number }
|
||||
actions: { id: string; status: string; createdAt: string | Date }[]
|
||||
} | null
|
||||
notebooks: { id: string; name: string; icon?: string | null }[]
|
||||
notebooks: { id: string; name: string; icon?: string | null; parentId?: string | null }[]
|
||||
onSave: (data: FormData) => Promise<void>
|
||||
onBack: () => void
|
||||
onOpenLogs: (agentId: string, agentName: string) => void
|
||||
@@ -494,8 +494,13 @@ export function AgentDetailView({
|
||||
className={selectCls}
|
||||
>
|
||||
<option value="">{t('agents.form.selectNotebook')}</option>
|
||||
{notebooks.map(nb => (
|
||||
<option key={nb.id} value={nb.id}>{nb.name}</option>
|
||||
{notebooks.filter(nb => !nb.parentId).map(nb => (
|
||||
<optgroup key={nb.id} label={nb.name}>
|
||||
<option value={nb.id}>{nb.name}</option>
|
||||
{notebooks.filter(c => c.parentId === nb.id).map(child => (
|
||||
<option key={child.id} value={child.id}> └ {child.name}</option>
|
||||
))}
|
||||
</optgroup>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
@@ -645,8 +650,13 @@ export function AgentDetailView({
|
||||
<label className={labelCls}>{t('agents.form.targetNotebook')}<FieldHelp tooltip={t('agents.help.tooltips.targetNotebook')} /></label>
|
||||
<select value={targetNotebookId} onChange={e => setTargetNotebookId(e.target.value)} className={selectCls}>
|
||||
<option value="">{t('agents.form.inbox')}</option>
|
||||
{notebooks.map(nb => (
|
||||
<option key={nb.id} value={nb.id}>{nb.name}</option>
|
||||
{notebooks.filter(nb => !nb.parentId).map(nb => (
|
||||
<optgroup key={nb.id} label={nb.name}>
|
||||
<option value={nb.id}>{nb.name}</option>
|
||||
{notebooks.filter(c => c.parentId === nb.id).map(child => (
|
||||
<option key={child.id} value={child.id}> └ {child.name}</option>
|
||||
))}
|
||||
</optgroup>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user