Skip to content

[iOS] Use ?sidebar=open URL parameter for View All Chats and fix contextual sheet issues#4473

Open
SabrinaTardio wants to merge 5 commits intomainfrom
sabrina/view-all-chats-url-parameter
Open

[iOS] Use ?sidebar=open URL parameter for View All Chats and fix contextual sheet issues#4473
SabrinaTardio wants to merge 5 commits intomainfrom
sabrina/view-all-chats-url-parameter

Conversation

@SabrinaTardio
Copy link
Copy Markdown
Contributor

@SabrinaTardio SabrinaTardio commented Apr 18, 2026

Task/Issue URL: https://app.asana.com/1/137249556945/project/1204186595873227/task/1214118261014133?focus=true
Tech Design URL: N/A
CC: N/A

Description

  • Replace the fragile shouldToggleSidebar JS bridge approach with a ?sidebar=open URL parameter when opening Duck.ai from "View all chats", removing timing dependencies on frontend readiness
  • Remove isFrontendReady, pendingSidebarToggle, and flushPendingActions queuing logic from AIChatContentHandler since the URL parameter eliminates the need to coordinate post-load JS calls
  • Suppress keyboard auto-focus when navigating to Duck.ai with ?sidebar=open so the user sees the chat history instead of the input
  • Fix recent chats popup positioning to respect safe area insets (was clipped behind dynamic island)
  • Fix "Summarize Page" casing to "Summarize page" for sentence case consistency

Testing Steps

  • Open the Duck.ai contextual sheet from the omnibar
  • Tap the list button, then tap "View all chats"
  • Verify Duck.ai opens in a new tab without the keyboard appearing
  • Verify the sidebar/chat history is visible (requires FE ?sidebar=open support in production)
  • Open the recent chats popup and pull the half sheet up and verify it doesn't overlap the dynamic island
  • Verify the "Summarize page" quick action uses sentence case

Impact and Risks

Impact Level: Medium

What could go wrong?

  • The ?sidebar=open parameter depends on frontend support which is currently in staging only; until FE ships to production, the sidebar won't auto-open but the rest of the flow works correctly
  • Removing the isFrontendReady queuing means other callers of submitToggleSidebarAction now call through directly without checking readiness, but all remaining callers operate on already-loaded tabs

Quality Considerations

  • Added AIChatURLParameters.sidebarName/sidebarOpenValue constants and URL.isDuckAISidebarOpen helper to avoid hardcoded strings
  • Safe area clamping for popup uses max() so devices without a dynamic island are unaffected

Notes to Reviewer

  • FE ?sidebar=open support is currently on staging (euw-serp-dev-testing8.duck.ai) only -- tested and confirmed working there. Once FE ships to production, the full flow will work end-to-end.

Note

Medium Risk
Changes navigation/UI behavior around expanding Duck.ai and removes sidebar-toggle coordination code, which could affect how AI tabs refresh and whether the sidebar opens depending on frontend support for ?sidebar=open.

Overview
Switches the “View all chats” expand flow from a JS bridge sidebar toggle to a URL-driven approach by adding ?sidebar=open helpers (AIChatURLParameters.sidebarOpenURL, URL.isDuckAISidebarOpen) and using that URL when opening Duck.ai from the recent chats popup.

Removes the associated frontend-readiness queuing/toggle plumbing (isFrontendReady/pending actions, shouldToggleSidebar delegate plumbing, and tabDidRequestToggleSidebarOnCurrentTab), and updates refresh logic to avoid auto-expanding/keyboard focus when ?sidebar=open is present. Also fixes recent chats popup positioning to respect safe area and tweaks “Summarize Page” to sentence case; tests are updated accordingly.

Reviewed by Cursor Bugbot for commit 074e0f0. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread iOS/DuckDuckGo/AIChat/ContextualMode/AIChatRecentChatsPopupViewController.swift Outdated
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6ddb6b3. Configure here.

Comment thread iOS/DuckDuckGo/TabViewControllerContextualAIChatExtension.swift
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.

1 participant