Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Uno.Sdk": "6.5.33"
},
"sdk": {
"version": "10.0.202",
"version": "10.0.103",
"rollForward": "latestPatch",
"allowPrerelease": false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,31 @@ namespace SalmonEgg.Presentation.Core.ViewModels.Chat.Overlay;

internal sealed class ChatConversationSurfaceProjectionCoordinator
{
private bool _hasLoadedActiveConversationRoot;
private bool _hasLoadedTranscriptSurface;

public ChatConversationSurfaceProjection Project(ChatConversationSurfaceStateInput input)
{
var state = ChatConversationSurfaceStatePresenter.Resolve(input);

if (state.ShouldShowActiveConversationRoot)
{
_hasLoadedActiveConversationRoot = true;
}

if (state.ShouldShowTranscriptSurface)
{
_hasLoadedTranscriptSurface = true;
}

return new ChatConversationSurfaceProjection(
state.IsActivationOverlayVisible,
state.IsOverlayVisible,
state.ShouldShowActiveConversationRoot,
state.ShouldShowActiveConversationRoot,
_hasLoadedActiveConversationRoot,
state.ShouldShowSessionHeader,
state.ShouldShowTranscriptSurface,
state.ShouldShowTranscriptSurface,
_hasLoadedTranscriptSurface,
state.ShouldShowConversationInputSurface,
state.ShouldShowBlockingLoadingMask,
state.ShouldShowLoadingOverlayStatusPill,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10155,10 +10155,10 @@ await fixture.UpdateStateAsync(state => state with
runtimeState.IsSessionActivationInProgress = true;

Assert.False(fixture.ViewModel.ShouldShowActiveConversationRoot);
Assert.False(fixture.ViewModel.ShouldLoadActiveConversationRoot);
Assert.True(fixture.ViewModel.ShouldLoadActiveConversationRoot);
Assert.False(fixture.ViewModel.ShouldShowSessionHeader);
Assert.False(fixture.ViewModel.ShouldShowTranscriptSurface);
Assert.False(fixture.ViewModel.ShouldLoadTranscriptSurface);
Assert.True(fixture.ViewModel.ShouldLoadTranscriptSurface);
Assert.False(fixture.ViewModel.ShouldShowConversationInputSurface);
Assert.Equal(SessionNamePolicy.CreateDefault("conv-1"), fixture.ViewModel.CurrentSessionDisplayName);
Assert.Equal(string.Empty, fixture.ViewModel.PresentedSessionHeaderDisplayName);
Expand Down Expand Up @@ -11215,10 +11215,10 @@ await fixture.DispatchConnectionAsync(new SetNewSessionDraftAction(new NewSessio
syncContext.RunAll();

Assert.False(fixture.ViewModel.ShouldShowActiveConversationRoot);
Assert.False(fixture.ViewModel.ShouldLoadActiveConversationRoot);
Assert.True(fixture.ViewModel.ShouldLoadActiveConversationRoot);
Assert.False(fixture.ViewModel.ShouldShowSessionHeader);
Assert.False(fixture.ViewModel.ShouldShowTranscriptSurface);
Assert.False(fixture.ViewModel.ShouldLoadTranscriptSurface);
Assert.True(fixture.ViewModel.ShouldLoadTranscriptSurface);
Assert.False(fixture.ViewModel.ShouldShowConversationInputSurface);

var switchTask = fixture.ViewModel.SwitchConversationAsync("conv-2");
Expand All @@ -11235,10 +11235,10 @@ await fixture.DispatchConnectionAsync(new SetNewSessionDraftAction(new NewSessio
syncContext.RunAll();

Assert.False(fixture.ViewModel.ShouldShowActiveConversationRoot);
Assert.False(fixture.ViewModel.ShouldLoadActiveConversationRoot);
Assert.True(fixture.ViewModel.ShouldLoadActiveConversationRoot);
Assert.False(fixture.ViewModel.ShouldShowSessionHeader);
Assert.False(fixture.ViewModel.ShouldShowTranscriptSurface);
Assert.False(fixture.ViewModel.ShouldLoadTranscriptSurface);
Assert.True(fixture.ViewModel.ShouldLoadTranscriptSurface);
Assert.False(fixture.ViewModel.ShouldShowConversationInputSurface);
Assert.Equal("conv-2", runtimeState.DesiredSessionId);
Assert.True(runtimeState.IsSessionActivationInProgress);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void Project_WhenActiveConversationRootWasShown_KeepsLoadStateWhenLaterHi
Assert.True(visible.ShouldShowActiveConversationRoot);
Assert.True(visible.ShouldLoadActiveConversationRoot);
Assert.False(hidden.ShouldShowActiveConversationRoot);
Assert.False(hidden.ShouldLoadActiveConversationRoot);
Assert.True(hidden.ShouldLoadActiveConversationRoot);
}

[Fact]
Expand Down Expand Up @@ -97,6 +97,6 @@ public void Project_WhenTranscriptSurfaceWasShown_KeepsLoadStateWhenLaterHidden(
Assert.True(visible.ShouldShowTranscriptSurface);
Assert.True(visible.ShouldLoadTranscriptSurface);
Assert.False(hidden.ShouldShowTranscriptSurface);
Assert.False(hidden.ShouldLoadTranscriptSurface);
Assert.True(hidden.ShouldLoadTranscriptSurface);
}
}
Loading