$ctx
*/
function aksrt_menu_button(array $ctx): void {
@@ -371,14 +377,24 @@ if (!function_exists('aksrt_menu_button')) :
$account = ''
. $notification_but . $sign_but . $search_but . '
';
- $button = ''
- . $actions . $utility_buttons . $account . '
';
+
+ // Reference cluster split: publish/VIP, theme + language, account row.
+ $button = '';
+ if ($actions !== '') {
+ $button = '' . $actions . '
';
+ }
+ if ($utility_buttons !== '') {
+ $button .= '' . $utility_buttons . '
';
+ }
+ $right_but = ''
+ . $account . '
';
$fold = '';
- $html = $fold . $button;
+ $html = $fold . $button . $right_but;
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
diff --git a/tests/navigation/legacy-navigation-contract.test.cjs b/tests/navigation/legacy-navigation-contract.test.cjs
index fbef0488..345c42cc 100644
--- a/tests/navigation/legacy-navigation-contract.test.cjs
+++ b/tests/navigation/legacy-navigation-contract.test.cjs
@@ -225,8 +225,11 @@ test('the account popover rows match the reference user box structure', () => {
assert.match(header, /but block c-yellow is-done/);
assert.match(buttonsCss, /\.but\.block\s*\{\s*display:\s*block;\s*\}/);
assert.match(buttonsCss, /\.btn-block\s*\{\s*display:\s*block;\s*width:\s*100%;\s*\}/);
- assert.match(legacyMainCss, /\.navbar-top \.navbar-but > \.but\s*\{[^}]*font-size:\s*0\.8em;[^}]*padding:\s*0\.3em 1em !important;[^}]*margin:\s*0\.4em;/s);
- assert.doesNotMatch(legacyMainCss, /\.navbar-top \.navbar-but \.but\s*\{/);
+ // The reference selector is a descendant, so the VIP chip inside its hover-show
+ // wrapper receives the same .but geometry (font-size, padding, margin) as the
+ // publish chip instead of falling back to the bare .but defaults.
+ assert.match(legacyMainCss, /\.navbar-top \.navbar-but \.but\s*\{[^}]*font-size:\s*0\.8em;[^}]*padding:\s*0\.3em 1em !important;[^}]*margin:\s*0\.4em;/s);
+ assert.doesNotMatch(legacyMainCss, /\.navbar-top \.navbar-but > \.but\s*\{/);
assert.doesNotMatch(header, /but block c-yellow[^"']*btn-block/);
assert.match(header, /' \. \$checkin \. '<\/div>/);
assert.match(header, /data-signin-done-label[\s\S]{0,120}?今日已签到/);
diff --git a/tests/widget-system/page-display-contract.test.cjs b/tests/widget-system/page-display-contract.test.cjs
index aa71f33e..6c52e930 100644
--- a/tests/widget-system/page-display-contract.test.cjs
+++ b/tests/widget-system/page-display-contract.test.cjs
@@ -142,7 +142,7 @@ test('VIP navigation purchase switches are saved and consumed end to end', () =>
test('header VIP hover cards match the legacy markup and style contract', () => {
assert.match(headerMenuButtons, //)
assert.match(headerMenuButtons, /