Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Release Note #223

Merged
merged 12 commits into from
Feb 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import { SimulatorDebugConfigurationProvider } from "./simulatorDebugConfigurati
import TelemetryAI from "./telemetry/telemetryAI";
import { UsbDetector } from "./usbDetector";
import { VSCODE_MESSAGES_TO_WEBVIEW, WEBVIEW_MESSAGES } from "./view/constants";
import { PopupService } from "./service/PopupService";
import getPackageInfo from "./telemetry/getPackageInfo";
import { registerDefaultFontFaces } from "office-ui-fabric-react";

let currentFileAbsPath: string = "";
Expand Down Expand Up @@ -120,6 +122,18 @@ export async function activate(context: vscode.ExtensionContext) {
}
);

const currVersionReleaseName =
"release_note_" + getPackageInfo(context).extensionVersion;
const viewedReleaseNote = context.globalState.get(
currVersionReleaseName,
false
);

if (!viewedReleaseNote) {
PopupService.openReleaseNote();
context.globalState.update(currVersionReleaseName, true);
}

const openWebview = () => {
if (currentPanel) {
messagingService.setWebview(currentPanel.webview);
Expand Down Expand Up @@ -893,6 +907,22 @@ export async function activate(context: vscode.ExtensionContext) {
}
);

const showReleaseNote = vscode.commands.registerCommand(
"deviceSimulatorExpress.",
(port, showWarning = true) => {
if (serialMonitor) {
telemetryAI.runWithLatencyMeasure(() => {
serialMonitor.closeSerialMonitor(port, showWarning);
}, TelemetryEventName.CPX_COMMAND_SERIAL_MONITOR_CLOSE);
} else {
vscode.window.showErrorMessage(
CONSTANTS.ERROR.NO_FOLDER_OPENED
);
console.info("Serial monitor is not defined.");
}
}
);

UsbDetector.getInstance().initialize(context.extensionPath);
UsbDetector.getInstance().startListening();

Expand Down
63 changes: 63 additions & 0 deletions src/latest_release_note.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// TODO: find a better way of loading html into a string
export const LATEST_RELEASE_NOTE = `<h1>Device Simulator Express Release Notes 👩🏾‍💻 👨🏾‍💻 (Feb. 27, 2020)</h1>
<p>
Welcome to the first update to the Device Simulator Express! <u>Please feel free to enable our feature flag in
Settings
(under the setting titled “<b>deviceSimulatorExpress.previewMode</b>” in the User settings)</u>.
</p>
<h2>Changes</h2>
<p>
<h3>Fixes (enabled by default):</h3>
<ul>
<li>Enabled support for “from adafruit_circuitplayground import cp” as an import statement for the CPX and
changed
“New File” template to use this format.</li>
<ul>
<li>Aligns better with newer online tutorials. Best practice for adafruit_circuitplayground library imports
changed with <a href="https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground/pull/79">this
PR
in Adafruit’s official repo</a>.</li>
</ul>
<li>State for sensor selection persists.</li>
<li>More reliable dependency installation and more informative setup fail information.</li>
<li>Fixes to Serial Monitor for CPX device deployment.</li>
<li>More robust debugger functionality.</li>
<li>Fixed spelling and clarity errors in documentation and pop-up messages.</li>
</ul>
<h3>New features (only available with feature flag enabled):</h3>
<ul>
<li><u>BBC Micro:bit simulator and debugger – <i>open up a new Micro:bit file, write code for the Micro:bit and
test it out!</u></i>
<ul>
<li>Ability to interact with LEDs, buttons, and sensors.</li>
<li>Includes autocompletion and error flagging.</li>
<li>Supports the following:</li>
<ul>
<li>Classes:
<ul>
<li>display</li>
<li>image</li>
<li>accelerometer</li>
<li>button</li>
</ul>
</ul>
<ul>
<li>Global static functions:</li>
<ul>
<li>sleep()</li>
<li>running_time()</li>
<li>temperature()</li>
</ul>
</ul>
</ul>
<ul>
<li>Includes accessibility considerations for simulation.</li>
<ul>
<li>Has ability to use keyboard for button presses and navigation.</li>
</ul>
</ul>
</ul>
</p>

<p><b>Happy Hacking! ✨✨🐍🐍🍰</b><br>
&nbsp&nbsp&nbsp&nbsp&nbsp <b><i>- The Device Simulator Express Team</i></b></p>`;
16 changes: 16 additions & 0 deletions src/service/PopupService.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// import { Webview } from "vscode";
import * as vscode from "vscode";
import { LATEST_RELEASE_NOTE } from "../latest_release_note";

export class PopupService {
public static openReleaseNote() {
const panel = vscode.window.createWebviewPanel(
"releaseNote",
"Release Note",
vscode.ViewColumn.One,
{}
);

panel.webview.html = LATEST_RELEASE_NOTE;
}
}