• Render-time gating for action-card buttons (per the targeted-vs-open rule): a button addressed to a specific document (data-handler-uuid = a real uuid) is shown only to a client that owns that document — hidden from everyone else, so nobody clicks a button that does nothing for them. A button addressed with the SELF_HANDLER sentinel (@self) is open — anyone may answer (their own default character responds), so it is shown to all.

    Action-card buttons (emitted by sohl.document.chat.buildActionCard) carry the action-card-button class; this gate touches only those, so a card's other markup is left alone.

    Cosmetic only — the real gate is click-time authorization (resolveAuthorizedChatCardHandler). A no-op on any card without action-card buttons. Foundry document resolution is injected via resolveDoc, so this stays unit-testable.

    Parameters

    • element: HTMLElement

      The chat message's rendered root element.

    • resolveDoc: (uuid: string) => any

      Resolves a document from its uuid (owner check).

    Returns void