Skip to content

Commit c484d1a

Browse files
authored
πŸ’„ style: move plugin store button outside scroll container (#11728)
Move the plugin store entry button to a fixed position at the bottom of the dropdown, outside the scrollable area for better UX.
1 parent 06c3284 commit c484d1a

File tree

1 file changed

+20
-28
lines changed

1 file changed

+20
-28
lines changed

β€Žsrc/features/ProfileEditor/AgentTool.tsxβ€Ž

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import { type LobeToolMetaWithAvailability } from '@/store/tool/slices/builtin/s
3535

3636
import PluginTag from './PluginTag';
3737

38+
3839
const WEB_BROWSING_IDENTIFIER = 'lobe-web-browsing';
3940

4041
type TabType = 'all' | 'installed';
@@ -46,11 +47,6 @@ const styles = createStaticStyles(({ css }) => ({
4647
overflow: hidden;
4748
4849
width: 100%;
49-
border: 1px solid ${cssVar.colorBorderSecondary};
50-
border-radius: ${cssVar.borderRadiusLG};
51-
52-
background: ${cssVar.colorBgElevated};
53-
box-shadow: ${cssVar.boxShadowSecondary};
5450
5551
.${prefixCls}-dropdown-menu {
5652
border-radius: 0 !important;
@@ -339,7 +335,7 @@ const AgentTool = memo<AgentToolProps>(
339335
() => [
340336
// εŽŸζœ‰ηš„ builtin ε·₯ε…·
341337
...filteredBuiltinList.map((item) => ({
342-
icon: <Avatar avatar={item.meta.avatar} size={20} style={{ flex: 'none' }} />,
338+
icon: <Avatar avatar={item.meta.avatar} size={20} style={{ flex: 'none', marginRight: 0 }} />,
343339
key: item.identifier,
344340
label: (
345341
<ToolItem
@@ -412,18 +408,6 @@ const AgentTool = memo<AgentToolProps>(
412408
),
413409
type: 'group',
414410
},
415-
{
416-
type: 'divider',
417-
},
418-
{
419-
extra: <Icon icon={ArrowRight} />,
420-
icon: Store,
421-
key: 'plugin-store',
422-
label: t('tools.plugins.store'),
423-
onClick: () => {
424-
createSkillStoreModal();
425-
},
426-
},
427411
],
428412
[builtinItems, pluginItems, enablePluginCount, t],
429413
);
@@ -557,7 +541,6 @@ const AgentTool = memo<AgentToolProps>(
557541
{/* Plugin Selector Dropdown - Using Action component pattern */}
558542
<Suspense fallback={button}>
559543
<ActionDropdown
560-
maxHeight={500}
561544
maxWidth={400}
562545
menu={{
563546
items: currentItems,
@@ -567,11 +550,10 @@ const AgentTool = memo<AgentToolProps>(
567550
overflowY: 'visible',
568551
},
569552
}}
570-
minHeight={isKlavisEnabledInEnv || isLobehubSkillEnabled ? 500 : undefined}
571553
minWidth={400}
572554
placement={'bottomLeft'}
573555
popupRender={(menu) => (
574-
<div className={styles.dropdown}>
556+
<Flexbox className={styles.dropdown} style={{ maxHeight: 500 }}>
575557
{/* stopPropagation prevents dropdown's onClick from calling preventDefault on Segmented */}
576558
<div className={styles.header} onClick={(e) => e.stopPropagation()}>
577559
<Segmented
@@ -591,16 +573,26 @@ const AgentTool = memo<AgentToolProps>(
591573
value={effectiveTab}
592574
/>
593575
</div>
594-
<div
595-
className={styles.scroller}
576+
<div className={styles.scroller} style={{ flex: 1 }}>
577+
{menu}
578+
</div>
579+
<Flexbox
580+
align="center"
581+
gap={8}
582+
horizontal
583+
onClick={() => createSkillStoreModal()}
596584
style={{
597-
maxHeight: 500,
598-
minHeight: isKlavisEnabledInEnv || isLobehubSkillEnabled ? 500 : undefined,
585+
borderBlockStart: `1px solid ${cssVar.colorBorderSecondary}`,
586+
cursor: 'pointer',
587+
flex: 'none',
588+
padding: cssVar.paddingSM,
599589
}}
600590
>
601-
{menu}
602-
</div>
603-
</div>
591+
<Icon icon={Store} />
592+
<span style={{ flex: 1 }}>{t('tools.plugins.store')}</span>
593+
<Icon icon={ArrowRight} />
594+
</Flexbox>
595+
</Flexbox>
604596
)}
605597
trigger={'click'}
606598
>

0 commit comments

Comments
Β (0)