Skip to content

Add suggested prompts to contextual sheet - #9349

Open
joshliebe wants to merge 24 commits into
developfrom
feature/josh/contextual-suggestions
Open

Add suggested prompts to contextual sheet#9349
joshliebe wants to merge 24 commits into
developfrom
feature/josh/contextual-suggestions

Conversation

@joshliebe

@joshliebe joshliebe commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Task/Issue URL: https://app.asana.com/1/137249556945/project/72649045549333/task/1217024500235994?focus=true
Tech Design URL (if applicable): https://app.asana.com/1/137249556945/project/481882893211075/task/1216117537545343?focus=true
API Proposals URL(s) (if applicable):

Description

  • Adds suggested prompts to the contextual sheet

Steps to test this PR

Fresh install from this branch

Movie

E-commerce

Paper

Recipe

New chat

  • Submit a suggestion
  • Start a new chat from the overflow
  • Verify related suggestions displayed

Navigation

  • Navigate between two different sites (e.g. IMDB listing -> BBC recipe)
  • Verify that the suggestions are updated accordingly

Loading indicator

  • This one’s a bit hard to test but open contextual before a site has fully loaded
  • Verify that the loading indicator is visible before the suggestions are shown

Automatically Send Page Context

  • Enable "Automatically Send Page Context” in AI Features
  • Verify that only the suggestions are shown when context is attached

Disable feature

UI changes

Context unattached

Before After
Screenshot_20260730_211139 Screenshot_20260730_211340

Context attached

Before After
Screenshot_20260730_211535 Screenshot_20260730_211357

No suggestions (context unattached)

Before After
Screenshot_20260730_211938 Screenshot_20260730_211938

No suggestions (context attached)

Before After
Screenshot_20260730_211930 Screenshot_20260730_211930

Note

Low Risk
UI and local catalog matching only; prompt submission reuses existing contextual send/context paths with broad test coverage. No auth or network contract changes beyond advertising supportsSuggestions to the web layer.

Overview
Adds context-aware suggested prompts on the contextual Duck.ai input surface, gated by a new contextualSuggestedPrompts feature toggle (defaults internal).

A bundled PageSuggestionsCatalog.json drives labels, prompts, and icons; ContextualSuggestionsMatcher picks candidates from JSON-LD type, Open Graph type, hostname, and defaults (e.g. translate when page language differs from UI). The provider drops the standalone summarize-page catalog entry so summarize is not duplicated when suggestions are shown.

New ContextualSuggestionsView (loading dots, scrollable chips) loads on INPUT sheet mode, refreshes when page context updates, and clears in WEBVIEW mode. Tapping a suggestion attaches page context when needed and submits the prompt (preserving any typed draft). The summarize quick-action chip is hidden when suggestions are visible and summarize would overlap; an Ask about page quick action reserves one slot in the suggestion budget.

The contextual prompts area is wrapped in a NestedScrollView. supportsSuggestions is added to the AI chat native JS config when contextual mode and the toggle are on. New chat half-expansion re-requests page context so suggestions can refresh.

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

joshliebe commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@joshliebe joshliebe mentioned this pull request Jul 30, 2026
6 tasks
private fun uiLanguageSubtag(uiLocale: String): String {
return localeFrom(uiLocale).language.lowercase()
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it expected that for a different locale we only show the translate prompt? We never translate the suggested prompts?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I will translate the suggested prompts in a follow-up PR

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

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 0a77549. Configure here.

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