Skip to content

Commit

Permalink
Merge pull request #10 from serenadeai/2.0.2
Browse files Browse the repository at this point in the history
2.0.2 Release
  • Loading branch information
MattWiethoff authored Jul 23, 2022
2 parents 7caf2e4 + 51a9403 commit 6d16a1a
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ then
exit 1
fi

changed=$(git diff --cached --name-only --diff-filter=ACMR "*.java" "*.ts" "*.css")
changed=$(git diff --cached --name-only --diff-filter=ACMR | grep -P "\.(java|ts|css)$")
for f in ${changed[@]} ; do
echo "Formatting $f..."
prettier --write "$f" &>/dev/null
git add "$f"
done

changed=$(git diff --cached --name-only --diff-filter=ACMR "*.py")
changed=$(git diff --cached --name-only --diff-filter=ACMR | grep -P "\.py$")
for f in ${changed[@]} ; do
echo "Formatting $f..."
black -l 100 "$f" &>/dev/null
Expand Down
4 changes: 2 additions & 2 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Serenade",
"productName": "Serenade",
"version": "2.0.1",
"version": "2.0.2",
"author": "Serenade Labs, Inc. <[email protected]>",
"description": "Code with voice. Learn more at https://serenade.ai",
"license": "MIT",
Expand Down
8 changes: 8 additions & 0 deletions client/src/main/ipc/local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,13 @@ export default class Local {
this.started = true;
this.killAll();
this.pollUntilRunning();

let speechEngineModels = path.join(__dirname, "..", "static", "local", "speech-engine-models");
this.log.logVerbose("Initial speech engine model path: " + speechEngineModels);

let codeEngineModels = path.join(__dirname, "..", "static", "local", "code-engine-models");
this.log.logVerbose("Initial code engine model path: " + codeEngineModels);

if (os.platform() == "win32") {
speechEngineModels =
"/" +
Expand All @@ -140,6 +145,8 @@ export default class Local {
])
.stdout.toString()
.trim();
this.log.logVerbose("WSL speech engine path: " + speechEngineModels);

codeEngineModels =
"/" +
child_process
Expand All @@ -150,6 +157,7 @@ export default class Local {
])
.stdout.toString()
.trim();
this.log.logVerbose("WSL code engine path: " + codeEngineModels);
}

// here and below: WSL doesn't deal well with paths, so set the cwd to be the same as the binary
Expand Down
20 changes: 15 additions & 5 deletions client/src/main/ipc/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ export default class IPCServer {
if (request.message == "active") {
let icon = request.data.icon;

const iconValid = (
const iconValid =
icon == undefined ||
(typeof icon == 'string' && icon.startsWith('data:') && icon.length <= maximumIconLength)
);
(typeof icon == "string" &&
icon.startsWith("data:") &&
icon.length <= maximumIconLength);

if (!iconValid) {
this.log.logVerbose('Plugin provided an app icon that does not adhere to requirements');
this.log.logVerbose("Plugin provided an app icon that does not adhere to requirements");
icon = undefined;
}

Expand All @@ -48,7 +49,7 @@ export default class IPCServer {
request.data.id,
request.data.app,
request.data.match,
icon,
icon
);
} else if (request.message == "callback") {
this.pluginManager.resolve(request.data.callback, request.data.data);
Expand All @@ -59,6 +60,15 @@ export default class IPCServer {
}
// custom commands messages from custom commands servers
if (request.message == "customCommands") {
this.log.logVerbose(
"Received " +
request.data.commands.length +
" commands, " +
request.data.hints.length +
" hints, " +
request.data.words.length +
" words"
);
this.active.customCommands = request.data.commands;
this.active.customHints = request.data.hints;
this.active.customWords = request.data.words;
Expand Down
6 changes: 1 addition & 5 deletions client/src/main/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,11 +357,7 @@ export default class Settings {
}

getUseAccessibilityApi(): string[] {
return this.get(
"user",
"use_accessibility_api",
os.platform() == "darwin" ? ["slack", "discord", "textedit"] : []
);
return this.get("user", "use_accessibility_api", []);
}

getUseMiniModeHideTimeout(): boolean {
Expand Down
2 changes: 1 addition & 1 deletion client/src/shared/metadata.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as os from "os";

export default class Metadata {
version = "2.0.1";
version = "2.0.2";

identifier(application: string, language: any): string {
return JSON.stringify({
Expand Down
15 changes: 0 additions & 15 deletions core/src/main/java/core/visitor/CommandsVisitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -706,21 +706,6 @@ public CompletableFuture<List<CommandsResponseAlternativeWithMetadata>> visitArr
.build()
);

// in a plugin-supported editor, we can make undo + use commands work with system presses by
// prefixing the response with the current editor state so that the previous source + cursor
// is restored when one of these commands is selected
if (context.state.getPluginInstalled()) {
commands.add(
0,
Command
.newBuilder()
.setType(CommandType.COMMAND_TYPE_DIFF)
.setSource(context.state.getSource())
.setCursor(context.state.getCursor())
.build()
);
}

return wrap(context, commands);
}

Expand Down
6 changes: 3 additions & 3 deletions web/src/components/docs/shared/getting-started.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export const Installation: React.FC = () => (
</p>
<p>
Serenade can be configured to use cloud-based speech recognition or local speech recognition.
To change this setting, just head to Settings > Server. Regardless of your setting, you can
also opt into sharing your data with Serenade in order to help improve Serenade's
speech-to-code machine learning models.
To change this setting, just head to Settings > Server. If you're using Windows, the local server requires
WSL with Ubuntu. Regardless of your setting, you can also opt into sharing your data with Serenade
in order to help improve Serenade's speech-to-code machine learning models.
</p>
</>
);
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/download.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Hero } from "../components/hero";
import { Main } from "../components/pages";
import { FullWidthFeature, TwoColumnFeature } from "../components/features";

const currentVersion = "2.0.1";
const currentVersion = "2.0.2";
const legacyVersion = "";
const betaVersion = "";

Expand Down

0 comments on commit 6d16a1a

Please sign in to comment.