@@ -4,7 +4,14 @@ import { useEffect, useRef, useState } from "react";
44import BounceLoader from "react-spinners/BounceLoader" ;
55
66import MonoLogo from "assets/monoLogo.svg" ;
7- import { BranchSelector , Statistics , TemporalFilter , ThemeSelector , VerticalClusterList , FolderActivityFlow } from "components" ;
7+ import {
8+ BranchSelector ,
9+ Statistics ,
10+ TemporalFilter ,
11+ ThemeSelector ,
12+ VerticalClusterList ,
13+ FolderActivityFlow ,
14+ } from "components" ;
815import "./App.scss" ;
916import type IDEPort from "ide/IDEPort" ;
1017import { useAnalayzedData } from "hooks" ;
@@ -13,6 +20,12 @@ import type { IDESentEvents } from "types/IDESentEvents";
1320import { useBranchStore , useDataStore , useGithubInfo , useLoadingStore , useThemeStore } from "store" ;
1421import { THEME_INFO } from "components/ThemeSelector/ThemeSelector.const" ;
1522import { NetworkGraph } from "components/NetworkGraph" ;
23+ import {
24+ analyzeReleaseBasedFolders ,
25+ extractReleaseBasedContributorActivities ,
26+ findFirstReleaseContributorNodes ,
27+ generateReleaseFlowLineData ,
28+ } from "components/FolderActivityFlow/FolderActivityFlow.util" ;
1629
1730const App = ( ) => {
1831 const initRef = useRef < boolean > ( false ) ;
@@ -23,6 +36,7 @@ const App = () => {
2336 const { handleGithubInfo } = useGithubInfo ( ) ;
2437 const { loading, setLoading } = useLoadingStore ( ) ;
2538 const { theme } = useThemeStore ( ) ;
39+ const totalData = useDataStore ( ( state ) => state . data ) ;
2640 const ideAdapter = container . resolve < IDEPort > ( "IDEAdapter" ) ;
2741
2842 const handleOpenFolderActivityFlowModal = ( ) => {
@@ -33,6 +47,14 @@ const App = () => {
3347 setShowFolderActivityFlowModal ( false ) ;
3448 } ;
3549
50+ // storyline chart
51+ const flatData = totalData . flat ( ) ;
52+ const releaseResult = analyzeReleaseBasedFolders ( flatData , 8 , 1 ) ;
53+ const { releaseGroups, topFolderPaths : releaseTopFolderPaths } = releaseResult ;
54+ const releaseContributorActivities = extractReleaseBasedContributorActivities ( flatData , releaseTopFolderPaths , 1 ) ;
55+ const flowLineData = generateReleaseFlowLineData ( releaseContributorActivities ) ;
56+ const firstNodesByContributor = findFirstReleaseContributorNodes ( releaseContributorActivities ) ;
57+
3658 useEffect ( ( ) => {
3759 if ( initRef . current === false ) {
3860 const callbacks : IDESentEvents = {
@@ -73,6 +95,7 @@ const App = () => {
7395 < button
7496 className = "folder-activity-flow-button"
7597 onClick = { handleOpenFolderActivityFlowModal }
98+ type = "button"
7699 >
77100 Folder Activity Flow
78101 </ button >
@@ -100,19 +123,32 @@ const App = () => {
100123 { showFolderActivityFlowModal && (
101124 < div
102125 className = "folder-activity-flow-modal"
103- onClick = { handleCloseFolderActivityFlowModal }
126+ onClick = { ( e ) => {
127+ if ( e . target === e . currentTarget ) {
128+ handleCloseFolderActivityFlowModal ( ) ;
129+ }
130+ } }
131+ onKeyDown = { ( e ) => e . key === "Escape" && handleCloseFolderActivityFlowModal ( ) }
132+ role = "button"
133+ tabIndex = { 0 }
134+ aria-label = "Close modal"
104135 >
105- < div
106- className = "folder-activity-flow-modal-content"
107- onClick = { ( e ) => e . stopPropagation ( ) }
108- >
136+ < div className = "folder-activity-flow-modal-content" >
109137 < button
110138 className = "folder-activity-flow-modal-close"
111139 onClick = { handleCloseFolderActivityFlowModal }
140+ type = "button"
141+ aria-label = "Close modal"
112142 >
113143 ×
114144 </ button >
115- < FolderActivityFlow />
145+ < FolderActivityFlow
146+ releaseGroups = { releaseGroups }
147+ releaseTopFolderPaths = { releaseTopFolderPaths }
148+ flowLineData = { flowLineData }
149+ releaseContributorActivities = { releaseContributorActivities }
150+ firstNodesByContributor = { firstNodesByContributor }
151+ />
116152 </ div >
117153 </ div >
118154 ) }
0 commit comments