The like and favorite buttons gave no in-flight feedback: the label just sat
there until the request returned, the lovestar animation never replayed on a
repeat like, duplicate clicks reported "success", and guest favorites silently
wrote a cookie instead of asking the user to sign in.
- pending state: replace the count with the reference inline spinner
(`<i class="loading zts">`) and disable the button until the response lands
- animation: strip `action-animation` before re-adding it (forced reflow), so
every successful like replays the reference lovestar keyframes
- duplicate: when the server reports the same state and count, skip the
animation and surface the reference warning copy (已赞过此文章了!)
- failures: restore the original count and toast `danger`; guest-only actions
now open the site login modal instead of dead-ending on an error
- favorite requires login server-side, matching the reference; the guest
favourite cookie branch and its reader are removed as dead code
- unify like/favorite through one bindToggle path and keep every mirror
button (article row + footer tabbar) in sync
Tests: new article-actions-ux suite (8 cases) drives assets/js/core/article.js
against a DOM/fetch shim — pending spinner, replay, duplicate no-op,
concurrency, rollback, guest login, mirror sync. Widget suite 828/829; the one
failure (frontend-lifecycle theme-init stub) predates this change.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The action bar used a locally invented pill-chip style that overrode the
reference theme's 80px icon-over-text columns, and the JS toggled a
class no stylesheet targeted — so likes/favorites showed no selected
state at all.
- restore reference markup: <svg class="icon"> + <text>/<count> and the
actived class, with data-stat-count/data-base-count preserved
- toggle actived plus a transient action-animation so the lovestar
keyframes finally reach the DOM
- drop the CSS overrides and now-dead action-btn/.action-btn--reward
and .post-actions-card rules; main.css already carried the reference
rules the overrides were shadowing
Connect header_components_show_on through aksrt_header_slide_is_show with
zibll page-type matching, drop the homepage-only gate, align admin options,
apply nav color, enqueue by is_show, remove dead float-btn schema, and
consume footer_tabbar_single extend mode on post singles.