Skip to content

Commit 46fa6f4

Browse files
committed
Merged main into live
2 parents 3148c4e + 10dd86f commit 46fa6f4

8 files changed

+326
-342
lines changed

hub/apps/design/input/cortana-deep-link-into-your-app.md

Lines changed: 82 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ keywords: cortana
1111

1212
>[!WARNING]
1313
> This feature is no longer supported as of the Windows 10 May 2020 Update (version 2004, codename "20H1").
14-
>
15-
> See [Cortana in Microsoft 365](/microsoft-365/admin/misc/cortana-integration) for how Cortana is transforming modern productivity experiences.
1614
1715
Provide deep links from a background app in **Cortana** that launch the app to the foreground in a specific state or context.
1816

@@ -72,19 +70,19 @@ Finally, we call the [**ReportSuccessAsync**](/uwp/api/Windows.ApplicationModel.
7270
private async Task SendCompletionMessageForDestination(string destination)
7371
{
7472
...
75-
IEnumerable<Model.Trip> trips = store.Trips.Where(p => p.Destination == destination);
73+
IEnumerable<Model.Trip> trips = store.Trips.Where(p => p.Destination == destination);
7674

77-
var userMessage = new VoiceCommandUserMessage();
78-
var destinationsContentTiles = new List<VoiceCommandContentTile>();
75+
var userMessage = new VoiceCommandUserMessage();
76+
var destinationsContentTiles = new List<VoiceCommandContentTile>();
7977
...
80-
var response = VoiceCommandResponse.CreateResponse(userMessage, destinationsContentTiles);
78+
var response = VoiceCommandResponse.CreateResponse(userMessage, destinationsContentTiles);
8179

82-
if (trips.Count() > 0)
83-
{
84-
response.AppLaunchArgument = destination;
85-
}
80+
if (trips.Count() > 0)
81+
{
82+
response.AppLaunchArgument = destination;
83+
}
8684

87-
await voiceServiceConnection.ReportSuccessAsync(response);
85+
await voiceServiceConnection.ReportSuccessAsync(response);
8886
}
8987
```
9088

@@ -113,80 +111,80 @@ Here, we add two content tiles with different [**AppLaunchArgument**](/uwp/api/W
113111
/// <param name="destination">The destination specified in the voice command.</param>
114112
private async Task SendCompletionMessageForDestination(string destination)
115113
{
116-
// If this operation is expected to take longer than 0.5 seconds, the task must
117-
// supply a progress response to Cortana before starting the operation, and
118-
// updates must be provided at least every 5 seconds.
119-
string loadingTripToDestination = string.Format(
120-
cortanaResourceMap.GetValue("LoadingTripToDestination", cortanaContext).ValueAsString,
121-
destination);
122-
await ShowProgressScreen(loadingTripToDestination);
123-
Model.TripStore store = new Model.TripStore();
124-
await store.LoadTrips();
125-
126-
// Query for the specified trip.
114+
// If this operation is expected to take longer than 0.5 seconds, the task must
115+
// supply a progress response to Cortana before starting the operation, and
116+
// updates must be provided at least every 5 seconds.
117+
string loadingTripToDestination = string.Format(
118+
cortanaResourceMap.GetValue("LoadingTripToDestination", cortanaContext).ValueAsString,
119+
destination);
120+
await ShowProgressScreen(loadingTripToDestination);
121+
Model.TripStore store = new Model.TripStore();
122+
await store.LoadTrips();
123+
124+
// Query for the specified trip.
127125
// The destination should be in the phrase list. However, there might be
128126
// multiple trips to the destination. We pick the first.
129-
IEnumerable<Model.Trip> trips = store.Trips.Where(p => p.Destination == destination);
130-
131-
var userMessage = new VoiceCommandUserMessage();
132-
var destinationsContentTiles = new List<VoiceCommandContentTile>();
133-
if (trips.Count() == 0)
134-
{
135-
string foundNoTripToDestination = string.Format(
136-
cortanaResourceMap.GetValue("FoundNoTripToDestination", cortanaContext).ValueAsString,
137-
destination);
138-
userMessage.DisplayMessage = foundNoTripToDestination;
139-
userMessage.SpokenMessage = foundNoTripToDestination;
140-
}
141-
else
142-
{
143-
// Set plural or singular title.
144-
string message = "";
145-
if (trips.Count() > 1)
146-
{
147-
message = cortanaResourceMap.GetValue("PluralUpcomingTrips", cortanaContext).ValueAsString;
148-
}
149-
else
150-
{
151-
message = cortanaResourceMap.GetValue("SingularUpcomingTrip", cortanaContext).ValueAsString;
152-
}
153-
userMessage.DisplayMessage = message;
154-
userMessage.SpokenMessage = message;
155-
156-
// Define a tile for each destination.
157-
foreach (Model.Trip trip in trips)
158-
{
159-
int i = 1;
160-
161-
var destinationTile = new VoiceCommandContentTile();
162-
163-
destinationTile.ContentTileType = VoiceCommandContentTileType.TitleWith68x68IconAndText;
164-
destinationTile.Image = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///AdventureWorks.VoiceCommands/Images/GreyTile.png"));
165-
166-
destinationTile.AppLaunchArgument = trip.Destination;
167-
destinationTile.Title = trip.Destination;
168-
if (trip.StartDate != null)
169-
{
170-
destinationTile.TextLine1 = trip.StartDate.Value.ToString(dateFormatInfo.LongDatePattern);
171-
}
172-
else
173-
{
174-
destinationTile.TextLine1 = trip.Destination + " " + i;
175-
}
176-
177-
destinationsContentTiles.Add(destinationTile);
178-
i++;
179-
}
180-
}
181-
182-
var response = VoiceCommandResponse.CreateResponse(userMessage, destinationsContentTiles);
183-
184-
if (trips.Count() > 0)
185-
{
186-
response.AppLaunchArgument = destination;
187-
}
188-
189-
await voiceServiceConnection.ReportSuccessAsync(response);
127+
IEnumerable<Model.Trip> trips = store.Trips.Where(p => p.Destination == destination);
128+
129+
var userMessage = new VoiceCommandUserMessage();
130+
var destinationsContentTiles = new List<VoiceCommandContentTile>();
131+
if (trips.Count() == 0)
132+
{
133+
string foundNoTripToDestination = string.Format(
134+
cortanaResourceMap.GetValue("FoundNoTripToDestination", cortanaContext).ValueAsString,
135+
destination);
136+
userMessage.DisplayMessage = foundNoTripToDestination;
137+
userMessage.SpokenMessage = foundNoTripToDestination;
138+
}
139+
else
140+
{
141+
// Set plural or singular title.
142+
string message = "";
143+
if (trips.Count() > 1)
144+
{
145+
message = cortanaResourceMap.GetValue("PluralUpcomingTrips", cortanaContext).ValueAsString;
146+
}
147+
else
148+
{
149+
message = cortanaResourceMap.GetValue("SingularUpcomingTrip", cortanaContext).ValueAsString;
150+
}
151+
userMessage.DisplayMessage = message;
152+
userMessage.SpokenMessage = message;
153+
154+
// Define a tile for each destination.
155+
foreach (Model.Trip trip in trips)
156+
{
157+
int i = 1;
158+
159+
var destinationTile = new VoiceCommandContentTile();
160+
161+
destinationTile.ContentTileType = VoiceCommandContentTileType.TitleWith68x68IconAndText;
162+
destinationTile.Image = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///AdventureWorks.VoiceCommands/Images/GreyTile.png"));
163+
164+
destinationTile.AppLaunchArgument = trip.Destination;
165+
destinationTile.Title = trip.Destination;
166+
if (trip.StartDate != null)
167+
{
168+
destinationTile.TextLine1 = trip.StartDate.Value.ToString(dateFormatInfo.LongDatePattern);
169+
}
170+
else
171+
{
172+
destinationTile.TextLine1 = trip.Destination + " " + i;
173+
}
174+
175+
destinationsContentTiles.Add(destinationTile);
176+
i++;
177+
}
178+
}
179+
180+
var response = VoiceCommandResponse.CreateResponse(userMessage, destinationsContentTiles);
181+
182+
if (trips.Count() > 0)
183+
{
184+
response.AppLaunchArgument = destination;
185+
}
186+
187+
await voiceServiceConnection.ReportSuccessAsync(response);
190188
}
191189
```
192190

@@ -203,7 +201,7 @@ userMessage.SpokenMessage =
203201
"You have one trip to Vegas coming up.";
204202

205203
response = VoiceCommandResponse.CreateResponse(userMessage);
206-
response.AppLaunchArgument = Las Vegas;
204+
response.AppLaunchArgument = "Las Vegas";
207205
await VoiceCommandServiceConnection.RequestAppLaunchAsync(response);
208206
```
209207

hub/apps/design/input/cortana-design-guidelines.md

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@ ms.localizationpriority: medium
1414

1515
>[!WARNING]
1616
> This feature is no longer supported as of the Windows 10 May 2020 Update (version 2004, codename "20H1").
17-
>
18-
> See [Cortana in Microsoft 365](/microsoft-365/admin/misc/cortana-integration) for how Cortana is transforming modern productivity experiences.
1917
2018
These guidelines and recommendations describe how your app can best use **Cortana** to interact with the user, help them accomplish a task, and communicate clearly how it's all happening.
2119

22-
**Cortana** enables applications running in the background to prompt the user for confirmation or disambiguation, and in return provide the user with feedback on the status of the voice command. The process is lightweight, quick, and doesnt force the user to leave the **Cortana** experience or switch context to the application.
20+
**Cortana** enables applications running in the background to prompt the user for confirmation or disambiguation, and in return provide the user with feedback on the status of the voice command. The process is lightweight, quick, and doesn't force the user to leave the **Cortana** experience or switch context to the application.
2321

2422
While the user should feel that **Cortana** is helping to make the process as light and easy as possible, you probably want **Cortana** to also be explicit that it's your app accomplishing the task.
2523

@@ -62,8 +60,8 @@ Successful **Cortana** interactions require you to follow some fundamental princ
6260
<dd><p>Provide information pertinent only to the task, content, and context.</p>
6361
</dd>
6462
</dl></td>
65-
<td align="left"><p>Ive added this to your playlist. Just so you know, your battery is getting low.</p></td>
66-
<td align="left"><p>Ive added this to your playlist.</p></td>
63+
<td align="left"><p>I've added this to your playlist. Just so you know, your battery is getting low.</p></td>
64+
<td align="left"><p>I've added this to your playlist.</p></td>
6765
</tr>
6866
<tr class="odd">
6967
<td align="left"><p></p>
@@ -73,33 +71,33 @@ Successful **Cortana** interactions require you to follow some fundamental princ
7371
</dd>
7472
</dl></td>
7573
<td align="left"><p>No results for query &quot;Trips to Las Vegas&quot;.</p></td>
76-
<td align="left"><p>I couldnt find any trips to Las Vegas.</p></td>
74+
<td align="left"><p>I couldn't find any trips to Las Vegas.</p></td>
7775
</tr>
7876
<tr class="even">
7977
<td align="left"><p></p>
8078
<dl>
8179
<dt>Trustworthy </dt>
82-
<dd><p>Be as accurate as possible. Be transparent about whats going on in the background—if a task hasnt finished yet, dont say that it has. Respect privacy—dont read private information out loud.</p>
80+
<dd><p>Be as accurate as possible. Be transparent about what's going on in the background—if a task hasn't finished yet, don't say that it has. Respect privacy—don't read private information out loud.</p>
8381
</dd>
8482
</dl></td>
85-
<td align="left"><p>I couldnt find that movie, it must not have been released yet.</p></td>
86-
<td align="left"><p>I couldnt find that movie in our catalogue.</p></td>
83+
<td align="left"><p>I couldn't find that movie, it must not have been released yet.</p></td>
84+
<td align="left"><p>I couldn't find that movie in our catalogue.</p></td>
8785
</tr>
8886
</tbody>
8987
</table>
9088

91-
Write how people speak. Dont emphasize grammatical accuracy over sounding natural. For example, ear-friendly verbal shortcuts like "wanna" or "gotta" are fine for TTS read out.
89+
Write how people speak. Don't emphasize grammatical accuracy over sounding natural. For example, ear-friendly verbal shortcuts like "wanna" or "gotta" are fine for TTS read out.
9290

9391
Use the implied first-person tense where possible and natural. For example, "Looking for your next Adventure Works trip" implies that someone is doing the looking, but does not use the word "I" to specify.
9492

95-
Use some variation to help make your app sound more natural. Provide different versions of your TTS and GUI strings to effectively say the same thing. For example, "What movie do you wanna see?" could have alternatives like "What movie would you like to watch?". People dont say the same thing the exact same way every time. Just make sure to keep your TTS and GUI versions in sync.
93+
Use some variation to help make your app sound more natural. Provide different versions of your TTS and GUI strings to effectively say the same thing. For example, "What movie do you wanna see?" could have alternatives like "What movie would you like to watch?". People don't say the same thing the exact same way every time. Just make sure to keep your TTS and GUI versions in sync.
9694

9795
Use phrases like "OK" and "Alright" in your responses judiciously. While they can provide acknowledgment and a sense of progress, they can also get repetitive if used too often and without variation.
9896

9997
> [!NOTE]
10098
> Use acknowledgment phrases in TTS only. Due to the limited space on the **Cortana** canvas, don't repeat them in the corresponding GUI strings.
10199
102-
Use contractions in your responses for more natural interactions and additional space saving on the **Cortana** canvas. For example," I cant find that movie" instead of "I was unable to find that movie". Write for the ear, not the eye.
100+
Use contractions in your responses for more natural interactions and additional space saving on the **Cortana** canvas. For example," I can't find that movie" instead of "I was unable to find that movie". Write for the ear, not the eye.
103101

104102
Use language that the system understands. Users tend to repeat the terms they are presented with. Know what you display.
105103

@@ -166,7 +164,7 @@ Here are the steps outlined in this image:
166164
1. The user taps the microphone to initiate **Cortana**.
167165
2. The user says "Cancel my Adventure Works trip to Vegas" to launch the **Adventure Works** app in the background. The app uses both **Cortana** speech and canvas to interact with the user.
168166
3. **Cortana** transitions to a handoff screen that gives the user acknowledgment feedback ("I'll get Adventure Works on that."), a status bar, and a cancel button.
169-
4. In this case, the user has multiple trips that match the query, so the app provides a disambiguation screen that lists all the matching results and asks, Which one do you wanna cancel?
167+
4. In this case, the user has multiple trips that match the query, so the app provides a disambiguation screen that lists all the matching results and asks, "Which one do you wanna cancel?"
170168
5. The user specifies the "Vegas Tech Conference" item.
171169
6. As the cancellation cannot be undone, the app provides a confirmation screen that asks the user to confirm their intent.
172170
7. The user says "Yes".
@@ -192,11 +190,11 @@ Use present tense.
192190

193191
Use an action verb that confirms what task is initiating and reference the specific entity.
194192

195-
Use a generic verb that doesn't commit to the requested, incomplete action. For example, "Looking for your trip" instead of "Canceling your trip". In this case, if no results are returned the user doesn't hear something like "Cancelling your trip to Las Vegas… I couldnt find a trip to Las Vegas".
193+
Use a generic verb that doesn't commit to the requested, incomplete action. For example, "Looking for your trip" instead of "Canceling your trip". In this case, if no results are returned the user doesn't hear something like "Cancelling your trip to Las Vegas… I couldn't find a trip to Las Vegas".
196194

197-
Be clear that the task hasnt already taken place if the app still needs to resolve the entity requested. For example, notice how we say Looking for your trip instead of Cancelling your trip because zero or more trips can be matched, and we dont know the result yet.
195+
Be clear that the task hasn't already taken place if the app still needs to resolve the entity requested. For example, notice how we say "Looking for your trip" instead of "Cancelling your trip" because zero or more trips can be matched, and we don't know the result yet.
198196

199-
The GUI and TTS strings can be the same, but dont need to be. Try to keep the GUI string short to avoid truncation and duplication of other visual assets.
197+
The GUI and TTS strings can be the same, but don't need to be. Try to keep the GUI string short to avoid truncation and duplication of other visual assets.
200198

201199
| TTS | GUI |
202200
| --- | --- |
@@ -207,7 +205,7 @@ The GUI and TTS strings can be the same, but don’t need to be. Try to keep the
207205

208206
:::image type="content" source="images/cortana/e2e-canceltrip-progress.png" alt-text="Screenshot of the Cortana canvas for end to end Cortana background app flow using AdventureWorks cancel trip progress":::*AdventureWorks "Cancel trip" progress*
209207

210-
When a task takes a while between steps, your app needs to step in and update the user on whats happening on a progress screen. The app icon is displayed, and you must provide both GUI and TTS progress strings to indicate that the task is underway.
208+
When a task takes a while between steps, your app needs to step in and update the user on what's happening on a progress screen. The app icon is displayed, and you must provide both GUI and TTS progress strings to indicate that the task is underway.
211209

212210
You should provide a link to your app with launch parameters to start the app in the appropriate state. This lets the user view or complete the task themselves. **Cortana** provides the link text (such as, "Go to Adventure Works").
213211

@@ -240,7 +238,7 @@ Use an action verb that confirms the task is underway.
240238

241239
:::image type="content" source="images/cortana/e2e-canceltrip-confirmation.png" alt-text="Screenshot of the Cortana canvas for end to end Cortana background app flow using AdventureWorks cancel trip confirmation":::*AdventureWorks "Cancel trip" confirmation*
242240

243-
Some tasks can be implicitly confirmed by the nature of the users command; others are potentially more sensitive and require explicit confirmation. Here are some guidelines for when to use explicit vs. implicit confirmation.
241+
Some tasks can be implicitly confirmed by the nature of the user's command; others are potentially more sensitive and require explicit confirmation. Here are some guidelines for when to use explicit vs. implicit confirmation.
244242

245243
Both GUI and TTS strings on the confirmation screen are specified by your app, and the app icon, if provided, is shown instead of the **Cortana** avatar.
246244

@@ -249,14 +247,14 @@ After the customer responds to the confirmation, your application must provide t
249247
Use explicit when...
250248

251249
- Content is leaving the user (such as, a text message, email, or social post)
252-
- An action cant be undone (such as, making a purchase or deleting something)
250+
- An action can't be undone (such as, making a purchase or deleting something)
253251
- The result could be embarrassing (such as, calling the wrong person)
254252
- More complex recognition is required (such as, open-ended transcription)
255253

256254
Use implicit when...
257255

258256
- Content is saved for the user only (such as, a note-to-self)
259-
- Theres an easy way to back out (such as, turning an alarm on or off)
257+
- There's an easy way to back out (such as, turning an alarm on or off)
260258
- The task needs to be quick (such as, quickly capturing an idea before forgetting)
261259
- Accuracy is high (such as, a simple menu)
262260

@@ -332,8 +330,8 @@ If the entity is shown, or it has been referenced on prior turn, only reference
332330

333331
| Conditions | TTS | GUI |
334332
|--------------------------------------------------|-------------------------------------------------|------------------------------------|
335-
| ENTITY SHOWN / ENTITY READ ON PRIOR TURN | Ive cancelled this trip. | Cancelled this trip. |
336-
| ENTITY NOT SHOWN / ENTITY NOT READ ON PRIOR TURN | Ive cancelled your Vegas Tech Conference trip. | Cancelled "Vegas Tech Conference." |
333+
| ENTITY SHOWN / ENTITY READ ON PRIOR TURN | I've cancelled this trip. | Cancelled this trip. |
334+
| ENTITY NOT SHOWN / ENTITY NOT READ ON PRIOR TURN | I've cancelled your Vegas Tech Conference trip. | Cancelled "Vegas Tech Conference." |
337335

338336
### Error
339337

0 commit comments

Comments
 (0)