-
Notifications
You must be signed in to change notification settings - Fork 895
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]: Add TabInformer so the front end can be aware of open tabs #27187
base: master
Are you sure you want to change the base?
Conversation
3c9fb51
to
e0cf838
Compare
e0cf838
to
f608a76
Compare
f608a76
to
0f90227
Compare
A Storybook has been deployed to preview UI for the latest push |
c008c69
to
9b8e446
Compare
9b8e446
to
b9a30e6
Compare
b9a30e6
to
dc18601
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work - much nicer than how I achieved similar!
namespace ai_chat { | ||
|
||
inline constexpr char kBraveSearchURLPrefix[] = "search"; | ||
|
||
inline constexpr auto kAllowedContentSchemes = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved from ai_chat_service.cc
's kAllowedSchemes
so shouldn't need security review
} | ||
|
||
IN_PROC_BROWSER_TEST_F(TabInformerBrowserTest, MultipleWindows) { | ||
AppendTab("https://topos.nz"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😉
1591976
to
7b8e660
Compare
[puLL-Merge] - brave/brave-core@27187 DescriptionThis PR introduces a new feature for the AI Chat functionality in Brave browser. It adds a TabInformer class that tracks and provides information about open tabs and windows. This information can be used to associate tabs with AI chat conversations, allowing for more context-aware interactions. ChangesChanges
sequenceDiagram
participant UI as AI Chat UI
participant TabInformer
participant AIChatService
participant ConversationHandler
UI->>TabInformer: AddListener
TabInformer-->>UI: TabsChanged (initial state)
UI->>AIChatService: AssociateContent
AIChatService->>ConversationHandler: SetAssociatedContentDelegate
TabInformer-->>UI: TabsChanged (on tab updates)
UI->>AIChatService: AssociateContent (for new/changed tabs)
|
7b8e660
to
46b8978
Compare
46b8978
to
e397518
Compare
Resolves brave/brave-browser#43221
Meta Issue (with more detail): brave/brave-browser#42711
This PR is the first part of a series for adding support for associating a tab with a full page chat. It implements a mojo service for getting information about the currently active tabs/windows. This PR does not make any frontend changes
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
N/A - no user visible changes from this PR