@@ -2218,28 +2218,8 @@ export const PageHeaderActions: React.FC<PageHeaderActionsProps> = ({
22182218 } , [ record , execute ] ) ;
22192219
22202220 const hasTrailing = trailing !== null && trailing !== undefined && trailing !== false ;
2221- // The trailing segment (objectstack#27241): the host's chrome after the
2222- // actions, a hairline between the two so the switches do not read as one
2223- // more action.
2224- const trailingSegment = hasTrailing ? (
2225- < span className = "inline-flex shrink-0 items-center gap-2" data-page-header-trailing = "" >
2226- < span role = "separator" aria-orientation = "vertical" className = "h-5 w-px bg-border" data-page-header-trailing-rule = "" />
2227- { trailing }
2228- </ span >
2229- ) : null ;
22302221 const renderHeaderActions = ( ) => {
2231- if ( headerActions . length === 0 && ! refresh ) {
2232- if ( ! hasTrailing ) return null ;
2233- return (
2234- < div
2235- className = "flex flex-wrap items-center gap-2 shrink-0"
2236- role = "toolbar"
2237- aria-label = { tt ( 'detail.pageHeaderActions' , 'Page header actions' ) }
2238- >
2239- < span className = "inline-flex shrink-0 items-center" data-page-header-trailing = "" > { trailing } </ span >
2240- </ div >
2241- ) ;
2242- }
2222+ if ( headerActions . length === 0 && ! refresh && ! hasTrailing ) return null ;
22432223 // The label is already resolved — the `headerActions` memo above ran every
22442224 // action through the shared localizer (`{ns}.objects.{objectName}
22452225 // ._actions.{name}.label`, authored literal as fallback), together with the
@@ -2368,6 +2348,18 @@ export const PageHeaderActions: React.FC<PageHeaderActionsProps> = ({
23682348 // the menu (a separator under nothing sets nothing apart).
23692349 const firstDestructiveIdx = overflowActions . findIndex ( isDestructiveAction ) ;
23702350 const useOverflow = overflowActions . length > 0 || ! ! refresh ;
2351+ // The trailing segment (objectstack#27241): the host's chrome after the
2352+ // actions, a hairline between the two so the switches do not read as one
2353+ // more action. `ml-auto`: when the row wraps (a narrow header), the
2354+ // segment ends its own line at the right edge.
2355+ const trailingSegment = hasTrailing ? (
2356+ < span className = "ml-auto inline-flex shrink-0 items-center gap-2" data-page-header-trailing = "" >
2357+ { ( inlineActions . length > 0 || useOverflow ) && (
2358+ < span role = "separator" aria-orientation = "vertical" className = "h-5 w-px bg-border" data-page-header-trailing-rule = "" />
2359+ ) }
2360+ { trailing }
2361+ </ span >
2362+ ) : null ;
23712363 // Resolve a `disabled` predicate against the record — a boolean OR an
23722364 // expression (`'record.status == …'` or the `{ dialect, source }`
23732365 // envelope). Without this a CEL `disabled` silently did nothing (only
@@ -2479,7 +2471,7 @@ export const PageHeaderActions: React.FC<PageHeaderActionsProps> = ({
24792471 } ;
24802472 return (
24812473 < div
2482- className = "flex flex-wrap items-center gap-2 shrink-0"
2474+ className = "flex flex-wrap items-center gap-2 shrink-0 max-w-full "
24832475 role = "toolbar"
24842476 aria-label = { tt ( 'detail.pageHeaderActions' , 'Page header actions' ) }
24852477 >
0 commit comments