Просмотр исходного кода

Neo: centre the collapsed cover title when there is no meta line (#5881)

The collapsed cover bar always kept the second line for meta links and the
date, even when both were empty (projects send meta_menu.items: []), so the
title sat at the top of the bar instead of beside the back button.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Andrey Yasko 6 дней назад
Родитель
Сommit
a545f95997
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      neo/packages/app/components/elements/covers/cover-morph-body.js

+ 4 - 1
neo/packages/app/components/elements/covers/cover-morph-body.js

@@ -146,6 +146,9 @@ export function CoverMorphBody({
         </Text>
     )
 
+    // The collapsed bar's second line; when empty, the title centres in the bar.
+    const hasCompactMeta = metaMenuItems.length > 0 || !!metaDate
+
     // Same source as Cover — do not gate on a separate flag (actions_menu is enough).
     let menu = data?.actions_menu ? cloneObject(data.actions_menu) : null
     if (menu && menu.persistent > 1) {
@@ -363,7 +366,7 @@ export function CoverMorphBody({
                             <Row
                                 className={cn(
                                     'items-center gap-2 flex-nowrap min-w-0 h-5',
-                                    !compactBar && 'hidden',
+                                    (!compactBar || !hasCompactMeta) && 'hidden',
                                 )}
                             >
                                 {!!metaMenuCompact && (