Skip to content

Commit 3c075e3

Browse files
authored
Merge pull request #6 from managedcode/codex/settings-runtime-honesty
Make settings runtime state honest
2 parents 6cd3eb8 + 82ffc81 commit 3c075e3

35 files changed

+2136
-1576
lines changed

src/PrompterOne.Core/Media/Models/MediaSceneState.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public sealed record MediaSourceTransform(
66
double Width = 0.32,
77
double Height = 0.32,
88
double Rotation = 0,
9-
bool MirrorHorizontal = true,
9+
bool MirrorHorizontal = false,
1010
bool MirrorVertical = false,
1111
bool Visible = true,
1212
bool IncludeInOutput = true,

src/PrompterOne.Core/Workspace/Models/StudioSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public sealed record CameraStudioSettings(
3737
string? DefaultCameraId = null,
3838
CameraResolutionPreset Resolution = CameraResolutionPreset.FullHd1080,
3939
CameraFrameRatePreset FrameRate = CameraFrameRatePreset.Fps30,
40-
bool MirrorCamera = true,
40+
bool MirrorCamera = false,
4141
bool AutoStartOnRead = true);
4242

4343
public sealed record MicrophoneStudioSettings(

src/PrompterOne.Shared/AppShell/Services/PrompterOneServiceCollectionExtensions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using PrompterOne.Core.Services.Workspace;
1313
using PrompterOne.Shared.Services.Diagnostics;
1414
using PrompterOne.Shared.Services.Editor;
15+
using PrompterOne.Shared.Settings.Services;
1516
using PrompterOne.Shared.Storage;
1617
using PrompterOne.Shared.Storage.Cloud;
1718

@@ -59,7 +60,9 @@ public static IServiceCollection AddPrompterOneShared(this IServiceCollection se
5960
services.AddScoped<BrowserSettingsStore>();
6061
services.AddScoped<IUserSettingsStore>(serviceProvider => serviceProvider.GetRequiredService<BrowserSettingsStore>());
6162
services.AddScoped<IBrowserSettingsChangeNotifier>(serviceProvider => serviceProvider.GetRequiredService<BrowserSettingsStore>());
63+
services.AddScoped<AiProviderSettingsStore>();
6264
services.AddScoped<BrowserCloudStorageStore>();
65+
services.AddScoped<BrowserFileStorageStore>();
6366
services.AddScoped<BrowserThemeService>();
6467
services.AddScoped<CloudStorageProviderFactory>();
6568
services.AddScoped<CloudStorageTransferService>();

src/PrompterOne.Shared/Contracts/UiDomIds.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ public static class Settings
2121
{
2222
public const string CameraPreviewVideo = "settings-camera-preview-video";
2323
public const string MicrophoneLevelMonitor = "settings-microphone-level-monitor";
24+
25+
public static string MicrophoneLevelMonitorForDevice(string deviceId) =>
26+
$"{MicrophoneLevelMonitor}-{deviceId}";
2427
}
2528

2629
public static class GoLive

src/PrompterOne.Shared/Contracts/UiTestIds.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,12 @@ public static class Settings
297297

298298
public static string AiProvider(string providerId) => $"settings-ai-provider-{providerId}";
299299

300+
public static string AiProviderClear(string providerId) => $"settings-ai-provider-{providerId}-clear";
301+
302+
public static string AiProviderMessage(string providerId) => $"settings-ai-provider-{providerId}-message";
303+
304+
public static string AiProviderSave(string providerId) => $"settings-ai-provider-{providerId}-save";
305+
300306
public static string CameraDevice(string deviceId) => $"settings-camera-device-{deviceId}";
301307

302308
public static string CameraDeviceAction(string deviceId) => $"settings-camera-device-action-{deviceId}";
@@ -462,6 +468,8 @@ public static class GoLive
462468
public static string ProviderCard(string providerId) => $"go-live-provider-{providerId}";
463469
public static string ProviderSourcePicker(string providerId) => $"go-live-provider-sources-{providerId}";
464470
public static string ProviderSourceSummary(string providerId) => $"go-live-provider-source-summary-{providerId}";
471+
public static string RuntimeMetric(string metricId) => $"go-live-runtime-metric-{metricId}";
472+
public static string StatusMetric(string metricId) => $"go-live-status-metric-{metricId}";
465473
public static string ProviderSourceToggle(string providerId, string sourceId) => $"go-live-provider-source-{providerId}-{sourceId}";
466474

467475
public static string SourceCamera(string sourceId) => $"go-live-source-camera-{sourceId}";
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
@namespace PrompterOne.Shared.Components.Settings
2+
3+
<SettingsExpandableCard Title="@Title"
4+
Subtitle="@Subtitle"
5+
StatusLabel="@StatusLabel"
6+
StatusClass="@StatusClass"
7+
IconStyle="@IconStyle"
8+
AdditionalCssClass="@AdditionalCssClass"
9+
IsOpen="@IsOpen"
10+
OnToggle="@OnToggle"
11+
TestId="@TestId">
12+
<Icon>
13+
@if (Icon is not null)
14+
{
15+
@Icon
16+
}
17+
</Icon>
18+
19+
<ChildContent>
20+
@if (ChildContent is not null)
21+
{
22+
@ChildContent
23+
}
24+
25+
<div class="set-path-field" style="margin-top:12px">
26+
<button class="set-btn-golden set-btn-sm"
27+
type="button"
28+
data-testid="@SaveTestId"
29+
@onclick="Save"
30+
@onclick:stopPropagation="true">
31+
Save locally
32+
</button>
33+
<button class="set-btn-outline set-btn-sm"
34+
type="button"
35+
data-testid="@ClearTestId"
36+
@onclick="Clear"
37+
@onclick:stopPropagation="true">
38+
Clear
39+
</button>
40+
</div>
41+
42+
@if (!string.IsNullOrWhiteSpace(Message))
43+
{
44+
<p class="set-card-copy"
45+
data-testid="@MessageTestId">
46+
@Message
47+
</p>
48+
}
49+
</ChildContent>
50+
</SettingsExpandableCard>
51+
52+
@code {
53+
[Parameter] public string AdditionalCssClass { get; set; } = string.Empty;
54+
55+
[Parameter] public RenderFragment? ChildContent { get; set; }
56+
57+
[Parameter] public EventCallback Clear { get; set; }
58+
59+
[Parameter] public string ClearTestId { get; set; } = string.Empty;
60+
61+
[Parameter] public RenderFragment? Icon { get; set; }
62+
63+
[Parameter] public string IconStyle { get; set; } = string.Empty;
64+
65+
[Parameter] public bool IsOpen { get; set; }
66+
67+
[Parameter] public string Message { get; set; } = string.Empty;
68+
69+
[Parameter] public string MessageTestId { get; set; } = string.Empty;
70+
71+
[Parameter] public EventCallback OnToggle { get; set; }
72+
73+
[Parameter] public EventCallback Save { get; set; }
74+
75+
[Parameter] public string SaveTestId { get; set; } = string.Empty;
76+
77+
[Parameter] public string StatusClass { get; set; } = string.Empty;
78+
79+
[Parameter] public string StatusLabel { get; set; } = string.Empty;
80+
81+
[Parameter] public string Subtitle { get; set; } = string.Empty;
82+
83+
[Parameter] public string TestId { get; set; } = string.Empty;
84+
85+
[Parameter] public string Title { get; set; } = string.Empty;
86+
}

0 commit comments

Comments
 (0)