Skip to content

AI-native design editor. Open-source Figma alternative.

feat: show pull requests and issues opened and closed per day (#1365)

Danila Poyarkov0a1b81724ee2
diff --git a/src/components/metrics/MetricsDashboard.stories.ts b/src/components/metrics/MetricsDashboard.stories.ts
index 08e5660f0..6880d7196 100644
--- a/src/components/metrics/MetricsDashboard.stories.ts
+++ b/src/components/metrics/MetricsDashboard.stories.ts
@@ -330,13 +330,13 @@ const story = (frame: string, withUsage = true, withActivity = true): Story => (
})
})
-export const Overview = story('h-[3700px]')
+export const Overview = story('h-[3950px]')
/** PostHog did not answer: retention and usage give way to a notice, the rest stays. */
-export const WithoutUsage = story('h-[3300px]', false)
+export const WithoutUsage = story('h-[3550px]', false)
/** Before the first nightly sync, issues and pull requests give way to a notice. */
export const BeforeIssueSync = story('h-[3000px]', true, false)
/** The dashboard in a phone-width window. */
-export const Narrow = story('h-[5600px] w-[390px]')
+export const Narrow = story('h-[6100px] w-[390px]')
diff --git a/src/components/metrics/MetricsDashboard.vue b/src/components/metrics/MetricsDashboard.vue
index c9e334c8a..600625f0e 100644
--- a/src/components/metrics/MetricsDashboard.vue
+++ b/src/components/metrics/MetricsDashboard.vue
@@ -29,14 +29,7 @@ import MetricsRangePicker from './MetricsRangePicker.vue'
import MetricsTile from './MetricsTile.vue'
import PlatformsChart from './PlatformsChart.vue'
import RetentionChart from './RetentionChart.vue'
-import type {
- DailyActiveDay,
- DailyIssues,
- DailyPulls,
- DailyTraffic,
- DailyVersions,
- DailyVisits
-} from './types'
+import type { DailyActiveDay, DailyPulls, DailyTraffic, DailyVersions, DailyVisits } from './types'
import WaitlistList from './WaitlistList.vue'
/**
@@ -116,10 +109,14 @@ const OPEN_SERIES: DailySeries<'openCommunity' | 'openTeam'>[] = [
{ key: 'openCommunity', name: 'Community', color: 'var(--color-chart-1)' },
{ key: 'openTeam', name: 'Team', color: 'var(--color-chart-3)' }
]
-const OPENED_SERIES: DailySeries<keyof DailyIssues & string>[] = [
+const OPENED_SERIES: DailySeries<'openedCommunity' | 'openedTeam'>[] = [
{ key: 'openedCommunity', name: 'Community', color: 'var(--color-chart-1)' },
{ key: 'openedTeam', name: 'Team', color: 'var(--color-chart-3)' }
]
+const CLOSED_SERIES: DailySeries<'closedCommunity' | 'closedTeam'>[] = [
+ { key: 'closedCommunity', name: 'Community', color: 'var(--color-chart-1)' },
+ { key: 'closedTeam', name: 'Team', color: 'var(--color-chart-3)' }
+]
const MERGED_SERIES: DailySeries<keyof DailyPulls & string>[] = [
{ key: 'mergedCommunity', name: 'Community', color: 'var(--color-chart-1)' },
{ key: 'mergedTeam', name: 'Team', color: 'var(--color-chart-3)' }
@@ -390,7 +387,7 @@ const sharingNote = computed(() => {
<div v-if="activity.issues.length" :class="ui.row()">
<MetricsCard
heading="Issues"
- note="Open at the end of each day, and opened per day. Team: the repository's members and collaborators."
+ note="Open at the end of each day, and opened and closed per day. Team: the repository's members and collaborators."
>
<template v-if="openNow(activity.issues)" #aside>{{
openNow(activity.issues)
@@ -410,10 +407,19 @@ const sharingNote = computed(() => {
:height="160"
stacked
/>
+ <h4 :class="ui.sectionLabel()">Closed per day</h4>
+ <DailyChart
+ label="Issues closed per day, by who opened them"
+ :days="activity.issues"
+ :series="CLOSED_SERIES"
+ :today="snapshot.today"
+ :height="160"
+ stacked
+ />
</MetricsCard>
<MetricsCard
heading="Pull requests"
- note="Open at the end of each day, and merged per day"
+ note="Open at the end of each day, and opened and merged per day"
>
<template v-if="openNow(activity.pulls)" #aside>{{
openNow(activity.pulls)
@@ -424,6 +430,15 @@ const sharingNote = computed(() => {
:days="activity.pulls"
:series="OPEN_SERIES"
/>
+ <h4 :class="ui.sectionLabel()">Opened per day</h4>
+ <DailyChart
+ label="Pull requests opened per day by the community and the team"
+ :days="activity.pulls"
+ :series="OPENED_SERIES"
+ :today="snapshot.today"
+ :height="160"
+ stacked
+ />
<h4 :class="ui.sectionLabel()">Merged per day</h4>
<DailyChart
label="Pull requests merged per day from the community and the team"
diff --git a/src/components/metrics/WaitlistList.vue b/src/components/metrics/WaitlistList.vue
index 58019e7e9..d8a930a91 100644
--- a/src/components/metrics/WaitlistList.vue
+++ b/src/components/metrics/WaitlistList.vue
@@ -14,7 +14,8 @@ import type { WaitlistSignup } from './types'
const { signups } = defineProps<{ signups: WaitlistSignup[] }>()
const ui = metricsWaitlist()
-const COLLAPSED_ROWS = 6
+// About as many as fit beside the GitHub card, so the row has no empty space below the list.
+const COLLAPSED_ROWS = 12
const expanded = ref(false)
const shown = computed(() => (expanded.value ? signups : signups.slice(0, COLLAPSED_ROWS)))
const hidden = computed(() => signups.length - shown.value.length)