Skip to content

Commit cb9c976

Browse files
authored
Merge branch 'main' into fix-compare-url-upgraders
2 parents 9b64e30 + 33c9f6a commit cb9c976

29 files changed

+720
-266
lines changed

locales/be/app.ftl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ Home--additional-content-title = Загрузіць існуючыя профі
315315
Home--additional-content-content = Вы можаце <strong>перацягнуць</strong> файл профілю сюды, каб загрузіць яго, або:
316316
Home--compare-recordings-info = Вы таксама можаце параўнаць запісы. <a>Адкрыць інтэрфейс параўнання.</a>
317317
Home--your-recent-uploaded-recordings-title = Вашы нядаўна запампаваныя запісы
318+
Home--dark-mode-title = Цёмны рэжым
318319
# We replace the elements such as <perf> and <simpleperf> with links to the
319320
# documentation to use these tools.
320321
Home--load-files-from-other-tools2 =
@@ -569,6 +570,8 @@ MenuButtons--metaInfo--buffer-duration-seconds =
569570
MenuButtons--metaInfo--buffer-duration-unlimited = Неабмежавана
570571
MenuButtons--metaInfo--application = Праграма
571572
MenuButtons--metaInfo--name-and-version = Назва і версія:
573+
# The time between application startup and when the profiler was started
574+
MenuButtons--metaInfo--application-uptime2 = Час працы:
572575
MenuButtons--metaInfo--update-channel = Канал абнаўлення:
573576
MenuButtons--metaInfo--build-id = ID зборкі:
574577
MenuButtons--metaInfo--build-type = Тып зборкі:
@@ -881,6 +884,11 @@ TrackPower--tooltip-power-watt = { $value } Вт
881884
# $value (String) - the power value at this location
882885
TrackPower--tooltip-power-milliwatt = { $value } мВт
883886
.label = Магутнасць
887+
# This is used in the tooltip when the instant power value uses the microwatt unit.
888+
# Variables:
889+
# $value (String) - the power value at this location
890+
TrackPower--tooltip-power-microwatt = { $value } мкВт
891+
.label = Энэргія
884892
# This is used in the tooltip when the power value uses the kilowatt unit.
885893
# Variables:
886894
# $value (String) - the power value at this location
@@ -1175,6 +1183,17 @@ AssemblyView--show-button =
11751183
# Assembly refers to the low-level programming language.
11761184
AssemblyView--hide-button =
11771185
.title = Схаваць прагляд асэмблера
1186+
# The "◀" button above the assembly view.
1187+
AssemblyView--prev-button =
1188+
.title = Назад
1189+
# The "▶" button above the assembly view.
1190+
AssemblyView--next-button =
1191+
.title = Далей
1192+
# The label showing the current position and total count above the assembly view.
1193+
# Variables:
1194+
# $current (Number) - The current position (1-indexed).
1195+
# $total (Number) - The total count.
1196+
AssemblyView--position-label = { $current } з { $total }
11781197
11791198
## UploadedRecordingsHome
11801199
## This is the page that displays all the profiles that user has uploaded.

locales/el/app.ftl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@ Home--record-instructions =
348348
Για να αρχίσει η καταγραφή προφίλ, κάντε κλικ στο αντίστοιχο κουμπί ή χρησιμοποιήστε
349349
τις συντομεύσεις πληκτρολογίου. Το εικονίδιο είναι μπλε κατά την καταγραφή ενός προφίλ.
350350
Πατήστε το <kbd>Καταγραφή</kbd> για να φορτώσετε τα δεδομένα στο profiler.firefox.com.
351+
Home--instructions-content2 =
352+
Η καταγραφή των προφίλ επιδόσεων απαιτεί το <a>{ -firefox-brand-name } για υπολογιστές</a>.
353+
Ωστόσο, τα υπάρχοντα προφίλ μπορούν να προβληθούν σε όλα τα σύγχρονα προγράμματα περιήγησης.
351354
Home--fenix-instructions-directly =
352355
Μπορείτε να καταγράψετε προφίλ για το { -firefox-android-brand-name } απευθείας σε αυτήν τη συσκευή. Για
353356
περισσότερες πληροφορίες, διαβάστε το <a>Καταγραφή προφίλ του { -firefox-android-brand-name } απευθείας στη συσκευή</a>.

locales/en-GB/app.ftl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,9 @@ Home--record-instructions =
352352
To start profiling, click on the profiling button, or use the
353353
keyboard shortcuts. The icon is blue when a profile is recording.
354354
Hit <kbd>Capture</kbd> to load the data into profiler.firefox.com.
355+
Home--instructions-content2 =
356+
Recording performance profiles requires <a>{ -firefox-brand-name } for desktop</a>.
357+
However, existing profiles can be viewed in any modern browser.
355358
Home--fenix-instructions-directly =
356359
{ -firefox-android-brand-name } can be profiled directly on this device. For
357360
more information, read <a>Profiling { -firefox-android-brand-name } directly on device</a>.

locales/es-CL/app.ftl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,9 @@ Home--enable-button-unavailable =
284284
# This message can be seen on https://main--perf-html.netlify.app/ .
285285
Home--web-channel-unavailable = Esta instancia del perfilador no pudo conectarse a WebChannel. Esto usualmente significa que está ejecutándose en un servidor diferente del especificado en la preferencia <code>devtools.performance.recording.ui-base-url</code>. Si quieres capturar nuevos perfiles con esta instancia, y otorgarle control programático del botón del menú del perfilador, puedes ir a <code>about:config</code> y cambiar la preferencia.
286286
Home--record-instructions = Para empezar a perfilar, haz clic en el botón de perfilado o utiliza los atajos del teclado. El icono se torna azul cuando se está grabando un perfil. Pulsa <kbd>Capturar</kbd> para cargar los datos en profiler.firefox.com.
287+
Home--instructions-content2 =
288+
Registrar perfiles de rendimiento requiere de <a>{ -firefox-brand-name } para escritorio</a>.
289+
Sin embargo, los perfiles existentes pueden ser vistos en cualquier navegador moderno.
287290
Home--fenix-instructions-directly = { -firefox-android-brand-name } puede ser perfilado directamente en este dispositivo. Para más información, consulta <a>Perfilar { -firefox-android-brand-name } directamente en el dispositivo</a>.
288291
Home--fenix-instructions-remotely = También puedes perfilar { -firefox-android-brand-name } de forma remota desde { -firefox-brand-name } para escritorio. Para más información, consulta esta documentación: <a>Perfilar { -firefox-android-brand-name } de forma remota</a>.
289292
Home--record-instructions-start-stop = Detener e iniciar perfilado

locales/ia/app.ftl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,9 @@ Home--record-instructions =
344344
Pro comenciar le profilage, clicca sur le button de profilage o usa le
345345
claves de accesso directe. Le icone es blau quando un profilo se registra.
346346
Pulsa <kbd>Capturar</kbd> pro cargar le datos in profiler.firefox.com.
347+
Home--instructions-content2 =
348+
Registrar profilos de prestation require <a>{ -firefox-brand-name } pro scriptorio</a>.
349+
Totevia, le profilos existente pote esser vidite in qualcunque navigator moderne.
347350
Home--fenix-instructions-directly =
348351
{ -firefox-android-brand-name } pote esser profilate directemente sur iste
349352
apparato. Pro altere informationes, lege <a>Profilar { -firefox-android-brand-name }

locales/sv-SE/app.ftl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,9 @@ Home--record-instructions =
347347
För att starta profilering, klicka på profileringsknappen eller använd
348348
kortkommandona. Ikonen är blå när en profil spelas in. Tryck på
349349
<kbd>Fånga</kbd> för att ladda data till profiler.firefox.com.
350+
Home--instructions-content2 =
351+
Inspelning av prestandaprofiler kräver <a>{ -firefox-brand-name } för datorer</a>.
352+
Befintliga profiler kan dock visas i vilken modern webbläsare som helst.
350353
Home--fenix-instructions-directly =
351354
{ -firefox-android-brand-name } kan profileras direkt på den här enheten. För
352355
mer information, läs <a>Profilering av { -firefox-android-brand-name } direkt på enheten</a>.

locales/tr/app.ftl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,9 @@ Home--record-instructions =
265265
Profillemeyi başlatmak için profilleme düğmesine tıklayın veya
266266
klavye kısayollarını kullanın. Profil kaydedilirken simge maviye dönüşür.
267267
Verileri profiler.firefox.com’a yüklemek için <kbd>Kaydet</kbd>’e tıklayın.
268+
Home--instructions-content2 =
269+
Performans profilleri yalnızca <a>{ -firefox-brand-name }’un masaüstü sürümü</a> ile kaydedilebilir.
270+
Ancak mevcut profiller herhangi bir modern tarayıcıda görüntülenebilir.
268271
Home--record-instructions-start-stop = Profillemeyi durdur ve başlat
269272
Home--record-instructions-capture-load = Profili yakala ve yükle
270273
Home--profiler-motto = Performans profili kaydedin. Analiz edin. Paylaşın. Web’i daha hızlı hale getirin.

src/components/app/BottomBox.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ import {
3030
getSourceViewCode,
3131
getAssemblyViewCode,
3232
} from 'firefox-profiler/selectors/code';
33-
import { getSourceViewFile } from 'firefox-profiler/selectors/profile';
33+
import {
34+
getSourceViewFile,
35+
getSourceViewStartLine,
36+
} from 'firefox-profiler/selectors/profile';
3437
import explicitConnect from 'firefox-profiler/utils/connect';
3538

3639
import type { ConnectedProps } from 'firefox-profiler/utils/connect';
@@ -55,6 +58,7 @@ type StateProps = {
5558
readonly sourceViewScrollGeneration: number;
5659
readonly sourceViewScrollToLineNumber?: number;
5760
readonly sourceViewHighlightedLine: number | null;
61+
readonly sourceViewStartLine: number;
5862
readonly globalLineTimings: LineTimings;
5963
readonly assemblyViewIsOpen: boolean;
6064
readonly assemblyViewNativeSymbol: NativeSymbolInfo | null;
@@ -161,6 +165,7 @@ class BottomBoxImpl extends React.PureComponent<Props> {
161165
sourceViewScrollGeneration,
162166
sourceViewScrollToLineNumber,
163167
sourceViewHighlightedLine,
168+
sourceViewStartLine,
164169
assemblyViewIsOpen,
165170
assemblyViewScrollGeneration,
166171
assemblyViewScrollToInstructionAddress,
@@ -233,6 +238,7 @@ class BottomBoxImpl extends React.PureComponent<Props> {
233238
scrollGeneration={sourceViewScrollGeneration}
234239
scrollToLineNumber={sourceViewScrollToLineNumber}
235240
highlightedLine={sourceViewHighlightedLine}
241+
startLine={sourceViewStartLine}
236242
ref={this._sourceView}
237243
/>
238244
) : null}
@@ -303,6 +309,7 @@ export const BottomBox = explicitConnect<{}, StateProps, DispatchProps>({
303309
sourceViewScrollGeneration: getSourceViewScrollGeneration(state),
304310
sourceViewScrollToLineNumber: getSourceViewScrollToLineNumber(state),
305311
sourceViewHighlightedLine: getSourceViewHighlightedLine(state),
312+
sourceViewStartLine: getSourceViewStartLine(state),
306313
assemblyViewNativeSymbol: getAssemblyViewNativeSymbol(state),
307314
assemblyViewCode: getAssemblyViewCode(state),
308315
globalAddressTimings:

src/components/network-chart/NetworkChartRow.tsx

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -308,18 +308,28 @@ type State = {
308308
pageX: CssPixels;
309309
pageY: CssPixels;
310310
hovered: boolean | null;
311+
clickPageX: CssPixels | null;
312+
clickPageY: CssPixels | null;
311313
};
312314

313315
export class NetworkChartRow extends React.PureComponent<
314316
NetworkChartRowProps,
315317
State
316318
> {
317-
override state = {
319+
override state: State = {
318320
pageX: 0,
319321
pageY: 0,
320322
hovered: false,
323+
clickPageX: null,
324+
clickPageY: null,
321325
};
322326

327+
override componentDidUpdate(prevProps: NetworkChartRowProps) {
328+
if (prevProps.isSelected && !this.props.isSelected) {
329+
this.setState({ clickPageX: null, clickPageY: null });
330+
}
331+
}
332+
323333
_hoverIn = (event: React.MouseEvent<HTMLDivElement>) => {
324334
const pageX = event.pageX;
325335
const pageY = event.pageY;
@@ -348,6 +358,7 @@ export class NetworkChartRow extends React.PureComponent<
348358
_onMouseDown = (e: React.MouseEvent<HTMLDivElement>) => {
349359
const { markerIndex, onLeftClick, onRightClick } = this.props;
350360
if (e.button === 0) {
361+
this.setState({ clickPageX: e.pageX, clickPageY: e.pageY });
351362
if (onLeftClick) {
352363
onLeftClick(markerIndex);
353364
}
@@ -467,6 +478,17 @@ export class NetworkChartRow extends React.PureComponent<
467478
}
468479
);
469480

481+
const clickX = this.state.clickPageX;
482+
const clickY = this.state.clickPageY;
483+
484+
const isSticky = isSelected && clickX !== null && clickY !== null;
485+
const showTooltip =
486+
isSticky || (shouldDisplayTooltips() && this.state.hovered);
487+
488+
// When sticky, use the click coordinates; otherwise use the current mouse position.
489+
const tooltipX = isSticky ? clickX : this.state.pageX;
490+
const tooltipY = isSticky ? clickY : this.state.pageY;
491+
470492
return (
471493
<div
472494
// The className below is responsible for the blue hover effect
@@ -488,19 +510,19 @@ export class NetworkChartRow extends React.PureComponent<
488510
width={width}
489511
timeRange={timeRange}
490512
/>
491-
{shouldDisplayTooltips() && this.state.hovered ? (
492-
// This magic value "5" avoids the tooltip of being too close of the
493-
// row, especially when we mouseEnter the row from the top edge.
494-
<Tooltip mouseX={this.state.pageX} mouseY={this.state.pageY + 5}>
513+
{showTooltip ? (
514+
<Tooltip
515+
mouseX={tooltipX}
516+
mouseY={tooltipY}
517+
className={isSticky ? 'clickable' : undefined}
518+
>
495519
<TooltipMarker
496520
className="tooltipNetwork"
497521
markerIndex={markerIndex}
498522
marker={marker}
499523
threadsKey={this.props.threadsKey}
500524
restrictHeightWidth={true}
501-
// Network Chart doesn't have sticky tooltips yet. But we should convert it
502-
// to false once we implement sticky tooltips for the network chart.
503-
hideFilterButton={true}
525+
hideFilterButton={false}
504526
/>
505527
</Tooltip>
506528
) : null}

src/components/network-chart/index.tsx

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ class NetworkChartImpl extends React.PureComponent<Props> {
9797
override componentDidMount() {
9898
this.focus();
9999
this.scrollSelectionIntoView();
100+
document.addEventListener('contextmenu', this._onContextMenu, true);
101+
}
102+
103+
override componentWillUnmount() {
104+
document.removeEventListener('contextmenu', this._onContextMenu, true);
100105
}
101106

102107
override componentDidUpdate(prevProps: Props) {
@@ -143,6 +148,13 @@ class NetworkChartImpl extends React.PureComponent<Props> {
143148
};
144149

145150
_onKeyDown = (event: React.KeyboardEvent<HTMLElement>) => {
151+
if (event.key === 'Escape') {
152+
event.stopPropagation();
153+
event.preventDefault();
154+
this._onSelectionChange(null, { source: 'keyboard' });
155+
return;
156+
}
157+
146158
const hasModifier = event.ctrlKey || event.altKey;
147159
const isNavigationKey =
148160
event.key.startsWith('Arrow') ||
@@ -226,21 +238,33 @@ class NetworkChartImpl extends React.PureComponent<Props> {
226238
}
227239
};
228240

241+
_onContextMenu = () => {
242+
if (this.props.selectedNetworkMarkerIndex !== null) {
243+
this._onSelectionChange(null, { source: 'pointer' });
244+
}
245+
};
246+
229247
_onRightClick = (selectedNetworkMarkerIndex: MarkerIndex) => {
230248
const { threadsKey, changeRightClickedMarker } = this.props;
231249
changeRightClickedMarker(threadsKey, selectedNetworkMarkerIndex);
232250
};
233251

234252
_onLeftClick = (selectedNetworkMarkerIndex: MarkerIndex) => {
235-
this._onSelectionChange(selectedNetworkMarkerIndex, { source: 'pointer' });
253+
if (this.props.selectedNetworkMarkerIndex === selectedNetworkMarkerIndex) {
254+
this._onSelectionChange(null, { source: 'pointer' });
255+
} else {
256+
this._onSelectionChange(selectedNetworkMarkerIndex, {
257+
source: 'pointer',
258+
});
259+
}
236260
};
237261

238262
_selectWithKeyboard(selectedNetworkMarkerIndex: MarkerIndex) {
239263
this._onSelectionChange(selectedNetworkMarkerIndex, { source: 'keyboard' });
240264
}
241265

242266
_onSelectionChange = (
243-
selectedNetworkMarkerIndex: MarkerIndex,
267+
selectedNetworkMarkerIndex: MarkerIndex | null,
244268
context: SelectionContext
245269
) => {
246270
const { threadsKey, changeSelectedNetworkMarker } = this.props;
@@ -292,7 +316,9 @@ class NetworkChartImpl extends React.PureComponent<Props> {
292316
this.props.changeMouseTimePosition(null);
293317
};
294318

295-
_shouldDisplayTooltips = () => this.props.rightClickedMarkerIndex === null;
319+
_shouldDisplayTooltips = () =>
320+
this.props.rightClickedMarkerIndex === null &&
321+
this.props.selectedNetworkMarkerIndex === null;
296322

297323
_renderRow = (markerIndex: MarkerIndex, index: number): React.ReactNode => {
298324
const {

0 commit comments

Comments
 (0)