Skip to content

Commit 7d3b734

Browse files
authored
Add 0.83 "What's new" highlight to welcome panel (#226)
1 parent e1dd7af commit 7d3b734

File tree

5 files changed

+40
-1
lines changed

5 files changed

+40
-1
lines changed

config/gni/devtools_grd_files.gni

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ grd_files_release_sources = [
237237
"front_end/Images/psychiatry.svg",
238238
"front_end/Images/react_native/learn-debugging-basics.jpg",
239239
"front_end/Images/react_native/learn-native-debugging.jpg",
240+
"front_end/Images/react_native/whats-new-083.jpg",
240241
"front_end/Images/react_native/learn-react-native-devtools.jpg",
241242
"front_end/Images/react_native/welcomeIcon.png",
242243
"front_end/Images/record-start.svg",

config/gni/devtools_image_files.gni

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ devtools_image_files = [
1818
"popoverArrows.png",
1919
"react_native/learn-debugging-basics.jpg",
2020
"react_native/learn-native-debugging.jpg",
21+
"react_native/whats-new-083.jpg",
2122
"react_native/learn-react-native-devtools.jpg",
2223
"react_native/welcomeIcon.png",
2324
"toolbarResizerVertical.png",
87.1 KB
Loading

front_end/panels/rn_welcome/RNWelcome.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const UIStrings = {
2727
/** @description "What's new" link */
2828
whatsNewLabel: 'What\'s new',
2929
/** @description Description for sharing the session ID of the current session with the user */
30-
sessionIdMessage: '[FB-only] The ID for this React Native DevTools session is:',
30+
sessionIdMessage: '[FB-only] React Native DevTools session ID:',
3131
/** @description "Debugging Basics" title (docs item 1) */
3232
docsDebuggingBasics: 'Debugging Basics',
3333
/** @description "Debugging Basics" item detail */
@@ -40,6 +40,10 @@ const UIStrings = {
4040
docsNativeDebugging: 'Native Debugging',
4141
/** @description "Native Debugging" item detail */
4242
docsNativeDebuggingDetail: 'Find out more about native debugging tools',
43+
/** @description Title for the "What's New" highlighted item */
44+
whatsNewHighlightTitle: 'React Native 0.83 - Performance & Network debugging, improved desktop experience',
45+
/** @description Detail for the "What's New" highlighted item */
46+
whatsNewHighlightDetail: 'Learn about the latest debugging features in 0.83',
4347
} as const;
4448

4549
const str_ = i18n.i18n.registerUIStrings('panels/rn_welcome/RNWelcome.ts', UIStrings);
@@ -127,6 +131,10 @@ export class RNWelcomeImpl extends UI.Widget.VBox implements
127131
'../../Images/react_native/welcomeIcon.png',
128132
import.meta.url,
129133
).toString();
134+
const whatsNewImageUrl = new URL(
135+
'../../Images/react_native/whats-new-083.jpg',
136+
import.meta.url,
137+
).toString();
130138
const docsImage1Url = new URL(
131139
'../../Images/react_native/learn-debugging-basics.jpg',
132140
import.meta.url,
@@ -188,6 +196,16 @@ export class RNWelcomeImpl extends UI.Widget.VBox implements
188196
</header>
189197
${showDocs ? html`
190198
<section class="rn-welcome-docsfeed">
199+
<div class="rn-welcome-docsfeed-highlight">
200+
<h2 class="rn-welcome-h2">What's new</h2>
201+
<button class="rn-welcome-docsfeed-item" type="button" role="link" @click=${this.#handleLinkPress.bind(this, 'https:\/\/reactnative.dev/blog')} title=${i18nString(UIStrings.docsDebuggingBasics)}>
202+
<div class="rn-welcome-image" style="background-image: url('${whatsNewImageUrl}')"></div>
203+
<div>
204+
<p class="devtools-link">${i18nString(UIStrings.whatsNewHighlightTitle)}</p>
205+
<p>${i18nString(UIStrings.whatsNewHighlightDetail)}</p>
206+
</div>
207+
</button>
208+
</div>
191209
<h2 class="rn-welcome-h2">Learn</h2>
192210
<button class="rn-welcome-docsfeed-item" type="button" role="link" @click=${this.#handleLinkPress.bind(this, 'https:\/\/reactnative.dev/docs/debugging')} title=${i18nString(UIStrings.docsDebuggingBasics)}>
193211
<div class="rn-welcome-image" style="background-image: url('${docsImage1Url}')"></div>

front_end/panels/rn_welcome/rnWelcome.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
background: var(--sys-color-surface2);
112112
color: var(--color-text-secondary);
113113
font-size: 11px;
114+
z-index: 10;
114115
}
115116

116117
.rn-welcome-docsfeed {
@@ -135,6 +136,24 @@
135136
}
136137
}
137138

139+
.rn-welcome-docsfeed-highlight {
140+
display: flex;
141+
justify-content: stretch;
142+
flex-direction: column;
143+
position: relative;
144+
overflow: hidden;
145+
margin: 8px -16px;
146+
margin-top: 16px;
147+
padding: 4px 16px;
148+
border-radius: 16px;
149+
flex-shrink: 0;
150+
background: linear-gradient(
151+
135deg,
152+
color-mix(in srgb, var(--sys-color-blue-bright), transparent 92%) 0%,
153+
color-mix(in srgb, var(--sys-color-purple-bright), transparent 88%) 100%
154+
);
155+
}
156+
138157
.rn-welcome-h2 {
139158
flex-shrink: 0;
140159
font-size: 16px;

0 commit comments

Comments
 (0)