Skip to content

Commit 776b065

Browse files
committed
add launch id to termination screen
1 parent cbb8c83 commit 776b065

4 files changed

Lines changed: 48 additions & 6 deletions

File tree

front_end/panels/rn_welcome/RNWelcome.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import type * as Common from '../../core/common/common.js';
77
import * as UI from '../../ui/legacy/legacy.js';
88
import * as Host from '../../core/host/host.js';
99
import * as i18n from '../../core/i18n/i18n.js';
10+
import * as Root from '../../core/root/root.js';
1011
import * as SDK from '../../core/sdk/sdk.js';
1112

1213
import rnWelcomeStyles from './rnWelcome.css.js';
@@ -25,6 +26,8 @@ const UIStrings = {
2526
docsLabel: 'Debugging docs',
2627
/** @description "What's new" link */
2728
whatsNewLabel: "What's new",
29+
/** @description Description for sharing the session ID of the current session with the user */
30+
sessionIdMessage: "[FB-only] The session ID for this React Native DevTools lauch is: ",
2831
/** @description "Debugging Basics" title (docs item 1) */
2932
docsDebuggingBasics: 'Debugging Basics',
3033
/** @description "Debugging Basics" item detail */
@@ -132,6 +135,8 @@ export class RNWelcomeImpl extends UI.Widget.VBox implements
132135
import.meta.url,
133136
).toString();
134137

138+
const launchId = Root.Runtime.Runtime.queryParam('launchId');
139+
135140
render(html`
136141
<div class="rn-welcome-panel">
137142
<header class="rn-welcome-hero">
@@ -162,6 +167,13 @@ export class RNWelcomeImpl extends UI.Widget.VBox implements
162167
${i18nString(UIStrings.whatsNewLabel)}
163168
</x-link>
164169
</div>
170+
${launchId ? html`
171+
<div class="rn-session-id">
172+
${i18nString(UIStrings.sessionIdMessage)}
173+
<br/>
174+
${launchId}
175+
</div>
176+
` : ''}
165177
${this.#reactNativeVersion !== null && this.#reactNativeVersion !== undefined ? html`
166178
<p class="rn-welcome-version">React Native: <code>${this.#reactNativeVersion}</code></p>
167179
` : null}

front_end/panels/rn_welcome/rnWelcome.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@
101101
border-right: 1px solid var(--color-details-hairline);
102102
}
103103

104+
.rn-session-id {
105+
display: flex;
106+
align-items: center;
107+
margin-top: 24px;
108+
user-select: all;
109+
}
110+
104111
.rn-welcome-version {
105112
position: fixed;
106113
top: 8px;

front_end/ui/legacy/RemoteDebuggingTerminatedScreen.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import * as Host from '../../core/host/host.js';
66
import * as i18n from '../../core/i18n/i18n.js';
7+
import * as Root from '../../core/root/root.js';
78
import type * as Platform from '../../core/platform/platform.js';
89
import * as LitHtml from '../../ui/lit-html/lit-html.js';
910

@@ -50,6 +51,11 @@ const UIStrings = {
5051
* @description Text in a dialog box to prompt for feedback if the disconnection is unexpected.
5152
*/
5253
sendFeedbackMessage: '[FB-only] Please send feedback if this disconnection is unexpected.',
54+
/**
55+
* @description Text in a dialog box to prompt for feedback if the disconnection is unexpected,
56+
* telling the user what's their session ID for easier debugging
57+
*/
58+
sendFeedbackLaunchIdMessage: 'Please include the following session ID:',
5359
/**
5460
* @description Label of the FB-only 'send feedback' button.
5561
*/
@@ -76,8 +82,10 @@ export class RemoteDebuggingTerminatedScreen extends VBox {
7682
<h1 class="remote-debugging-terminated-title">${i18nString(UIStrings.title)}</h1>
7783
<div class="remote-debugging-terminated-message">
7884
<span>${i18nString(UIStrings.debuggingConnectionWasClosed)}</span>
85+
<br/>
7986
<span class="remote-debugging-terminated-reason">${reason}</span>
8087
</div>
88+
${feedbackLink !== null && feedbackLink !== undefined ? this.#createFeedbackSection(feedbackLink) : null}
8189
<div class="remote-debugging-terminated-options">
8290
<div class="remote-debugging-terminated-label">
8391
${i18nString(UIStrings.reconnectWhenReadyByReopening)}
@@ -95,7 +103,6 @@ export class RemoteDebuggingTerminatedScreen extends VBox {
95103
jslogContext: 'dismiss',
96104
})}
97105
</div>
98-
${feedbackLink !== null && feedbackLink !== undefined ? this.#createFeedbackSection(feedbackLink) : null}
99106
`,
100107
this.contentElement,
101108
{host: this},
@@ -121,9 +128,22 @@ export class RemoteDebuggingTerminatedScreen extends VBox {
121128
);
122129
};
123130

131+
const launchId = Root.Runtime.Runtime.queryParam('launchId');
132+
124133
return html`
125134
<div class="remote-debugging-terminated-feedback-container">
126135
<div class="remote-debugging-terminated-feedback-label">${i18nString(UIStrings.sendFeedbackMessage)}</div>
136+
${launchId ?
137+
html`
138+
<div class="remote-debugging-terminated-feedback-label">
139+
${i18nString(UIStrings.sendFeedbackLaunchIdMessage)}
140+
</div>
141+
<div class="remote-debugging-terminated-feedback-launch-id">
142+
${launchId}
143+
</div>
144+
` : ''
145+
}
146+
<br/>
127147
${
128148
createTextButton(
129149
i18nString(UIStrings.sendFeedback),

front_end/ui/legacy/remoteDebuggingTerminatedScreen.css

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
.widget {
88
padding: 20px;
9+
user-select: all;
910
}
1011

1112
.remote-debugging-terminated-title {
@@ -17,7 +18,7 @@
1718
.remote-debugging-terminated-message {
1819
font-size: 14px;
1920
margin: 5px 0;
20-
margin-bottom: 24px;
21+
margin-bottom: 16px;
2122
}
2223

2324
.remote-debugging-terminated-options {
@@ -26,7 +27,6 @@
2627
grid-gap: 8px;
2728
align-items: center;
2829
padding-top: 12px;
29-
border-top: 1px solid var(--color-details-hairline-light);
3030
}
3131

3232
.remote-debugging-terminated-label {
@@ -45,7 +45,6 @@
4545
display: flex;
4646
flex-direction: column;
4747
align-items: center;
48-
margin-top: 16px;
4948
padding: 12px 16px;
5049
background-color: var(--color-background-elevation-1);
5150
border-radius: 6px;
@@ -56,9 +55,13 @@
5655
margin-bottom: 8px;
5756
}
5857

59-
.remote-debugging-terminated-reason {
60-
--override-reason-color: #8b0000;
58+
.remote-debugging-terminated-feedback-launch-id {
59+
color: red;
60+
}
6161

62+
.remote-debugging-terminated-reason {
63+
--override-reason-color: red;
64+
line-height: 32px;
6265
color: var(--override-reason-color);
6366
}
6467

0 commit comments

Comments
 (0)