Conversation
ab1470
left a comment
There was a problem hiding this comment.
btw sorry for hitting the "request changes" but I think I need to either do that or "Approve" for SLO purposes
| case .formWillAppear: | ||
| let payload = try? container.decode(FormWillAppearPayload.self, forKey: .data) | ||
| self = .formWillAppear(formId: payload?.formId, formName: payload?.formName) | ||
| let decodedData = try container.decode(AnyCodable.self, forKey: .data) |
There was a problem hiding this comment.
still thinking about this and whether there's an alternative to using AnyCodable here, will get back to you but first I'll submit my review so you can look at my other comments
|
to clean up the git history, I created a new feature branch |
… events Combines flyout/flexible form layout support (IAFWindowManager, FormLayout, FormPosition) with form-context propagation through lifecycle events (formId/formName in dismiss and formDisappeared events). Conflict resolutions: - IAFLifecycleEvent: keep withLayout param on present, add formId/formName to dismiss - IAFNativeBridgeEvent: keep formWillAppear(Data) for layout decoding; add formDisappeared(formId:formName:) and FormContextPayload from iaf-flyouts - IAFWebViewModel: keep HEAD layout-decoding path for formWillAppear; adopt case let .formDisappeared(formId, formName) from iaf-flyouts - IAFPresentationManager: thread formId/formName through presentForm and presentFormAsModal; keep InAppWindowManager guard in destroyWebView; adopt effectiveFormId/Name fallback in dismissForm - FormLifecycleHandlerTests: adopt iaf-flyouts tearDown (no handleFormEvent reset needed since context now flows through events) Fix: correct withLayout: label in pattern matches for IAFLifecycleEvent.present in IAFPresentationManager and IAFWebViewModelTests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| self = .formWillAppear(formId: payload?.formId, formName: payload?.formName) | ||
| let decodedData = try container.decode(AnyCodable.self, forKey: .data) | ||
| let data = try JSONEncoder().encode(decodedData) | ||
| self = .formWillAppear(data) |
There was a problem hiding this comment.
formWillAppear decode now throws on missing data
Medium Severity
The formWillAppear decoding changed from try? (graceful fallback) to try (throwing). If the JS bridge sends a formWillAppear event with a missing or null data field, the entire event decode now throws, and the form silently fails to present. Previously it would still create the event with nil values and present a fullscreen form. The sibling formDisappeared case still uses try?, making this inconsistency likely unintentional.
There was a problem hiding this comment.
yeah that's it. I would love to avoid AnyCodable if possible, my PR is a vibe-coded possible solution to doing that
…e handshake test Flexible form presentation was not setting currentFormId/currentFormName, causing dismissForm/destroyWebView to lose form identity on dismiss if the bridge sends nil identifiers. Mirrors the existing modal path behaviour. Also updates the handshake snapshot test to expect formWillAppear v2, matching the version bump already in IAFNativeBridgeEvent.swift. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| let lifecycleTask = Task { | ||
| for await event in viewModel.formLifecycleStream { | ||
| if case let .present(formId, formName) = event { | ||
| if case let .present(formId, formName, withLayout: layout) = event { |
There was a problem hiding this comment.
Test expects old handshake version, will fail
Medium Severity
The testInjectHandshakeAttribute test in IAFWebViewModelTests.swift still expects formWillAppear at version: 1, but the production code in IAFNativeBridgeEvent.version was changed to return 2 for .formWillAppear. The corresponding test in IAFNativeBridgeEventTests.swift was correctly updated to version 2, but this test was missed. This will cause a test failure.
Additional Locations (1)
evan-masseau
left a comment
There was a problem hiding this comment.
Commenting to silence reminders for now, since there's already some pending feedback. Will get back to this once feedback addressed and/or once i've had time to manually test. My read-thru won't be that helpful anyway.


Description
This was the original POC work. The branch was misnamed
feat/flyouts-formsbut will be going into an actual feature branchfeat/iaf-flyoutsDue Diligence
Release/Versioning Considerations
PatchContains internal changes or backwards-compatible bug fixes.MinorContains changes to the public API.MajorContains breaking changes.Changelog / Code Overview
Test Plan
Related Issues/Tickets