@@ -30,12 +30,10 @@ export namespace Configurations {
3030
3131export const Configurations : React . FC < Configurations . Props > = ( props ) => {
3232 const pinned_configurations = props . configurations . filter ( ( c ) => c . is_pinned )
33- const unpinned_configurations = props . configurations . filter (
34- ( c ) => ! c . is_pinned
35- )
3633
37- const renderConfigurationItem = (
38- configuration : Configurations . Configuration
34+ const render_configuration_item = (
35+ configuration : Configurations . Configuration ,
36+ is_dragging_disabled : boolean
3937 ) => {
4038 const description_parts = [ configuration . provider ]
4139 if ( configuration . reasoning_effort ) {
@@ -69,7 +67,7 @@ export const Configurations: React.FC<Configurations.Props> = (props) => {
6967 < div
7068 className = { cn ( styles . configurations__item__left__drag_handle , {
7169 [ styles [ 'configurations__item__left__drag_handle--disabled' ] ] :
72- ! props . on_reorder || configuration . is_pinned
70+ is_dragging_disabled
7371 } ) }
7472 onClick = { ( e ) => e . stopPropagation ( ) }
7573 >
@@ -103,7 +101,7 @@ export const Configurations: React.FC<Configurations.Props> = (props) => {
103101 < div className = { styles . container } >
104102 { pinned_configurations . length > 0 && (
105103 < div className = { styles . configurations } >
106- { pinned_configurations . map ( renderConfigurationItem ) }
104+ { pinned_configurations . map ( ( i ) => render_configuration_item ( i , true ) ) }
107105 </ div >
108106 ) }
109107 < div
@@ -135,17 +133,19 @@ export const Configurations: React.FC<Configurations.Props> = (props) => {
135133 < >
136134 < div className = { styles . configurations } >
137135 < ReactSortable
138- list = { unpinned_configurations }
136+ list = { props . configurations }
139137 setList = { ( new_state ) => {
140138 if ( props . on_reorder ) {
141- props . on_reorder ( [ ... pinned_configurations , ... new_state ] )
139+ props . on_reorder ( new_state )
142140 }
143141 } }
144142 animation = { 150 }
145143 handle = { `.${ styles . configurations__item__left__drag_handle } ` }
146144 disabled = { ! props . on_reorder }
147145 >
148- { unpinned_configurations . map ( renderConfigurationItem ) }
146+ { props . configurations . map ( ( i ) =>
147+ render_configuration_item ( i , false )
148+ ) }
149149 </ ReactSortable >
150150 </ div >
151151 </ >
0 commit comments