Fix non-monotonic chat transcript layout-loading lifecycle#53
Fix non-monotonic chat transcript layout-loading lifecycle#53google-labs-jules[bot] wants to merge 2 commits into
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
Closing during PR triage: this is a stale or duplicate layout-loading monotonicity attempt. #49 is the clean green candidate for this behavior; this PR is superseded, failing/conflicting, or mixed-scope and should not be merged as-is. |
Understood. Acknowledging that this work is now obsolete and stopping work on this task. |
Observed Problem
During rapid session switching or connection transitions where an overlay (like
SessionSwitchPreviewor a history hydration mask) is shown over an active conversation, theShouldLoadActiveConversationRootandShouldLoadTranscriptSurfaceproperties were incorrectly evaluated tofalse. This caused the underlying native WinUI/Uno layout nodes bound tox:Loadto be completely destroyed and recreated when the mask hid, resulting in lost scroll positions, unnecessary CPU churn, and a non-monotonic "un-load" step contrary to the UI layout guidelines.Root Cause
In
ChatConversationSurfaceProjectionCoordinator.cs, the output boolean fieldsShouldLoadActiveConversationRootandShouldLoadTranscriptSurfacewere wired directly to their correspondingShouldShow...state properties. This meant any time the transcript visibility becamefalse(e.g., hidden under a blocking mask during hydration), the framework instructed the layout system to destruct the underlying layout nodes.Architectural Safety
This fix implements a monotonic latch. It introduces internal private boolean fields (
_hasLoadedActiveConversationRoot,_hasLoadedTranscriptSurface) to the coordinator state. These boolean flags transition totrueexactly when their correspondingShouldShow...state first becomestrue. Crucially, they are never set back tofalseeven ifShouldShow...reverts tofalse. This complies with Uno/WinUI lifecycle requirements thatx:Loadstates must be monotonic. Visual transitions are now purely dictated by theShouldShow...(visibility) variables without affecting the physical XAML graph. This approach maintains the SSOT for session layout logic inside the Presentation.Core.Verification Commands
dotnet test tests/SalmonEgg.Presentation.Core.Tests/SalmonEgg.Presentation.Core.Tests.csproj --filter ChatConversationSurfaceProjectionCoordinatorTestsdotnet test tests/SalmonEgg.Presentation.Core.Tests/SalmonEgg.Presentation.Core.Tests.csproj --configuration Debug --no-restoreglobal.jsonwas restored after bypassing local CI mismatch.Remaining GUI-Only Risks
The patch was performed purely at the logic (Presentation.Core) level. GUI validations using Playwright/FlaUI tests may need to be run natively on targeted GUI hardware depending on downstream environments to verify no unexpected edge-cases trigger from overlapping XAML native lifecycle controls interacting with the persisted tree.
PR created automatically by Jules for task 17706736036326994045 started by @YoungSx