Skip to content

Community Trends: show opened/closed issue deltas (candlestick-style) #60

@djdarcy

Description

@djdarcy

Community Trends: show opened/closed issue deltas (candlestick-style)

Problem

The Community Trends chart currently shows openIssues as a single line — the point-in-time count of open issues each day. This hides the churn: a day where 3 issues were opened and 3 were closed looks identical to a day with zero activity. Users can't tell whether the issue count is stable because nothing happened or because opened and closed cancelled out.

Current display:

Open Issues:  6 ── 6 ── 6 ── 7 ── 7

What this hides:

Day 1: 6 open (quiet)
Day 2: 6 open (+2 opened, -2 closed — active day!)
Day 3: 6 open (quiet)
Day 4: 7 open (+1 opened)
Day 5: 7 open (+3 opened, -3 closed — very active!)

Proposed solution

Add a candlestick-style visualization that shows both the net open count and the daily opened/closed breakdown, similar to how financial charts show open/close/high/low.

Option A: Stacked bar overlay (recommended)

Keep the existing openIssues line, and add a stacked bar chart behind it showing daily deltas:

         ┌──┐
    ▓▓▓▓ │  │ ▓▓▓▓    ▓ = opened (green bars going up)
────────────────────   ─ = net open issues line
    ░░░░      ░░░░     ░ = closed (red bars going down)
         └──┘
  • Green bars above the axis: issues opened that day
  • Red bars below the axis: issues closed that day
  • Line: net open count (existing behavior)

Option B: Floating bar (true candlestick)

Each day shows a floating bar from min(open_start, open_end) to max(open_start, open_end), colored green if net positive, red if net negative. Wicks show opened/closed counts.

Option C: Tooltip enrichment (minimal)

Keep the current line chart but add opened/closed counts to the tooltip on hover. Lowest effort, still informative.

Data requirements

The current schema stores only openIssues (a single integer per day). To show opened/closed deltas, we need one of:

Approach 1 — Compute from consecutive snapshots (no schema change):

// Delta between consecutive days
var delta = today.openIssues - yesterday.openIssues;
// delta > 0 means net opened, delta < 0 means net closed
// But can't distinguish "0 activity" from "equal opened/closed"

Limitation: only shows net change, not gross opened + gross closed.

Approach 2 — Fetch Issues Events API (workflow change):

// GET /repos/{owner}/{repo}/issues/events?per_page=100
// Filter by created_at for today, count "opened" vs "closed" events

Store per-day: { issuesOpened: N, issuesClosed: N, openIssues: N }

This gives the full picture but adds an API call to the workflow.

Approach 3 — GitHub Issues timeline (workflow change):

// GET /repos/{owner}/{repo}/issues?state=all&since=YESTERDAY&sort=created
// Count new issues (created today) and closed issues (closed_at today)

Recommendation

Start with Approach 1 + Option C (tooltip enrichment from consecutive-day deltas) as the minimum viable version. This requires zero schema changes and zero workflow changes — pure dashboard-side computation. Then graduate to Approach 2 + Option A (stacked bars with real opened/closed counts) when the workflow can be extended.

Acceptance criteria

  • Community Trends chart shows daily issue change direction (at minimum via tooltip)
  • Users can distinguish "quiet day" from "active day with equal opened/closed"
  • Works with existing dailyHistory data (consecutive-day delta computation)
  • Stretch: workflow fetches actual opened/closed counts per day
  • Stretch: stacked bar overlay showing opened (green) and closed (red)

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    dashboardDashboard UI and visualizationenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions