Skip to content

Commit 23d5bea

Browse files
author
Akos Kitta
committed
fix: fine grained progress update messages
Signed-off-by: Akos Kitta <[email protected]>
1 parent 207d1e9 commit 23d5bea

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

arduino-ide-extension/src/browser/contributions/create-contribution.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,29 @@ import { SketchContribution } from './contribution';
1818

1919
export function sketchAlreadyExists(input: string): string {
2020
return nls.localize(
21-
'arduino/cloudSketch/sketchAlreadyExists',
21+
'arduino/cloudSketch/alreadyExists',
2222
"Cloud sketch '{0}' already exists.",
2323
input
2424
);
2525
}
26-
27-
export function notFound(input: string): string {
26+
export function sketchNotFound(input: string): string {
2827
return nls.localize(
2928
'arduino/cloudSketch/notFound',
3029
"Could not pull the cloud sketch '{0}'. It does not exist.",
3130
input
3231
);
3332
}
34-
33+
export const synchronizingSketchbook = nls.localize(
34+
'arduino/cloudSketch/synchronizingSketchbook',
35+
'Synchronizing sketchbook...'
36+
);
3537
export function pullingSketch(input: string): string {
3638
return nls.localize(
3739
'arduino/cloudSketch/pulling',
3840
"Synchronizing sketchbook, pulling '{0}'...",
3941
input
4042
);
4143
}
42-
4344
export function pushingSketch(input: string): string {
4445
return nls.localize(
4546
'arduino/cloudSketch/pushing',
@@ -123,7 +124,7 @@ export abstract class CloudSketchContribution extends SketchContribution {
123124
} catch (err) {
124125
if (isNotFound(err)) {
125126
await treeModel.refresh();
126-
this.messageService.error(notFound(sketch.name));
127+
this.messageService.error(sketchNotFound(sketch.name));
127128
return undefined;
128129
}
129130
throw err;

arduino-ide-extension/src/browser/contributions/rename-cloud-sketch.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
CloudSketchContribution,
1818
pushingSketch,
1919
sketchAlreadyExists,
20+
synchronizingSketchbook,
2021
} from './create-contribution';
2122

2223
export interface RenameCloudSketchParams {
@@ -99,6 +100,7 @@ export class RenameCloudSketch extends CloudSketchContribution {
99100
value: string
100101
): (progress: Progress) => Promise<unknown> {
101102
return async (progress: Progress) => {
103+
const fromName = params.cloudUri.path.name;
102104
const fromPosixPath = params.cloudUri.path.toString();
103105
const toPosixPath = params.cloudUri.parent.resolve(value).path.toString();
104106
let result: Create.Sketch | ConflictError | undefined;
@@ -111,19 +113,16 @@ export class RenameCloudSketch extends CloudSketchContribution {
111113
progress.report({
112114
message: nls.localize(
113115
'arduino/cloudSketch/renaming',
114-
"Renaming cloud sketch '{0}'...",
116+
"Renaming cloud sketch from '{0}' to '{1}'...",
117+
fromName,
115118
value
116119
),
117120
});
118121
await this.createApi.rename(fromPosixPath, toPosixPath);
119122

120123
// sync
121124
progress.report({
122-
message: nls.localize(
123-
'arduino/cloudSketch/renaming',
124-
"Renaming cloud sketch '{0}'...",
125-
value
126-
),
125+
message: synchronizingSketchbook,
127126
});
128127
this.createApi.sketchCache.init(); // invalidate the cache
129128
await this.createApi.sketches(); // IDE2 must pull all sketches to find the new one

i18n/en.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,14 @@
120120
"visitArduinoCloud": "Visit Arduino Cloud to create Cloud Sketches."
121121
},
122122
"cloudSketch": {
123+
"alreadyExists": "Cloud sketch '{0}' already exists.",
123124
"creating": "Creating cloud sketch '{0}'...",
124125
"new": "New Cloud Sketch",
125126
"notFound": "Could not pull the cloud sketch '{0}'. It does not exist.",
126127
"pulling": "Synchronizing sketchbook, pulling '{0}'...",
127128
"pushing": "Synchronizing sketchbook, pushing '{0}'...",
128-
"renaming": "Renaming cloud sketch '{0}'...",
129-
"sketchAlreadyExists": "Cloud sketch '{0}' already exists."
129+
"renaming": "Renaming cloud sketch from '{0}' to '{1}'...",
130+
"synchronizingSketchbook": "Synchronizing sketchbook..."
130131
},
131132
"common": {
132133
"all": "All",

0 commit comments

Comments
 (0)