From ae2588c2925c35e896eca4a7b211029eeea3ca97 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Aug 2026 18:52:12 +0800 Subject: [PATCH] fix(identity): align vip icons and sidebar cards Co-Authored-By: Claude Fable 5 --- assets/css/frontend/base.css | 7 +++++ assets/css/routes/user-center/shell.css | 26 ++++++++++++++++ inc/helpers/aksrt-identity.php | 11 +++++-- inc/helpers/header/aksrt-header-navbar.php | 2 +- .../user-center-renderers/profile-header.php | 30 +++---------------- templates/parts/user/author-hero.php | 18 ++++------- 6 files changed, 51 insertions(+), 43 deletions(-) diff --git a/assets/css/frontend/base.css b/assets/css/frontend/base.css index 447a8bf3..41cfa727 100644 --- a/assets/css/frontend/base.css +++ b/assets/css/frontend/base.css @@ -210,6 +210,13 @@ main.container, gap: 4px; } +.aksrt-author-hero__name-inner { + display: inline-flex; + align-items: center; + gap: 4px; + min-width: 0; +} + /* ========== 通用空状态 ========== */ .no-results { padding: 48px 20px; diff --git a/assets/css/routes/user-center/shell.css b/assets/css/routes/user-center/shell.css index 8da14b3c..4d34de02 100644 --- a/assets/css/routes/user-center/shell.css +++ b/assets/css/routes/user-center/shell.css @@ -633,6 +633,32 @@ body.aksrt-user-center .uc-content, gap: 8px; } +.uc-sidebar__section--stats, +.uc-sidebar__pair--assets .uc-summary-card, +.uc-sidebar__pair--centers .uc-center-card { + text-align: center; +} + +.uc-sidebar__pair--assets .uc-summary-card__head, +.uc-sidebar__pair--assets .uc-summary-card__body { + justify-content: center; +} + +.uc-sidebar__pair--centers .uc-center-card { + grid-template-columns: 1fr; + justify-items: center; + gap: 7px; +} + +.uc-sidebar__pair--centers .uc-center-card > span { + text-align: center; +} + +.uc-sidebar__pair--centers .uc-center-card > i { + display: none; +} + + .uc-summary-card, .uc-center-card { min-width: 0; diff --git a/inc/helpers/aksrt-identity.php b/inc/helpers/aksrt-identity.php index c017fde7..6dde7567 100644 --- a/inc/helpers/aksrt-identity.php +++ b/inc/helpers/aksrt-identity.php @@ -54,6 +54,11 @@ if (!function_exists('aksrt_render_user_identity_chips')) { } } $signals = aksrt_get_user_identity_signals($user_id); + // Keep the public identity order stable: certification, worn badge, level. + usort($signals, static function (array $left, array $right): int { + $priority = ['verify' => 0, 'badge' => 1, 'level' => 2]; + return ($priority[(string) ($left['type'] ?? '')] ?? 3) <=> ($priority[(string) ($right['type'] ?? '')] ?? 3); + }); // Comments stay compact; author/card can show more. $limit = $context === 'comment' ? 3 : 6; $n = 0; @@ -116,7 +121,7 @@ if (!function_exists('aksrt_get_user_name')) { 'id' => 0, 'class' => 'flex ac flex1', 'name_class' => '', - 'vip' => false, + 'vip' => true, 'medal' => true, 'auth' => true, 'level' => true, @@ -148,7 +153,7 @@ if (!function_exists('aksrt_get_user_name')) { $vip_html = (string) aksrt_render_vip_badge($user_id, 'sm'); } $name_class = trim('display-name text-ellipsis ' . (string) $args['name_class']); - $name_link = '' . $vip_html . esc_html($display) . ''; + $name_link = '' . esc_html($display) . ''; $auth_html = ''; $medal_html = ''; @@ -217,7 +222,7 @@ if (!function_exists('aksrt_get_user_name')) { } // Order: name → auth → wear medal → level → follow (Zibll). - $html = '' . $name_link . $auth_html . $medal_html . $level_html . $follow_html . ''; + $html = '' . $name_link . $vip_html . $auth_html . $medal_html . $level_html . $follow_html . ''; /** * Filter rendered user name chrome. * diff --git a/inc/helpers/header/aksrt-header-navbar.php b/inc/helpers/header/aksrt-header-navbar.php index 2ef71fce..73cf36ef 100644 --- a/inc/helpers/header/aksrt-header-navbar.php +++ b/inc/helpers/header/aksrt-header-navbar.php @@ -238,7 +238,7 @@ if (!function_exists('aksrt_header_user_box_html')) : $con .= $avatar; $con .= '
'; $con .= '
' - . '' . esc_html($display_name) . '' . $vip_badge . $level_badge . $certification_badge + . '' . esc_html($display_name) . '' . $vip_badge . $certification_badge . $level_badge . '
' . esc_html($desc) . '
'; $con .= '
'; $con .= $msg_icon; diff --git a/inc/helpers/user-center-renderers/profile-header.php b/inc/helpers/user-center-renderers/profile-header.php index e1caee94..1570b3b1 100644 --- a/inc/helpers/user-center-renderers/profile-header.php +++ b/inc/helpers/user-center-renderers/profile-header.php @@ -36,32 +36,10 @@ extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_

display_name); ?> - - '; - } - } - ?> -

+ + true]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> + +
user_login); ?> diff --git a/templates/parts/user/author-hero.php b/templates/parts/user/author-hero.php index b0df01a5..0cafcc76 100644 --- a/templates/parts/user/author-hero.php +++ b/templates/parts/user/author-hero.php @@ -92,19 +92,11 @@ $pm_url = ($pm_enabled && $messages_url !== '')

- display_name); ?> - false, - 'skip_level' => false, - ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } - ?> + + $user_id, 'class' => 'aksrt-author-hero__name-inner', 'vip' => true, 'medal' => true, 'auth' => true, 'level' => true, 'follow' => false]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> + + display_name); ?> +