Skip to content

Commit ddeb918

Browse files
caitlinchan23Nkmailind-taniartviner
committed
removed lock/unlock logic from backend. NOTE: 'lock/unlock' labeled button is using paused logic.
Co-authored-by: Nkmai <[email protected]> Co-authored-by: lind-tania <[email protected]> Co-authored-by: rtviner <[email protected]> Co-authored-by: caitlinchan23 <[email protected]>
1 parent 7126d9e commit ddeb918

File tree

10 files changed

+11
-34
lines changed

10 files changed

+11
-34
lines changed

src/app/components/PerformanceVisx.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ const PerformanceVisx = (props: BarStackProps) => {
215215
key={`bar-stack-${barStack.index}-${bar.index}`}
216216
x={bar.x}
217217
y={bar.y}
218-
height={bar.height === 0 ? idx + 1 : bar.height}
218+
height={bar.height === 0 ? null : bar.height}
219219
width={bar.width}
220220
fill={bar.color}
221221
/* TIP TOOL EVENT HANDLERS */

src/app/containers/ButtonsContainer.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function ButtonsContainer() {
5555
const [{ tabs, currentTab }, dispatch] = useStoreContext();
5656
const {
5757
snapshots,
58-
mode: { paused, locked, persist },
58+
mode: { paused, persist },
5959
} = tabs[currentTab];
6060

6161
return (
@@ -68,13 +68,6 @@ function ButtonsContainer() {
6868
{paused? <FontAwesomeIcon icon={faUnlock} /> : <FontAwesomeIcon icon={faLock} />}
6969
{paused ? 'Unlock' : 'Lock'}
7070
</button>
71-
{/* <button
72-
className="lock-button"
73-
type="button"
74-
onClick={() => dispatch(toggleMode('locked'))}
75-
>
76-
{locked ? 'Unlocked': 'Locked'}
77-
</button> */}
7871
<button
7972
className="persist-button"
8073
type="button"

src/app/reducers/mainReducer.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,6 @@ export default (state, action) => produce(state, draft => {
185185
case 'paused':
186186
actionText = 'setPause';
187187
break;
188-
case 'locked':
189-
actionText = 'setLock';
190-
break;
191188
case 'persist':
192189
actionText = 'setPersist';
193190
break;

src/app/styles/components/_buttons.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@
127127
.import-button,
128128
.howToUse-button,
129129
.export-button,
130-
.lock-button,
131130
.pause-button,
132131
.persist-button {
133132
@extend %button-shared;
@@ -138,7 +137,6 @@
138137
.import-button:hover,
139138
.howToUse-button:hover,
140139
.export-button:hover,
141-
.lock-button:hover,
142140
.pause-button:hover,
143141
.persist-button:hover {
144142
@extend %button-shared;

src/backend/__tests__/linkFiber.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ describe('unit test for linkFiber', () => {
6969
mode = {
7070
jumping: false,
7171
paused: false,
72-
locked: false,
7372
};
7473
linkFiber = linkFiberStart(snapShot, mode);
7574

src/backend/index.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ const snapShot: Snapshot = {
2424
const mode: Mode = {
2525
jumping: false,
2626
paused: false,
27-
locked: false,
2827
};
2928
// console.log("linkFiberStart in index.ts:" + linkFiberStart);
3029
const linkFiber = linkFiberStart(snapShot, mode);
@@ -54,9 +53,6 @@ window.addEventListener('message', ({ data: { action, payload } }: MsgData) => {
5453
// try to modify workInProgress tree from here
5554
// window.history.pushState('', '', getRouteURL(payload));
5655
break;
57-
case 'setLock':
58-
mode.locked = payload;
59-
break;
6056
case 'setPause':
6157
mode.paused = payload;
6258
break;
@@ -72,7 +68,7 @@ window.addEventListener('message', ({ data: { action, payload } }: MsgData) => {
7268
}
7369
}
7470
} else {
75-
let element = document.querySelector(`.${payload}`);
71+
let element: HTMLElement = document.querySelector(`.${payload}`);
7672
// console.log("element: ", element);
7773
if (element !== null) {
7874
// console.log("element style: ", element.style)
@@ -83,13 +79,13 @@ window.addEventListener('message', ({ data: { action, payload } }: MsgData) => {
8379
case 'onHoverExit':
8480
if(Array.isArray(payload)){
8581
for (let i=0; i<payload.length;i++){
86-
let element = document.querySelector(`.${payload}`);
82+
let element: HTMLElement = document.querySelector(`.${payload}`);
8783
if (element !== null) {
8884
element.style.backgroundColor = '';
8985
}
9086
}
9187
} else {
92-
let element = document.querySelector(`.${payload}`);
88+
let element: HTMLElement = document.querySelector(`.${payload}`);
9389
// console.log("element style: ", element.style)
9490
if (element !== null) {
9591
element.style.backgroundColor = '';

src/backend/linkFiber.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414

1515
//tree
1616
Snapshot,
17-
//jump, pause, lock
17+
//jump, pause
1818
Mode,
1919
ComponentData,
2020
// array of state and component
@@ -75,7 +75,7 @@ function getRecoilState(): any {
7575
/**
7676
* @method sendSnapshot
7777
* @param snap The current snapshot
78-
* @param mode The current mode (i.e. jumping, time-traveling, locked, or paused)
78+
* @param mode The current mode (i.e. jumping, time-traveling, or paused)
7979
* @return Nothing.
8080
*
8181
* Middleware: Gets a copy of the current snap.tree and posts a recordSnap message to the window
@@ -109,11 +109,11 @@ function sendSnapshot(snap: Snapshot, mode: Mode): void {
109109
/**
110110
* @function updateSnapShotTree
111111
* @param snap The current snapshot
112-
* @param mode The current mode (i.e. jumping, time-traveling, locked, or paused)
112+
* @param mode The current mode (i.e. jumping, time-traveling, or paused)
113113
* Middleware: Updates snap object with latest snapshot, using @sendSnapshot
114114
*/
115115

116-
//updating tree depending on current mode on the panel (pause, locked etc)
116+
//updating tree depending on current mode on the panel (pause, etc)
117117
function updateSnapShotTree(snap: Snapshot, mode: Mode): void {
118118
// this is the currently active root fiber(the mutable root of the tree)
119119

@@ -486,7 +486,7 @@ function createTree(
486486
/**
487487
* @method linkFiber
488488
* @param snap The current snapshot
489-
* @param mode The current mode (i.e. jumping, time-traveling, locked, or paused)
489+
* @param mode The current mode (i.e. jumping, time-traveling, or paused)
490490
* @return a function to be invoked by index.js that initiates snapshot monitoring
491491
* linkFiber contains core module functionality, exported as an anonymous function.
492492
*/

src/backend/timeJump.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Console } from 'console';
88
* It exports an anonymous
99
* @function timeJump
1010
* @param origin The latest snapshot, linked to the fiber (changes to origin will change app)
11-
* @param mode The current mode (i.e. jumping, time-traveling, locked, or paused)
11+
* @param mode The current mode (i.e. jumping, time-traveling, or paused)
1212
* @returns A function that takes a target snapshot and a boolean flag checking for firstCall, then invokes `jump` on that target snapshot
1313
*
1414
* The target snapshot portrays some past state we want to travel to.

src/backend/types/backendTypes.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export interface Snapshot {
1212
export interface Mode {
1313
jumping: boolean;
1414
paused: boolean;
15-
locked: boolean;
1615
}
1716

1817
export interface SnapshotNode {

src/extension/background.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ function createTabObj(title) {
3030
initialHierarchy: null,
3131
mode: {
3232
persist: false,
33-
locked: false,
3433
paused: false,
3534
empty: false,
3635
},
@@ -162,9 +161,6 @@ chrome.runtime.onConnect.addListener((port) => {
162161
// resets currBranch
163162
tabsObj[tabId].currBranch = 0;
164163
return true;
165-
case 'setLock':
166-
tabsObj[tabId].mode.locked = payload;
167-
break;
168164
case 'setPause':
169165
tabsObj[tabId].mode.paused = payload;
170166
break;
@@ -232,7 +228,6 @@ chrome.runtime.onMessage.addListener((request, sender) => {
232228
break;
233229
}
234230
case 'tabReload': {
235-
tabsObj[tabId].mode.locked = false;
236231
tabsObj[tabId].mode.paused = false;
237232
// dont remove snapshots if persisting
238233
if (!persist) {

0 commit comments

Comments
 (0)