Skip to content

Commit 74f658d

Browse files
authored
Merge branch 'main' into l10n
2 parents 04770d1 + 79cd96d commit 74f658d

File tree

5 files changed

+125
-104
lines changed

5 files changed

+125
-104
lines changed

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,15 @@
115115
"@babel/preset-env": "^7.28.5",
116116
"@babel/preset-react": "^7.28.5",
117117
"@babel/preset-typescript": "^7.28.5",
118-
"@eslint/js": "^9.37.0",
118+
"@eslint/js": "^9.39.1",
119119
"@testing-library/dom": "^10.4.1",
120120
"@testing-library/jest-dom": "^6.9.1",
121121
"@testing-library/react": "^16.3.0",
122122
"@types/clamp": "^1.0.3",
123123
"@types/common-tags": "^1.8.4",
124124
"@types/jest": "^30.0.0",
125125
"@types/minimist": "^1.2.5",
126-
"@types/node": "^22.19.0",
126+
"@types/node": "^22.19.1",
127127
"@types/query-string": "^6.3.0",
128128
"@types/react": "^18.3.26",
129129
"@types/react-dom": "^18.3.1",
@@ -144,9 +144,9 @@
144144
"copy-webpack-plugin": "^13.0.1",
145145
"cross-env": "^10.1.0",
146146
"css-loader": "^7.1.2",
147-
"cssnano": "^7.1.1",
147+
"cssnano": "^7.1.2",
148148
"devtools-license-check": "^0.9.0",
149-
"eslint": "^9.37.0",
149+
"eslint": "^9.39.1",
150150
"eslint-config-prettier": "^10.1.8",
151151
"eslint-import-resolver-alias": "^1.1.2",
152152
"eslint-plugin-import": "^2.32.0",
@@ -160,7 +160,7 @@
160160
"fetch-mock": "^12.5.5",
161161
"file-loader": "^6.2.0",
162162
"glob": "^11.0.3",
163-
"globals": "^16.4.0",
163+
"globals": "^16.5.0",
164164
"html-webpack-plugin": "^5.6.4",
165165
"husky": "^4.3.8",
166166
"jest": "^30.2.0",

src/reducers/app.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

55
import { combineReducers } from 'redux';
6-
import { tabSlugs } from '../app-logic/tabs-handling';
6+
import { tabSlugs, tabsShowingSampleData } from '../app-logic/tabs-handling';
77

88
import type { TabSlug } from '../app-logic/tabs-handling';
99
import type { BrowserConnectionStatus } from '../app-logic/browser-connection';
@@ -170,6 +170,10 @@ const lastVisibleThreadTabSlug: Reducer<TabSlug> = (
170170
}
171171
return state;
172172
case 'FOCUS_CALL_TREE':
173+
if (tabsShowingSampleData.includes(state)) {
174+
// Don't switch to call tree if the tab is already showing sample data.
175+
return state;
176+
}
173177
return 'calltree';
174178
default:
175179
return state;

src/reducers/url-state.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import { combineReducers } from 'redux';
66
import { oneLine } from 'common-tags';
77
import { objectEntries } from '../utils/types';
8-
import { tabSlugs } from '../app-logic/tabs-handling';
8+
import { tabSlugs, tabsShowingSampleData } from '../app-logic/tabs-handling';
99

1010
import type {
1111
ThreadIndex,
@@ -98,6 +98,10 @@ const selectedTab: Reducer<TabSlug> = (state = 'calltree', action) => {
9898
case 'CHANGE_TAB_FILTER':
9999
return action.selectedTab;
100100
case 'FOCUS_CALL_TREE':
101+
if (tabsShowingSampleData.includes(state)) {
102+
// Don't switch to call tree if the tab is already showing sample data.
103+
return state;
104+
}
101105
return 'calltree';
102106
default:
103107
return state;

src/test/components/ThreadActivityGraph.test.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ describe('ThreadActivityGraph', function () {
264264
expect(getCallNodePath()).toEqual([]);
265265
});
266266

267-
it('when clicking a stack, this selects the call tree panel', function () {
267+
it('when clicking a stack while on a tab that does not show sample data, this selects the call tree panel', function () {
268268
const { dispatch, getState, clickActivityGraph } = setup();
269269

270270
expect(getSelectedTab(getState())).toBe('calltree');
@@ -277,6 +277,19 @@ describe('ThreadActivityGraph', function () {
277277
expect(getLastVisibleThreadTabSlug(getState())).toBe('calltree');
278278
});
279279

280+
it('when clicking a stack while on a tab that shows sample data, it should not change the selected panel', function () {
281+
const { dispatch, getState, clickActivityGraph } = setup();
282+
283+
expect(getSelectedTab(getState())).toBe('calltree');
284+
dispatch(changeSelectedTab('flame-graph'));
285+
286+
// The full call node at this sample is:
287+
// A -> B -> C -> F -> G
288+
clickActivityGraph(1, 0.2);
289+
expect(getSelectedTab(getState())).toBe('flame-graph');
290+
expect(getLastVisibleThreadTabSlug(getState())).toBe('flame-graph');
291+
});
292+
280293
it(`when clicking outside of the graph, this doesn't select the call tree panel`, function () {
281294
const { dispatch, getState, clickActivityGraph } = setup();
282295

0 commit comments

Comments
 (0)