feat(chat-overlay): selection highlight + default size + starting backdrop

- Source.IsDraggable now includes ChatBox and WebSource (was Image-only)
- ChatBox default: 400×1080, top-right corner (1520, 0) on first add
- SeedStartingBackdrop: embeds starting-backdrop.jpg as Background source
  in the Starting scene on first launch (pack:// resource)
This commit is contained in:
2026-08-19 13:01:35 -07:00
parent 70be14e957
commit 6a74147611
4 changed files with 40 additions and 2 deletions
+38 -1
View File
@@ -1351,8 +1351,11 @@ public class MainViewModel : ViewModelBase
Scenes.Add(scene);
if (Scenes.Count == 0)
{
foreach (var name in SceneCatalog.All)
AddScene(name);
SeedStartingBackdrop();
}
// The live backdrop belongs to Live only; a pre-policy DB may have
// backdrops lingering in other scenes — drop them, then
@@ -1733,6 +1736,32 @@ public class MainViewModel : ViewModelBase
ActiveScene = scene;
}
private void SeedStartingBackdrop()
{
try
{
var uri = new Uri("pack://application:,,,/Assets/starting-backdrop.jpg", UriKind.Absolute);
using var stream = Application.GetResourceStream(uri)?.Stream;
if (stream == null) return;
using var ms = new MemoryStream();
stream.CopyTo(ms);
var bytes = ms.ToArray();
var assetId = AddAsset(bytes);
if (assetId == null) return;
var starting = Scenes.FirstOrDefault(s => SceneCatalog.Is(s.Name, "Starting"));
if (starting == null) return;
starting.Elements.Add(new Source
{
Name = "Background",
Type = SourceType.Background,
AssetId = assetId,
Width = 1920,
Height = 1080,
});
}
catch { /* non-critical — stream works fine without a default bg */ }
}
private void BeginEditElement(SceneElement? element)
{
if (element == null) return;
@@ -1790,7 +1819,15 @@ public class MainViewModel : ViewModelBase
return;
}
scene.Elements.Add(new Source { Name = NextSourceName(scene, baseName), Type = sourceType });
scene.Elements.Add(new Source
{
Name = NextSourceName(scene, baseName),
Type = sourceType,
X = sourceType == SourceType.ChatBox ? 1520 : 0,
Y = 0,
Width = sourceType == SourceType.ChatBox ? 400 : 0,
Height = sourceType == SourceType.ChatBox ? 1080 : 0,
});
OnPropertyChanged(nameof(ShowEmptySceneHint));
OnPropertyChanged(nameof(ShowSourcesEmptyHint));
UpdateActiveBackground();