reactions

package
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package reactions owns the M4 "reactions" plugin. It aggregates the per-emoji reaction content on the user's issues + issue comments via GraphQL and renders the upstream 8-emoji gauge panel.

Upstream (lowlighter/metrics) additionally covers discussions and discussion comments; those arms require extra scopes / a separate query surface and are deferred. The two issue-side sources reproduce the same gauge layout and per-content aggregation.

Index

Constants

View Source
const Name = "reactions"

Name is the canonical plugin slug.

Variables

View Source
var Plugin plugins.Plugin = &reactionsPlugin{}

Plugin is the singleton registered with the global plugin registry.

Functions

func Partial

Partial renders the classic SVG fragment for the reactions plugin. Mirrors upstream org_repo/source/templates/classic/partials/reactions.ejs.

It always renders the 8-category emoji gauge panel: one `<div class="category column">` per reaction with a `<svg class="gauge info">` circle (plus a `gauge-arc` when score > 0), the emoji as a `<text>` inside the gauge, and an optional `title nowrap` detail span driven by plugin_reactions_details.

Types

type Reaction added in v1.1.0

type Reaction struct {
	// Value is the raw number of reactions with this content.
	Value int `json:"value"`
	// Percentage is value / total reactions (absolute share).
	Percentage float64 `json:"percentage"`
	// Score drives the gauge arc: value / total in "absolute" display
	// mode, or value / max in "relative" display mode.
	Score float64 `json:"score"`
}

Reaction is the per-content aggregate published for one emoji category. Mirrors upstream's `list[content]` entry.

type Result

type Result struct {
	Skipped       bool   `json:"skipped,omitempty"`
	SkippedReason string `json:"-"`
	// List is the per-content aggregate keyed by the GraphQL
	// ReactionContent enum (HEART, THUMBS_UP, ...).
	List map[string]Reaction `json:"list"`
	// Total is the total number of reactions collected.
	Total int `json:"total"`
	// Comments is the number of comments scanned (drives the header).
	Comments int `json:"comments"`
	// Details mirrors upstream `plugin_reactions_details`: the ordered
	// detail fields to render under each gauge (count / percentage).
	Details []string `json:"details,omitempty"`
	// Days is the comment maximum age (0 = disabled).
	Days int `json:"days"`
}

Result is the JSON payload published under data.Plugins["reactions"].

func (*Result) IsSkipped

func (r *Result) IsSkipped() bool

IsSkipped lets the classic dispatcher detect the skipped path.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL