fix(app): the share dialog shows the whole invitation, not only its subject

The text box was given its text before it was told to take several lines,
and a one-line box keeps only the first line of what it is given. Found by
the UI test for this dialog on its first run.

Refs #163

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
This commit is contained in:
james.maesandClaude Fable 5.2 committed 2026-11-10 19:08:32 -06:00
1 parent 1265d77923
commit 7ca752eab5
1 file changed
+4 -2
+4 -2
View File
@@ -1204,13 +1204,15 @@ public sealed partial class MainWindow : Window
/// <summary>The invitation as text to paste, for when no email program opened it.</summary>
private ContentDialog NewShareDialog(ShareInvitation invitation)
{
// AcceptsReturn before Text: a box that takes one line keeps only the first
// line of what it is given, which here would be the subject and nothing else.
var text = new TextBox
{
Text = invitation.AsPlainText,
IsReadOnly = true,
AcceptsReturn = true,
TextWrapping = TextWrapping.Wrap,
IsReadOnly = true,
MaxHeight = 320,
Text = invitation.AsPlainText,
};
Microsoft.UI.Xaml.Automation.AutomationProperties.SetAutomationId(text, "ShareInvitationText");
Microsoft.UI.Xaml.Automation.AutomationProperties.SetName(text, "Invitation text");