fix(top bar): a signed-out ON-AIR press starts sign-in instead of disabling the button
Reported: EDIT on + ON-AIR on, signed out → the button reads "Test Stream" and cannot be pressed. Cause: the primary button bound straight to StartTestCommand, whose CanExecute needs a connection. StartSession already routed signed-out ON-AIR to the sign-in flow; the test path bypassed it. The route is now explicit and pure: RouteFor(kind, connected) → SignIn | Record | Live | Test. The primary command calls SignInAsync for the SignIn route, BeginTestStream for Test, StartSession otherwise — so the label, the action and the sign-in fallback cannot drift apart. Pinned in SessionStartDecisionTests for both live and test, connected and not.
This commit is contained in:
@@ -29,6 +29,24 @@ public static class SessionStartDecision
|
||||
return editing ? SessionStartKind.Test : SessionStartKind.Live;
|
||||
}
|
||||
|
||||
/// <summary>What pressing the button actually does, given whether YouTube is connected.
|
||||
/// A signed-out ON-AIR press must start the SIGN-IN flow, not sit there disabled — a dead
|
||||
/// primary button is the dead end the design principle forbids (creator, 2026-10-30).</summary>
|
||||
public enum Route
|
||||
{
|
||||
SignIn,
|
||||
Record,
|
||||
Live,
|
||||
Test,
|
||||
}
|
||||
|
||||
public static Route RouteFor(SessionStartKind kind, bool connected) => kind switch
|
||||
{
|
||||
SessionStartKind.Record => Route.Record,
|
||||
SessionStartKind.Test => connected ? Route.Test : Route.SignIn,
|
||||
_ => connected ? Route.Live : Route.SignIn,
|
||||
};
|
||||
|
||||
public static string LabelFor(SessionStartKind kind) => kind switch
|
||||
{
|
||||
SessionStartKind.Record => "Start Recording",
|
||||
|
||||
Reference in New Issue
Block a user