Skip to content

Avatar-stack CSS and JS are duplicated between the single-site and network widgets #312

Description

@josephfusco

#299 added a network dashboard widget alongside the existing single-site "Who's Online" widget. Both widgets render an overlapping avatar stack, and #299's follow-up commit shares the PHP rendering (wp_presence_render_avatar_stack() in includes/functions.php), but the CSS and the client-side Heartbeat-update JS are still separate copies.

Each widget class defines its own .presence-avatar-stack CSS block (same properties, different container ID prefix and image size), and its own inline buildAvatarStack() JS function (same z-index logic, different image size: 20px for the network widget, 24px for the single-site widget).

Consolidating these means deciding how the two widgets share a script/style asset rather than each carrying an inline copy generated by wp_add_inline_script()/wp_add_inline_style().

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs DiscussionAnything that needs a discussion/agreement[Area] WidgetsIssues for the dashboard widgets

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions