@@ -175,6 +175,7 @@ function WebhookFiltersField({
175175 </ p >
176176 </ div >
177177 < Button
178+ className = "shrink-0"
178179 variant = "outline"
179180 size = "sm"
180181 disabled = { filters . length >= MAX_WEBHOOK_FILTERS }
@@ -185,59 +186,63 @@ function WebhookFiltersField({
185186 </ Button >
186187 </ div >
187188 { filters . map ( ( filter , index ) => (
189+ // Below md the row stacks: path and remove on one line, test and value on the next.
188190 // Rows have no identity of their own; removing one re-renders the rest in order.
189191 // oxlint-disable-next-line react/no-array-index-key
190- < div key = { index } className = "flex items-center gap-2" >
192+ < div key = { index } className = "flex flex-wrap items-center gap-2 md:flex-nowrap " >
191193 < Input
192194 aria-label = { `Filter ${ index + 1 } path` }
193- className = "min-w-0 flex-1"
195+ className = "min-w-0 flex-1 md:flex-4 "
194196 placeholder = "body.action"
195197 value = { filter . path }
196198 onChange = { ( event ) => update ( index , { path : event . target . value } ) }
197199 />
198- < Select
199- value = { filter . op }
200- onValueChange = { ( op ) => {
201- const known = WEBHOOK_FILTER_OPS . find ( ( option ) => option . op === op ) ;
202- if ( known ) update ( index , { op : known . op } ) ;
203- } }
204- >
205- < SelectTrigger
206- size = "sm"
207- className = "w-36 shrink-0"
208- aria-label = { `Filter ${ index + 1 } test` }
209- >
210- < SelectValue >
211- { WEBHOOK_FILTER_OPS . find ( ( option ) => option . op === filter . op ) ?. label }
212- </ SelectValue >
213- </ SelectTrigger >
214- < SelectPopup >
215- { WEBHOOK_FILTER_OPS . map ( ( option ) => (
216- < SelectItem key = { option . op } value = { option . op } >
217- { option . label }
218- </ SelectItem >
219- ) ) }
220- </ SelectPopup >
221- </ Select >
222- { filter . op === "exists" ? (
223- < div className = "min-w-0 flex-1" />
224- ) : (
225- < Input
226- aria-label = { `Filter ${ index + 1 } value` }
227- className = "min-w-0 flex-1"
228- placeholder = { filter . op === "in" ? "opened, reopened" : "opened" }
229- value = { filter . value }
230- onChange = { ( event ) => update ( index , { value : event . target . value } ) }
231- />
232- ) }
233200 < Button
201+ className = "md:order-last"
234202 variant = "ghost"
235203 size = "icon-sm"
236204 aria-label = { `Remove filter ${ index + 1 } ` }
237205 onClick = { ( ) => onChange ( filters . filter ( ( _ , at ) => at !== index ) ) }
238206 >
239207 < Trash2Icon />
240208 </ Button >
209+ < div className = "flex w-full min-w-0 items-center gap-2 md:contents" >
210+ < Select
211+ value = { filter . op }
212+ onValueChange = { ( op ) => {
213+ const known = WEBHOOK_FILTER_OPS . find ( ( option ) => option . op === op ) ;
214+ if ( known ) update ( index , { op : known . op } ) ;
215+ } }
216+ >
217+ < SelectTrigger
218+ size = "sm"
219+ className = "w-40 shrink-0"
220+ aria-label = { `Filter ${ index + 1 } test` }
221+ >
222+ < SelectValue >
223+ { WEBHOOK_FILTER_OPS . find ( ( option ) => option . op === filter . op ) ?. label }
224+ </ SelectValue >
225+ </ SelectTrigger >
226+ < SelectPopup >
227+ { WEBHOOK_FILTER_OPS . map ( ( option ) => (
228+ < SelectItem key = { option . op } value = { option . op } >
229+ { option . label }
230+ </ SelectItem >
231+ ) ) }
232+ </ SelectPopup >
233+ </ Select >
234+ { filter . op === "exists" ? (
235+ < div className = "min-w-0 flex-1 md:flex-3" />
236+ ) : (
237+ < Input
238+ aria-label = { `Filter ${ index + 1 } value` }
239+ className = "min-w-0 flex-1 md:flex-3"
240+ placeholder = { filter . op === "in" ? "opened, reopened" : "opened" }
241+ value = { filter . value }
242+ onChange = { ( event ) => update ( index , { value : event . target . value } ) }
243+ />
244+ ) }
245+ </ div >
241246 </ div >
242247 ) ) }
243248 </ div >
0 commit comments