fix(single): restore author follow controls

This commit is contained in:
2026-08-31 13:12:45 +08:00
parent 71444b139a
commit 8eb62e712b
19 changed files with 261 additions and 615 deletions
@@ -259,6 +259,12 @@ test('after-box author card mirrors legacy user-card structure', () => {
const userCard = read('inc/helpers/aksrt-user-card.php');
const css = read('assets/css/frontend/single-post/related-toc.css');
const authorActions = read('assets/css/frontend/single-post/author-actions.css');
const base = read('assets/css/frontend/base.css');
const follow = read('assets/js/follow.js');
const authorBar = read('templates/parts/single-author-bar.php');
const single = read('inc/helpers/aksrt-single.php');
const settings = read('src/Settings/PostDisplay.php');
const frontendTags = read('inc/helpers/aksrt-frontend-tags.php');
assert.match(render, /avatar-img avatar-lg/);
assert.match(render, /'vip'\s+=>\s+false/);
@@ -280,6 +286,21 @@ test('after-box author card mirrors legacy user-card structure', () => {
assert.match(css, /^\.zib-widget \{/m);
assert.doesNotMatch(css, /relates-thumb \.graphic\.style-3 \.graphic-img/);
assert.doesNotMatch(authorActions, /\.user-card-author|\.user-card \.author|user-card-posts/);
assert.match(identity, /function aksrt_get_user_follow\(/);
assert.match(identity, /data-aksrt-follow-label/);
assert.match(identity, /aksrt_get_user_follow\('focus-color ml10 follow flex0', \$user_id\)/);
assert.match(authorBar, /aksrt_get_user_follow\('px12-sm ml10 follow but c-red', \$author_id\)/);
assert.doesNotMatch(authorBar, /Follow::get_instance|is_following|show_actions|show_bio|extra_class|meta_items/);
assert.doesNotMatch(single, /aksrt_single_render_author_bar/);
assert.match(base, /\.user-card\.author \.user-name > name\s*\{[^}]*overflow:\s*visible;/s);
assert.match(base, /\.user-card\.author \.user-name > name > \.follow\s*\{[^}]*flex-shrink:\s*0;/s);
assert.match(follow, /querySelectorAll\('\[data-aksrt-follow="' \+ userId/);
assert.match(follow, /matchingButtons\.forEach/);
assert.match(follow, /\[data-aksrt-follow-label\]/);
assert.doesNotMatch(follow, /childNodes|textNode|Fallback when markup/);
assert.doesNotMatch(settings, /'authordesc_s'\s*=>/);
assert.doesNotMatch(frontendTags, /array_key_exists\('authordesc_s'/);
assert.doesNotMatch(authorActions, /article-author-bar__|author-box__/);
});
test('AJAX pagination can recover, caps auto loading and rehydrates appended media', () => {