Skip to content

Commit d36d30e

Browse files
fix: eliminate horizontal scrollbar in team selection dialog
1 parent aacfc00 commit d36d30e

File tree

1 file changed

+35
-12
lines changed

1 file changed

+35
-12
lines changed

src/frontend/src/components/common/TeamSelector.tsx

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ const TeamSelector: React.FC<TeamSelectorProps> = ({
382382
cursor: 'pointer',
383383
transition: 'all 0.2s ease',
384384
boxSizing: 'border-box',
385-
width: '100%'
385+
width: '100%',
386+
overflow: 'hidden'
386387
}}
387388
onClick={() => setTempSelectedTeam(team)}
388389
>
@@ -409,7 +410,9 @@ const TeamSelector: React.FC<TeamSelectorProps> = ({
409410
gap: '6px',
410411
flexWrap: 'wrap',
411412
justifyContent: 'center',
412-
minWidth: '200px'
413+
minWidth: '0',
414+
maxWidth: '180px',
415+
overflow: 'hidden'
413416
}}>
414417
{team.agents.slice(0, 3).map((agent) => (
415418
<Badge
@@ -419,9 +422,23 @@ const TeamSelector: React.FC<TeamSelectorProps> = ({
419422
style={{
420423
backgroundColor: '#e6f3ff',
421424
color: '#0066cc',
422-
border: '1px solid #b3d9ff'
425+
border: '1px solid #b3d9ff',
426+
display: 'flex',
427+
alignItems: 'center',
428+
gap: '4px',
429+
padding: '4px 8px',
430+
minHeight: '24px'
423431
}}
424432
>
433+
{agent.icon && (
434+
<span style={{
435+
display: 'flex',
436+
alignItems: 'center',
437+
fontSize: '12px'
438+
}}>
439+
{getIconFromString(agent.icon)}
440+
</span>
441+
)}
425442
{agent.type}
426443
</Badge>
427444
))}
@@ -432,7 +449,9 @@ const TeamSelector: React.FC<TeamSelectorProps> = ({
432449
style={{
433450
backgroundColor: '#e6f3ff',
434451
color: '#0066cc',
435-
border: '1px solid #b3d9ff'
452+
border: '1px solid #b3d9ff',
453+
padding: '4px 8px',
454+
minHeight: '24px'
436455
}}
437456
>
438457
+{team.agents.length - 3}
@@ -493,13 +512,14 @@ const TeamSelector: React.FC<TeamSelectorProps> = ({
493512
<DialogSurface style={{
494513
maxWidth: '800px',
495514
width: '90vw',
496-
minWidth: '600px',
515+
minWidth: '500px',
497516
borderRadius: '12px',
498517
padding: '0',
499518
backgroundColor: '#ffffff',
500519
color: '#323130',
501520
border: '1px solid #e1e1e1',
502-
boxSizing: 'border-box'
521+
boxSizing: 'border-box',
522+
overflow: 'hidden'
503523
}}>
504524
<DialogTitle style={{
505525
padding: '24px 24px 16px 24px',
@@ -512,14 +532,14 @@ const TeamSelector: React.FC<TeamSelectorProps> = ({
512532
}}>
513533
Select a Team
514534
</DialogTitle>
515-
<DialogContent style={{ padding: '0', width: '100%', margin: '0' }}>
535+
<DialogContent style={{ padding: '0', width: '100%', margin: '0', overflow: 'hidden' }}>
516536
<DialogBody style={{
517537
padding: '24px',
518538
backgroundColor: '#ffffff',
519539
width: '100%',
520540
margin: '0',
521541
display: 'block',
522-
overflow: 'visible',
542+
overflow: 'hidden',
523543
gap: 'unset',
524544
maxHeight: 'unset',
525545
gridTemplateRows: 'unset',
@@ -563,7 +583,8 @@ const TeamSelector: React.FC<TeamSelectorProps> = ({
563583
</div>
564584

565585
{/* Tab Content - Directly below tabs without separation */}
566-
{activeTab === 'teams' && (
586+
<div style={{ overflow: 'hidden', width: '100%' }}>
587+
{activeTab === 'teams' && (
567588
<div style={{
568589
width: '100%'
569590
}}>
@@ -610,9 +631,10 @@ const TeamSelector: React.FC<TeamSelectorProps> = ({
610631
<div style={{
611632
maxHeight: '400px',
612633
overflowY: 'auto',
613-
paddingRight: '4px',
614-
marginRight: '-4px',
615-
width: '100%',
634+
overflowX: 'hidden',
635+
paddingRight: '8px',
636+
marginRight: '-8px',
637+
width: 'calc(100% + 8px)',
616638
boxSizing: 'border-box'
617639
}}>
618640
{filteredTeams.map((team) => renderTeamCard(team))}
@@ -796,6 +818,7 @@ const TeamSelector: React.FC<TeamSelectorProps> = ({
796818
</div>
797819
</div>
798820
)}
821+
</div>
799822
</DialogBody>
800823
</DialogContent>
801824
<DialogActions style={{

0 commit comments

Comments
 (0)