Skip to content

Commit 82fd6f6

Browse files
author
David Kutugata
authored
remove release notes from the start page (#13032)
1 parent 227a9c5 commit 82fd6f6

File tree

7 files changed

+21
-38
lines changed

7 files changed

+21
-38
lines changed

StartPageReleaseNotes.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

package.nls.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@
528528
"StartPage.pythonFileDescription": "- Create a <div class=\"link\" role=\"button\" onclick={0}>new file</div> with a .py extension",
529529
"StartPage.openInteractiveWindow": "Use the Interactive Window to develop Python Scripts",
530530
"StartPage.interactiveWindowDesc": "- You can create cells on a Python file by typing \"#%%\" <br /> - Use \"<div class=\"italics\">Shift + Enter</div> \" to run a cell, the output will be shown in the interactive window",
531-
"StartPage.releaseNotes": "Take a look at our <a class=\"link\" href={0}>Release Notes</a> to learn more about the latest features",
531+
"StartPage.releaseNotes": "Take a look at our <a class=\"link\" href={0}>Release Notes</a> to learn more about the latest features.",
532532
"StartPage.tutorialAndDoc": "Explore more features in our <a class=\"link\" href={0}>Tutorials</a> or check <a class=\"link\" href={1}>Documentation</a> for tips and troubleshooting.",
533533
"StartPage.dontShowAgain": "Don't show this page again",
534534
"StartPage.helloWorld": "Hello world",

src/client/common/startPage/startPage.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,9 @@ export class StartPage extends WebViewHost<IStartPageMapping> implements IStartP
120120
case StartPageMessages.Started:
121121
this.webviewDidLoad = true;
122122
break;
123-
case StartPageMessages.RequestReleaseNotesAndShowAgainSetting:
123+
case StartPageMessages.RequestShowAgainSetting:
124124
const settings = this.configuration.getSettings();
125-
const filteredNotes = await this.handleReleaseNotesRequest();
126-
await this.postMessage(StartPageMessages.SendReleaseNotes, {
127-
notes: filteredNotes,
125+
await this.postMessage(StartPageMessages.SendSetting, {
128126
showAgainSetting: settings.showStartPage
129127
});
130128
break;
@@ -245,12 +243,6 @@ export class StartPage extends WebViewHost<IStartPageMapping> implements IStartP
245243
return shouldShowStartPage;
246244
}
247245

248-
// This gets the release notes from StartPageReleaseNotes.md
249-
private async handleReleaseNotesRequest(): Promise<string[]> {
250-
const releaseNotes = await this.file.readFile(path.join(EXTENSION_ROOT_DIR, 'StartPageReleaseNotes.md'));
251-
return releaseNotes.splitLines();
252-
}
253-
254246
private async activateBackground(): Promise<void> {
255247
const enabled = await this.expService.inExperiment(EnableStartPage.experiment);
256248
const settings = this.configuration.getSettings();

src/client/common/startPage/types.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,15 @@ export interface IStartPage {
88
extensionVersionChanged(): Promise<boolean>;
99
}
1010

11-
export interface IReleaseNotesPackage {
12-
notes: string[];
11+
export interface ISettingPackage {
1312
showAgainSetting: boolean;
1413
}
1514

1615
export namespace StartPageMessages {
1716
export const Started = SharedMessages.Started;
1817
export const UpdateSettings = SharedMessages.UpdateSettings;
19-
export const RequestReleaseNotesAndShowAgainSetting = 'RequestReleaseNotesAndShowAgainSetting';
20-
export const SendReleaseNotes = 'SendReleaseNotes';
18+
export const RequestShowAgainSetting = 'RequestShowAgainSetting';
19+
export const SendSetting = 'SendSetting';
2120
export const OpenBlankNotebook = 'OpenBlankNotebook';
2221
export const OpenBlankPythonFile = 'OpenBlankPythonFile';
2322
export const OpenInteractiveWindow = 'OpenInteractiveWindow';
@@ -30,8 +29,8 @@ export namespace StartPageMessages {
3029
}
3130

3231
export class IStartPageMapping {
33-
public [StartPageMessages.RequestReleaseNotesAndShowAgainSetting]: IReleaseNotesPackage;
34-
public [StartPageMessages.SendReleaseNotes]: IReleaseNotesPackage;
32+
public [StartPageMessages.RequestShowAgainSetting]: ISettingPackage;
33+
public [StartPageMessages.SendSetting]: ISettingPackage;
3534
public [StartPageMessages.Started]: never | undefined;
3635
public [StartPageMessages.UpdateSettings]: boolean;
3736
public [StartPageMessages.OpenBlankNotebook]: never | undefined;

src/client/common/utils/localize.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ export namespace StartPage {
10621062

10631063
export const releaseNotes = localize(
10641064
'StartPage.releaseNotes',
1065-
'Take a look at our <a class="link" href={0}>Release Notes</a> to learn more about the latest features'
1065+
'Take a look at our <a class="link" href={0}>Release Notes</a> to learn more about the latest features.'
10661066
);
10671067
export const tutorialAndDoc = localize(
10681068
'StartPage.tutorialAndDoc',

src/datascience-ui/startPage/startPage.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@
5353
white-space: nowrap;
5454
}
5555

56+
.releaseNotesRow {
57+
display: block;
58+
min-height: 50px;
59+
white-space: nowrap;
60+
}
61+
5662
.link {
5763
display: inline;
5864
color: var(--vscode-debugIcon-continueForeground);

src/datascience-ui/startPage/startPage.tsx

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import * as React from 'react';
66
import '../../client/common/extensions';
7-
import { IReleaseNotesPackage, IStartPageMapping, StartPageMessages } from '../../client/common/startPage/types';
7+
import { ISettingPackage, IStartPageMapping, StartPageMessages } from '../../client/common/startPage/types';
88
import { Image, ImageName } from '../react-common/image';
99
import { getLocString } from '../react-common/locReactSide';
1010
import { IMessageHandler, PostOffice } from '../react-common/postOffice';
@@ -19,8 +19,7 @@ export interface IStartPageProps {
1919
// Front end of the Python extension start page.
2020
// In general it consists of its render method and methods that send and receive messages.
2121
export class StartPage extends React.Component<IStartPageProps> implements IMessageHandler {
22-
private releaseNotes: IReleaseNotesPackage = {
23-
notes: [],
22+
private releaseNotes: ISettingPackage = {
2423
showAgainSetting: false
2524
};
2625
private postOffice: PostOffice = new PostOffice();
@@ -30,7 +29,7 @@ export class StartPage extends React.Component<IStartPageProps> implements IMess
3029
}
3130

3231
public componentDidMount() {
33-
this.postOffice.sendMessage<IStartPageMapping>(StartPageMessages.RequestReleaseNotesAndShowAgainSetting);
32+
this.postOffice.sendMessage<IStartPageMapping>(StartPageMessages.RequestShowAgainSetting);
3433
}
3534

3635
// tslint:disable: no-any
@@ -129,9 +128,8 @@ export class StartPage extends React.Component<IStartPageProps> implements IMess
129128
{this.renderInteractiveWindowDescription()}
130129
</div>
131130
</div>
132-
<div className="row">
131+
<div className="releaseNotesRow">
133132
{this.renderReleaseNotesLink()}
134-
{this.renderReleaseNotes()}
135133
{this.renderTutorialAndDoc()}
136134
</div>
137135
<div className="block">
@@ -151,8 +149,7 @@ export class StartPage extends React.Component<IStartPageProps> implements IMess
151149

152150
// tslint:disable-next-line: no-any
153151
public handleMessage = (msg: string, payload?: any) => {
154-
if (msg === StartPageMessages.SendReleaseNotes) {
155-
this.releaseNotes.notes = payload.notes;
152+
if (msg === StartPageMessages.SendSetting) {
156153
this.releaseNotes.showAgainSetting = payload.showAgainSetting;
157154
this.setState({});
158155
}
@@ -240,21 +237,13 @@ export class StartPage extends React.Component<IStartPageProps> implements IMess
240237
dangerouslySetInnerHTML={{
241238
__html: getLocString(
242239
'StartPage.releaseNotes',
243-
'Take a look at our <a class="link" href={0}>Release Notes</a> to learn more about the latest features'
240+
'Take a look at our <a class="link" href={0}>Release Notes</a> to learn more about the latest features.'
244241
).format('https://aka.ms/AA8dxtb')
245242
}}
246243
/>
247244
);
248245
}
249246

250-
private renderReleaseNotes(): JSX.Element {
251-
const notes: JSX.Element[] = [];
252-
this.releaseNotes.notes.forEach((rel, index) => {
253-
notes.push(<li key={index}>{rel}</li>);
254-
});
255-
return <ul className="list">{notes}</ul>;
256-
}
257-
258247
private renderTutorialAndDoc(): JSX.Element {
259248
// tslint:disable: react-no-dangerous-html
260249
return (

0 commit comments

Comments
 (0)