From c315297d7fc8035752b3731784a578c7cd32e795 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 23 Sep 2026 12:16:26 +0800 Subject: [PATCH] fix(profile): align user page content width --- assets/css/frontend/layout.css | 9 +++++++++ assets/css/routes/profile/layout.css | 8 -------- assets/css/routes/user-center/shell.css | 10 +--------- assets/js/routes/user-home.js | 10 ---------- templates/parts/user-home/sidebar.php | 12 ------------ tests/widget-system/post-visual-contract.test.cjs | 5 +++++ 6 files changed, 15 insertions(+), 39 deletions(-) delete mode 100644 assets/js/routes/user-home.js delete mode 100644 templates/parts/user-home/sidebar.php diff --git a/assets/css/frontend/layout.css b/assets/css/frontend/layout.css index aefd245a..67bba3c1 100644 --- a/assets/css/frontend/layout.css +++ b/assets/css/frontend/layout.css @@ -16,6 +16,15 @@ max-width: var(--container); } +/* Profile routes use the exact value emitted from the admin content-width setting. + * Keep the shell contract here so the private center and public profile cannot + * drift through route-specific or legacy container rules. */ +.site-main.content-shell.aksrt-profile, +.site-main.content-shell.aksrt-user-home { + max-width: var(--content-max, var(--container, 1440px)); + box-sizing: border-box; +} + @media (min-width: 768px) { .content-shell { padding: 40px 24px 56px; diff --git a/assets/css/routes/profile/layout.css b/assets/css/routes/profile/layout.css index d6c599ea..a4a64156 100644 --- a/assets/css/routes/profile/layout.css +++ b/assets/css/routes/profile/layout.css @@ -13,14 +13,6 @@ * - 密码强度条 */ -/* 用户主页 / 用户中心统一使用站点内容宽度,避免旧 page/dashboard 容器收窄。 - * main 自身同时带 content-shell + aksrt-profile,不能写成 .aksrt-profile .content-shell。 */ -.aksrt-profile.content-shell, -.content-shell.aksrt-profile { - width: 100%; - max-width: var(--container, 1440px); -} - /* ==================== 用户资料卡片(共享) ==================== */ .uc-header { margin-bottom: 20px; diff --git a/assets/css/routes/user-center/shell.css b/assets/css/routes/user-center/shell.css index 84d223f4..04d0a675 100644 --- a/assets/css/routes/user-center/shell.css +++ b/assets/css/routes/user-center/shell.css @@ -10,15 +10,7 @@ */ /* ==================== 用户中心容器 ==================== */ -/* main 自身同时带 content-shell + aksrt-profile;宽度选择器应对准同一节点。 */ -.aksrt-user-center .content-shell, -.aksrt-profile.content-shell, -.content-shell.aksrt-profile { - max-width: var(--container, 1440px); - width: 100%; - margin: 0 auto; -} - +/* 主内容宽度由 frontend/layout.css 的 profile shell 合同统一管理。 */ .user-center, .aksrt-profile.content-shell { width: 100%; diff --git a/assets/js/routes/user-home.js b/assets/js/routes/user-home.js deleted file mode 100644 index 4183bb8b..00000000 --- a/assets/js/routes/user-home.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Deprecated path. - * - * Public user-home tabs/cover are handled by assets/js/author.js - * (enqueued as aksrt-author on profile/user-home routes). - * This file intentionally does nothing to avoid double-binding. - */ -(function () { - 'use strict'; -})(); diff --git a/templates/parts/user-home/sidebar.php b/templates/parts/user-home/sidebar.php deleted file mode 100644 index bb2820c7..00000000 --- a/templates/parts/user-home/sidebar.php +++ /dev/null @@ -1,12 +0,0 @@ -max_num_pages, \(int\) \$favorites_page\)/); assert.match(panelFavorites, /array_merge\(\$user_home_render_config, \['wrapper_class' => 'aksrt-user-home__post-list'\]\), \$favorites_query\)/); assert.doesNotMatch(panelFavorites, /profile-list-item|\$_GET|add_query_arg/); + assert.match(frontendLayoutCss, /\.site-main\.content-shell\.aksrt-profile,[\s\S]*?\.site-main\.content-shell\.aksrt-user-home\s*\{[\s\S]*?max-width:\s*var\(--content-max, var\(--container, 1440px\)\)/); + assert.doesNotMatch(profileLayoutCss, /\.aksrt-profile\.content-shell\s*,[\s\S]*?max-width:\s*var\(--container/); + assert.doesNotMatch(userCenterShellCss, /\.aksrt-user-center \.content-shell\s*,[\s\S]*?max-width:\s*var\(--container/); assert.match(profileLayoutCss, /\.aksrt-cover-menu__panel\[hidden\]\s*\{\s*display:\s*none\s*!important;\s*\}/); assert.match(profileLayoutCss, /#aksrt-bg-file-input\[hidden\],[\s\S]*?#aksrt-avatar-file-input\[hidden\][\s\S]*?display:\s*none\s*!important;/); assert.match(settingsSecurity, /data-modal="email-modal"[\s\S]*?<\/button>\s*<\/div>\s*
[\s\S]*?data-modal="phone-modal"/);