Skip to content

Commit 7c78ab0

Browse files
refactor(audience-sample): centralise "Copied!" flash label in SampleAppUi.ButtonText.CopiedFlash
AudienceSample.UI.cs:368 set the click-to-copy flash via inline "Copied!". Distinct from the existing SampleAppUi.ButtonText.Copied ("Copied", no exclamation) used as the persistent button label after copying. Both strings can drift independently today. Adds ButtonText.CopiedFlash with a comment noting the distinction and migrates the inline reference. The two consts now sit next to each other so a future translation pass would catch both. Per the user's "everything random goes in a constant" stance. Follow-up to SDK-272 (centralisation of duplicated literals).
1 parent 9132bc0 commit 7c78ab0

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

examples/audience/Assets/SampleApp/Scripts/AudienceSample.UI.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ private void RegisterHandlers()
365365
if (label.ClassListContains(SampleAppUi.Css.Copied)) return;
366366
if (string.IsNullOrEmpty(label.text) || label.text == SampleAppUi.StatusBar.EmptyText) return;
367367
GUIUtility.systemCopyBuffer = label.text;
368-
label.text = "Copied!";
368+
label.text = SampleAppUi.ButtonText.CopiedFlash;
369369
FlashCopied(label);
370370
});
371371
}

examples/audience/Assets/SampleApp/Scripts/SampleAppUi.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ internal static class ButtonText
160160
internal const string Send = "Send";
161161
internal const string Copy = "Copy";
162162
internal const string Copied = "Copied";
163+
164+
// Click-to-copy flash on status cells (transient label override).
165+
// Distinct from Copied which is the post-click button label.
166+
internal const string CopiedFlash = "Copied!";
163167
}
164168

165169
// ---- Resources paths ----

0 commit comments

Comments
 (0)