Skip to content

Commit 79f98df

Browse files
committed
updated tutorial for history
1 parent 7b04617 commit 79f98df

File tree

4 files changed

+56
-5
lines changed

4 files changed

+56
-5
lines changed

src/app/components/Diff.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function Diff(props: DiffProps): JSX.Element {
1515
const [mainState] = useStoreContext();
1616
const { currentTab, tabs } = mainState; // k/v pairs of mainstate store object being created
1717
const { snapshots, viewIndex, sliderIndex } = tabs[currentTab];
18-
let previous:unknown;
18+
let previous: unknown;
1919

2020
// previous follows viewIndex or sliderIndex
2121
if (viewIndex !== -1) {
@@ -66,7 +66,6 @@ function Diff(props: DiffProps): JSX.Element {
6666
const html: StatelessCleanning = formatters.html.format(delta, previousDisplay);
6767
if (show) formatters.html.showUnchanged();
6868
else formatters.html.hideUnchanged();
69-
7069
if (previous === undefined || delta === undefined) {
7170
return (
7271
<div className='no-data-message'>

src/app/components/StateRoute/History.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ function History(props: Record<string, unknown>): JSX.Element {
177177
.enter()
178178
.append('g')
179179
.style('cursor', 'pointer')
180+
.attr('class', `snapshotNode`)
180181
.on('click', (event, d) => {
181182
dispatch(changeView(d.data.index));
182183
dispatch(changeSlider(d.data.index));
@@ -253,6 +254,7 @@ function History(props: Record<string, unknown>): JSX.Element {
253254

254255
node
255256
.append('circle')
257+
256258
.attr('fill', (d) => {
257259
if (d.data.index === currLocation.index) {
258260
return 'red';

src/app/components/StateRoute/Tree.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const Tree = (props: TreeProps) => {
4949
const [store, dispatch] = useStoreContext();
5050

5151
useEffect(() => {
52-
dispatch(setCurrentTabInApp('history'));
52+
dispatch(setCurrentTabInApp('tree'));
5353
}, []);
5454

5555
return (

src/app/components/Tutorial.tsx

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ export default class Tutorial extends React.Component<tutorialProps, tutorialSta
242242
{
243243
title: 'Webmetrics Tab',
244244
element: '.web-metrics-container',
245-
intro: 'This section will show 4 webmetrics for your page.',
245+
intro: 'This section will show 4 webmetrics for your page when it loads.',
246246
position: 'top',
247247
},
248248
{
@@ -273,7 +273,57 @@ export default class Tutorial extends React.Component<tutorialProps, tutorialSta
273273
title: 'TTFB',
274274
element: document.querySelectorAll('.metric')[3],
275275
intro:
276-
"<strong>Time to first Byte</strong><br/>The amount of time it takes for a user's browser to receive the first byte of page content from the server.",
276+
"<strong>Time To First Byte</strong><br/>The amount of time it takes for a user's browser to receive the first byte of page content from the server.",
277+
position: 'top',
278+
},
279+
];
280+
break;
281+
case 'history':
282+
steps = [
283+
{
284+
title: 'History Tab',
285+
element: '.display',
286+
intro:
287+
'The history tab shows all snapshots as a timeline and includes branches to represent divergent state history created from time traveling backwards and making new state changes.',
288+
position: 'top',
289+
},
290+
{
291+
title: 'Viewing History Snapshot',
292+
element: document.querySelectorAll('.snapshotNode')[0],
293+
intro:
294+
'Each node will represent a snapshot in the page. <ul><li>A single snapshot will show as a node while multiple snapshots will be represented as a timeline.</li><li>Highlighting over one will show any state changes compared to the previous snapshot. </li><li>Clicking a node will set the snapshot as the current one.</li></ul>',
295+
position: 'top',
296+
},
297+
{
298+
title: 'Navigating through Snapshots',
299+
element: '.routedescription',
300+
intro: 'All snapshots can also be seen and navigated here as well.',
301+
position: 'right',
302+
},
303+
304+
{
305+
title: 'Clicking on Jump Button',
306+
element: document.querySelectorAll('.individual-action')[0],
307+
intro:
308+
'The button on the right of each snapshot can be used to jump to a given point in state to view the state history at that point.',
309+
position: 'right',
310+
},
311+
{
312+
title: 'Renaming The Snapshot',
313+
element: document.querySelectorAll('.action-component-text')[0],
314+
intro:
315+
'A snapshot can be renamed to provided more clarity or distinguish specific snapshots.',
316+
position: 'left',
317+
},
318+
];
319+
break;
320+
case 'tree':
321+
steps = [
322+
{
323+
title: 'Tree Tab',
324+
element: '.display',
325+
intro:
326+
'The tree tab can be used to view a text display of the state snapshots in a JSON format.',
277327
position: 'top',
278328
},
279329
];

0 commit comments

Comments
 (0)