Skip to content

Commit a7f76a0

Browse files
Merge pull request #245 from StackOverFlowWhereArtThou/fixesForCI
Release of version 9
2 parents 1e72795 + 2fd8ad1 commit a7f76a0

21 files changed

+11211
-9534
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545

4646
Currently, Reactime supports React apps using stateful components and Hooks, including frameworks like Gatsby and Next.js, with beta support for Recoil and Context API.
4747

48-
<b>Reactime version 8.0</b> allows you to run A/B testing on your application by storing a "series" of state data snapshots. At any stage in the dev cycle, devs could run Reactime again and select any past series to do an A/B test with the current series of snapshots. With Save Series, developers have access to view trends in their App's component render times during development by comparing the previous series of snapshots.
48+
<b>Reactime version 9.0</b> allows you to run A/B testing on your application by storing a "series" of state data snapshots. At any stage in the dev cycle, devs could run Reactime again and select any past series to do an A/B test with the current series of snapshots. With Save Series, developers have access to view trends in their App's component render times during development by comparing the previous series of snapshots.
4949

50-
Reactime 8.0 fixes previous version bugs and incorporates improved visualizations for component relationships. Reactime 8.0 includes expanded [typedoc](https://typedoc.org/api/) documentation for developers looking to contribute to the source code.
50+
Reactime 9.0 fixes previous version bugs and incorporates improved user experience for saved snapshot series.
5151

5252
After installing Reactime, you can test its functionalities with your React application in development mode.
5353

@@ -152,6 +152,10 @@ After cloning this repository, developers can simply run `npm run docs` at the r
152152
- [Deep in Weeds with Reactime, Concurrent React_fiberRoot, and Browser History Caching](https://itnext.io/deep-in-the-weeds-with-reactime-concurrent-react-fiberroot-and-browser-history-caching-7ce9d7300abb)
153153

154154
## <b>Authors</b>
155+
- **Harry Fox** - [@StackOverFlowWhereArtThou](https://github.com/StackOverFlowWhereArtThou)
156+
- **Nathan Richardson** - [@BagelEnthusiast](https://github.com/BagelEnthusiast)
157+
- **David Bernstein** - [@dangitbobbeh](https://github.com/dangitbobbeh)
158+
- **Joseph Stern** - [@josephiswhere](https://github.com/josephiswhere)
155159
- **Dennis Lopez** - [@DennisLpz](https://github.com/DennisLpz)
156160
- **Cole Styron** - [@colestyron](https://github.com/C-STYR)
157161
- **Ali Rahman** - [@CourageWolf](https://github.com/CourageWolf)

src/app/__tests__/action.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const Action = require('../components/Action').default;
1111

1212
configure({ adapter: new (Adapter as any)() });
1313

14-
describe('unit testing for Action.jsx', () => {
14+
describe('unit testing for Action.tsx', () => {
1515
let wrapper;
1616
const props = {
1717
key: 'actions2',
@@ -22,6 +22,7 @@ describe('unit testing for Action.jsx', () => {
2222
dispatch: jest.fn(),
2323
displayName: '3.0',
2424
componentName: 'App',
25+
logChangedState: jest.fn(),
2526
componentData: {
2627
actualDuration: 3.5,
2728
},

src/app/components/Action.tsx

Lines changed: 57 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/* eslint-disable react/no-unused-prop-types */
44

55
import React from 'react';
6+
import ReactHover, { Trigger, Hover } from 'react-hover';
67
import { changeView, changeSlider } from '../actions/actions';
78

89
/**
@@ -15,13 +16,14 @@ interface ActionProps {
1516
last: boolean;
1617
index: number;
1718
sliderIndex: number;
18-
dispatch: (a:any) => void;
19+
dispatch: (a: any) => void;
1920
displayName: string;
2021
componentName: string;
21-
componentData: {actualDuration: number}|undefined;
22+
componentData: { actualDuration: number } | undefined;
2223
state?: Record<string, unknown>;
2324
viewIndex: number;
24-
handleOnkeyDown: (e: any, i: number) => void;
25+
handleOnkeyDown: (e: any, i: number) => any;
26+
logChangedState: (index: number) => any;
2527
}
2628

2729
/**
@@ -42,8 +44,17 @@ interface ActionProps {
4244
// viewIndex and handleonkeyDown added to props
4345
const Action = (props: ActionProps): JSX.Element => {
4446
const {
45-
selected, last, index, sliderIndex, dispatch, displayName, componentName,
46-
componentData, viewIndex, handleOnkeyDown,
47+
selected,
48+
last,
49+
index,
50+
sliderIndex,
51+
dispatch,
52+
displayName,
53+
componentName,
54+
componentData,
55+
viewIndex,
56+
handleOnkeyDown,
57+
logChangedState,
4758
} = props;
4859

4960
/**
@@ -54,7 +65,7 @@ const Action = (props: ActionProps): JSX.Element => {
5465
if (!componentData || !componentData.actualDuration) {
5566
return 'NO TIME';
5667
}
57-
let seconds:number| string;
68+
let seconds: number | string;
5869
let miliseconds: any = componentData.actualDuration;
5970
if (Math.floor(componentData.actualDuration) > 60) {
6071
seconds = Math.floor(componentData.actualDuration / 60);
@@ -78,39 +89,56 @@ const Action = (props: ActionProps): JSX.Element => {
7889
};
7990
const displayTime = cleanTime();
8091

92+
const optionsCursorTrueWithMargin = {
93+
followCursor: true,
94+
shiftX: 20,
95+
shiftY: 0,
96+
};
97+
8198
return (
8299
<div
83100
// Invoking keyboard functionality; functionality is in ActionContainer;
84101
onKeyDown={(e) => handleOnkeyDown(e, viewIndex)}
85-
className={selected || last ? 'action-component selected' : 'action-component'}
102+
className={
103+
selected || last ? 'action-component selected' : 'action-component'
104+
}
86105
onClick={() => {
87106
dispatch(changeView(index));
88107
}}
89-
role="presentation"
108+
role='presentation'
90109
style={index > sliderIndex ? { color: '#5f6369' } : {}}
91110
tabIndex={index}
92111
>
93-
<div className="action-component-text">
94-
{`${displayName}: ${componentName !== 'nameless' ? componentName : ''} `}
95-
</div>
96-
<button
97-
className="time-button"
98-
type="button"
99-
>
100-
{displayTime}
101-
</button>
102-
<button
103-
className="jump-button"
104-
onClick={(e: any): void => {
105-
e.stopPropagation();
106-
dispatch(changeSlider(index));
107-
dispatch(changeView(index));
108-
}}
109-
tabIndex={index}
110-
type="button"
111-
>
112-
Jump
113-
</button>
112+
<ReactHover options={optionsCursorTrueWithMargin}>
113+
<Trigger type='trigger'>
114+
<div className='action-component-trigger' style={index > sliderIndex ? { color: '#5f6369' } : {}}>
115+
<div className='action-component-text'>
116+
{`${displayName}: ${componentName !== 'nameless' ? componentName : ''} `}
117+
{/* {`displayName: ${displayName}`} */}
118+
</div>
119+
<button className='time-button' type='button'>
120+
{displayTime}
121+
</button>
122+
<button
123+
className='jump-button'
124+
onClick={(e: any): void => {
125+
e.stopPropagation();
126+
dispatch(changeSlider(index));
127+
dispatch(changeView(index));
128+
}}
129+
tabIndex={index}
130+
type='button'
131+
>
132+
Jump
133+
</button>
134+
</div>
135+
</Trigger>
136+
<Hover type='hover'>
137+
<div style={{ padding: '0.5rem 1rem' }} id='hover-box'>
138+
<p>{logChangedState(index)}</p>
139+
</div>
140+
</Hover>
141+
</ReactHover>
114142
</div>
115143
);
116144
};

src/app/components/BarGraph.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @ts-nocheck
2-
import React from 'react';
2+
import React, { useEffect } from 'react';
33
import { BarStack } from '@visx/shape';
44
import { SeriesPoint } from '@visx/shape/lib/types';
55
import { Group } from '@visx/group';
@@ -109,19 +109,19 @@ const BarGraph = (props) => {
109109
data,
110110
};
111111

112-
const animateButton = function (e) {
113-
e.preventDefault;
114-
e.target.classList.add('animate');
115-
e.target.innerHTML = 'Saved!';
116-
setTimeout(function () {
117-
e.target.innerHTML = 'Save Series';
118-
e.target.classList.remove('animate');
119-
}, 1000);
120-
};
121-
const classname = document.getElementsByClassName('save-series-button');
122-
for (let i = 0; i < classname.length; i++) {
123-
classname[i].addEventListener('click', animateButton, false);
124-
}
112+
// use this to animate the save series button. It
113+
useEffect(() => {
114+
const saveButtons = document.getElementsByClassName('save-series-button');
115+
for (let i = 0; i < saveButtons.length; i++) {
116+
if (tabs[currentTab].seriesSavedStatus) {
117+
saveButtons[i].classList.add('animate');
118+
saveButtons[i].innerHTML = 'Saved!';
119+
} else {
120+
saveButtons[i].innerHTML = 'Save Series';
121+
saveButtons[i].classList.remove('animate');
122+
};
123+
};
124+
});
125125
return (
126126
<div className='bargraph-position'>
127127
<button

0 commit comments

Comments
 (0)