Skip to content

Commit e440f34

Browse files
committed
react-viewer: left-align all collapse chevrons for consistency
1 parent de5bc8f commit e440f34

1 file changed

Lines changed: 21 additions & 27 deletions

File tree

wrappers/rest-api/tools/react-viewer/src/components/DevicePanel.tsx

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -945,22 +945,20 @@ function SensorOptionsPanel({ sensor, options, isExpanded, onToggle, onSetOption
945945
onClick={onToggle}
946946
className="w-full flex items-center justify-between p-1.5 bg-gray-800/50 rounded hover:bg-gray-700 transition-colors text-xs"
947947
>
948-
<span className="font-medium">{sensor.name}</span>
949-
<div className="flex items-center gap-1">
950-
{modifiedCount > 0 && (
951-
<span className="px-1.5 py-0.5 bg-rs-blue/20 text-rs-blue rounded text-[10px]">
952-
{modifiedCount} modified
953-
</span>
954-
)}
948+
<span className="flex items-center gap-1.5 font-medium min-w-0">
955949
<svg
956-
className={`w-4 h-4 transition-transform ${isExpanded ? 'rotate-180' : ''}`}
957-
fill="none"
958-
stroke="currentColor"
959-
viewBox="0 0 24 24"
950+
className={`w-3.5 h-3.5 shrink-0 text-gray-400 transition-transform ${isExpanded ? 'rotate-90' : ''}`}
951+
fill="none" stroke="currentColor" viewBox="0 0 24 24"
960952
>
961-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />
953+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
962954
</svg>
963-
</div>
955+
<span className="truncate">{sensor.name}</span>
956+
</span>
957+
{modifiedCount > 0 && (
958+
<span className="px-1.5 py-0.5 bg-rs-blue/20 text-rs-blue rounded text-[10px]">
959+
{modifiedCount} modified
960+
</span>
961+
)}
964962
</button>
965963

966964
{isExpanded && (
@@ -1035,17 +1033,15 @@ function CategorySection({ category, options, isExpanded, onToggle, onRestoreDef
10351033
<div className="flex items-center bg-gray-750 hover:bg-gray-700 transition-colors">
10361034
<button
10371035
onClick={onToggle}
1038-
className="flex-1 flex items-center justify-between p-1.5"
1036+
className="flex-1 flex items-center gap-1.5 p-1.5"
10391037
>
1040-
<span className="text-xs font-medium text-gray-300">{category}</span>
10411038
<svg
1042-
className={`w-3 h-3 transition-transform ${isExpanded ? 'rotate-180' : ''}`}
1043-
fill="none"
1044-
stroke="currentColor"
1045-
viewBox="0 0 24 24"
1039+
className={`w-3 h-3 shrink-0 text-gray-400 transition-transform ${isExpanded ? 'rotate-90' : ''}`}
1040+
fill="none" stroke="currentColor" viewBox="0 0 24 24"
10461041
>
1047-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />
1042+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
10481043
</svg>
1044+
<span className="text-xs font-medium text-gray-300">{category}</span>
10491045
</button>
10501046
{hasModifiedOptions && (
10511047
<button
@@ -1120,17 +1116,15 @@ function PostProcessingSection({ options, isExpanded, onToggle, onRestoreDefault
11201116
<div className="flex items-center bg-gray-750 hover:bg-gray-700 transition-colors">
11211117
<button
11221118
onClick={onToggle}
1123-
className="flex-1 flex items-center justify-between p-1.5"
1119+
className="flex-1 flex items-center gap-1.5 p-1.5"
11241120
>
1125-
<span className="text-xs font-medium text-gray-300">Post-Processing</span>
11261121
<svg
1127-
className={`w-3 h-3 transition-transform ${isExpanded ? 'rotate-180' : ''}`}
1128-
fill="none"
1129-
stroke="currentColor"
1130-
viewBox="0 0 24 24"
1122+
className={`w-3 h-3 shrink-0 text-gray-400 transition-transform ${isExpanded ? 'rotate-90' : ''}`}
1123+
fill="none" stroke="currentColor" viewBox="0 0 24 24"
11311124
>
1132-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />
1125+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
11331126
</svg>
1127+
<span className="text-xs font-medium text-gray-300">Post-Processing</span>
11341128
</button>
11351129
{hasModifiedOptions && (
11361130
<button

0 commit comments

Comments
 (0)