Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI Chat debug improvement #3894

Merged
merged 4 commits into from
Jan 31, 2025
Merged

AI Chat debug improvement #3894

merged 4 commits into from
Jan 31, 2025

Conversation

Bunn
Copy link
Contributor

@Bunn Bunn commented Jan 29, 2025

Task/Issue URL: https://app.asana.com/0/1204167627774280/1209263437216309/f

Description:
Bypass delegate logic from AIChatWebViewController in case we have a custom host settings in the debug UI.
This was done to allow FE devs to use custom hosts while debugging without having to use Xcode

Steps to test this PR:

  1. There are no behavior change for normal users.
  2. Make sure you’re set as internal
  3. Search something, then tap in the AI Chat button
  4. From the AI Chat view, tap on the top right setting button then Help Pages. The View should be dismissed and the help pages opened in a tab
  5. Go to settings -> Debug -> AI Chat -> Type anything in the host field
  6. Do the same step as # 4, this time nothing should happen. No page is loaded because inside AI Chat every link goes to _blank, you can validate this by adding this in the decide policy method:
if navigationAction.targetFrame == nil {
            webView.load(navigationAction.request)
            return .cancel
        }

  1. Go back to the AI Chat debug menu, reset the data, and try again. It should do the same as step # 4

Definition of Done (Internal Only):

@@ -1566,7 +1565,6 @@
311BD1AE2836BB4200AEF6C1 /* AutofillItemsLockedView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutofillItemsLockedView.swift; sourceTree = "<group>"; };
311BD1B02836C0CA00AEF6C1 /* AutofillLoginListAuthenticator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutofillLoginListAuthenticator.swift; sourceTree = "<group>"; };
31206F6F2D3804E800A95D76 /* AIChatDebugView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AIChatDebugView.swift; sourceTree = "<group>"; };
31206F712D38071000A95D76 /* AIChatDebugSettingsHandling.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AIChatDebugSettingsHandling.swift; sourceTree = "<group>"; };
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File moved to the AI Chat package.

@Bunn Bunn requested a review from jotaemepereira January 30, 2025 14:26
Copy link
Contributor

@jotaemepereira jotaemepereira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected, and great job adding the AIChatRequestAuthorizationHandlerTests tests 👏🏼

@Bunn Bunn merged commit a9a71fb into main Jan 31, 2025
13 checks passed
@Bunn Bunn deleted the bunn/aichat/debug-improvement branch January 31, 2025 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants