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

Adding Yep Chat in Taktak #1

Draft
wants to merge 33 commits into
base: tt/develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
e8c7aff
Implement empty chat side panel toggle
nyinyithann Oct 20, 2024
6a8c6bf
Add side panel and web UI integration for chat functionality. Side pa…
nyinyithann Oct 20, 2024
c800168
Move chat related files into side_panel folder
nyinyithann Oct 21, 2024
a6431a7
Observe active tab info and pump it to WebUI for using chat context
nyinyithann Oct 22, 2024
c4a22e8
Add chat icon and replace icon of browser_app_menu_button
nyinyithann Oct 23, 2024
b74b89a
make all toolbar button highlighted with rounded corner and modify th…
nyinyithann Oct 23, 2024
bafa6f9
Update chat.mojom for conversation - WIP
nyinyithann Oct 25, 2024
5fe6be2
Change side_panel chat folder name
nyinyithann Oct 28, 2024
2175718
Add string values used in the chat feature into the translation file …
nyinyithann Oct 28, 2024
46f55f1
Display menu item list - WIP
nyinyithann Oct 29, 2024
8ce8725
Handling chat completion API - WIP
nyinyithann Nov 3, 2024
c5baa00
Implement completion api request (parsing stream data and pumping the…
nyinyithann Nov 4, 2024
c11d5e2
Implement demo chat UI
nyinyithann Nov 4, 2024
205c961
Show action menu in chat panel when the current page includes content…
nyinyithann Nov 7, 2024
04e6cf8
Add content extractor IDL - WIP
nyinyithann Nov 8, 2024
6e0a86e
Add content extractor - works for most of the sites (WIP - refactorin…
nyinyithann Nov 12, 2024
5bffa22
Refactor content extraction - use DVLOG
nyinyithann Nov 13, 2024
06dc0eb
Refactor content extraction - extraction called in page handler (Mojo…
nyinyithann Nov 14, 2024
cf7ec77
Extract content from the active page for summarization and display re…
nyinyithann Nov 15, 2024
ceba18e
Removed start-up page app
nyinyithann Nov 18, 2024
ea48bdb
Observe tab change to provide chat context
nyinyithann Nov 19, 2024
caadcb3
Fix issues in observing chat context
nyinyithann Nov 20, 2024
d9179b3
Display completion result in Chat UI - WIP
nyinyithann Nov 20, 2024
03d8a38
Display conversations in Chat UI - WIP
nyinyithann Nov 22, 2024
22c7b8b
Get latest site info when chat UI is shown
nyinyithann Nov 26, 2024
7f58480
Refactor content extraction
nyinyithann Nov 26, 2024
9c43341
Remove ChatContextObserver and related code
nyinyithann Nov 26, 2024
fec3cf0
Enhance chat actions with specific prompts
nyinyithann Nov 26, 2024
49c6c0c
Limit chat content length to 32768 tokens.
nyinyithann Nov 26, 2024
73f43bb
Add dynamic color change handling to ChatUI - WIP
nyinyithann Nov 28, 2024
3b0447e
Register chat ui to color change handler
nyinyithann Nov 28, 2024
69bf09b
Refactor chat panel layout and styling
nyinyithann Nov 29, 2024
2eda1c2
Add site info as context in prompt display in chat panel UI
nyinyithann Nov 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions chrome/app/chrome_command_ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@
#define IDC_SHOW_GOOGLE_LENS_SHORTCUT 40282
#define IDC_SHOW_CUSTOMIZE_CHROME_SIDE_PANEL 40283
#define IDC_SHOW_CUSTOMIZE_CHROME_TOOLBAR 40284
#define IDC_SHOW_AI_CHAT 40999

// Spell-check
// Insert any additional suggestions before _LAST; these have to be consecutive.
Expand Down
30 changes: 30 additions & 0 deletions chrome/app/generated_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -8965,6 +8965,36 @@ Keep your key file in a safe place. You will need it to create new versions of y
</message>
</if>

<!-- AI Chat button -->
<if expr="use_titlecase">
<message name="IDS_AI_CHAT_TITLE" desc="Title of the AI Chat">
Chat
</message>
</if>
<if expr="not use_titlecase">
<message name="IDS_AI_CHAT_TITLE" desc="Title of the AI Chat">
Chat
</message>
</if>
<message name="IDS_CHAT_SUMMARIZE_THIS_PAGE" desc="Label of the button in Chat to summarize the current page.">
Summarize this page
</message>
<message name="IDS_CHAT_EXPLAIN_IT_IN_SIMPLE_LANGUAGE" desc="Label of the button in Chat to explain the current page's content in simple language.">
Explain it in simple language
</message>
<message name="IDS_CHAT_TRANSLATE" desc="Label of the button in Chat to translate the current page's content.">
Translate...
</message>
<message name="IDS_CHAT_DRAFT_A_SOCIAL_MEDIA_POST" desc="Label of the button in Chat to draft a social media post of the current page's content.">
Draft a social media post...
</message>
<message name="IDS_CHAT_DRAFT_FACT_CHECT" desc="Label of the button in Chat to fact-check the current page's content.">
Fact check
</message>
<message name="IDS_CHAT_ASK_ANYTHING" desc="Use in the chat prompt input box.">
Ask anything...
</message>

<!-- Side panel strings -->
<message name="IDS_ACCNAME_SIDE_PANEL_RESIZE" is_accessibility_with_no_ui="true" desc="Screen reader announcement when the side panel resize handle is focused.">
Side Panel Resize Handle
Expand Down
2 changes: 2 additions & 0 deletions chrome/app/vector_icons/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ aggregate_vector_icons("chrome_vector_icons") {
"browser_tools_update.icon",
"browser_tools_update_chrome_refresh.icon",
"cast_chrome_refresh.icon",
"chat.icon",
"chevron_right.icon",
"chevron_right_chrome_refresh.icon",
"chromium_minimize.icon",
Expand Down Expand Up @@ -119,6 +120,7 @@ aggregate_vector_icons("chrome_vector_icons") {
"menu_book_chrome_refresh.icon",
"mixed_content.icon",
"more_tools_menu.icon",
"more_horiz.icon",
"move_group_to_new_window_refresh.icon",
"my_location.icon",
"name_window.icon",
Expand Down
13 changes: 13 additions & 0 deletions chrome/app/vector_icons/chat.icon
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CANVAS_DIMENSIONS, 18,
FILL_RULE_NONZERO,
MOVE_TO, 0, 8.33f,
CUBIC_TO, 4.5f, 8.33f, 8.33f, 4.5f, 8.33f, 0,
H_LINE_TO, 9.67f,
CUBIC_TO, 9.67f, 4.5f, 13.5f, 8.33f, 18, 8.33f,
V_LINE_TO, 9.67f,
CUBIC_TO, 13.5f, 9.67f, 9.67f, 13.5f, 9.67f, 18,
H_LINE_TO, 8.33f,
CUBIC_TO, 8.33f, 13.5f, 4.5f, 9.67f, 0, 9.67f,
V_LINE_TO, 8.33f,
CLOSE,
NEW_PATH
32 changes: 32 additions & 0 deletions chrome/app/vector_icons/more_horiz.icon
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
CANVAS_DIMENSIONS, 20,
FILL_RULE_NONZERO,
MOVE_TO, 5.5f, 11.5f,
CUBIC_TO, 5.08f, 11.5f, 4.73f, 11.35f, 4.44f, 11.06f,
CUBIC_TO, 4.15f, 10.76f, 4, 10.41f, 4, 10,
CUBIC_TO, 4, 9.58f, 4.15f, 9.23f, 4.44f, 8.94f,
CUBIC_TO, 4.74f, 8.65f, 5.09f, 8.5f, 5.5f, 8.5f,
CUBIC_TO, 5.92f, 8.5f, 6.27f, 8.65f, 6.56f, 8.94f,
CUBIC_TO, 6.85f, 9.24f, 7, 9.59f, 7, 10,
CUBIC_TO, 7, 10.42f, 6.85f, 10.77f, 6.56f, 11.06f,
CUBIC_TO, 6.26f, 11.35f, 5.91f, 11.5f, 5.5f, 11.5f,
CLOSE,
MOVE_TO, 10, 11.5f,
CUBIC_TO, 9.58f, 11.5f, 9.23f, 11.35f, 8.94f, 11.06f,
CUBIC_TO, 8.65f, 10.76f, 8.5f, 10.41f, 8.5f, 10,
CUBIC_TO, 8.5f, 9.58f, 8.65f, 9.23f, 8.94f, 8.94f,
CUBIC_TO, 9.24f, 8.65f, 9.59f, 8.5f, 10, 8.5f,
CUBIC_TO, 10.42f, 8.5f, 10.77f, 8.65f, 11.06f, 8.94f,
CUBIC_TO, 11.35f, 9.24f, 11.5f, 9.59f, 11.5f, 10,
CUBIC_TO, 11.5f, 10.42f, 11.35f, 10.77f, 11.06f, 11.06f,
CUBIC_TO, 10.76f, 11.35f, 10.41f, 11.5f, 10, 11.5f,
CLOSE,
MOVE_TO, 14.5f, 11.5f,
CUBIC_TO, 14.08f, 11.5f, 13.73f, 11.35f, 13.44f, 11.06f,
CUBIC_TO, 13.15f, 10.76f, 13, 10.41f, 13, 10,
CUBIC_TO, 13, 9.58f, 13.15f, 9.23f, 13.44f, 8.94f,
CUBIC_TO, 13.74f, 8.65f, 14.09f, 8.5f, 14.5f, 8.5f,
CUBIC_TO, 14.92f, 8.5f, 15.27f, 8.65f, 15.56f, 8.94f,
CUBIC_TO, 15.85f, 9.24f, 16, 9.59f, 16, 10,
CUBIC_TO, 16, 10.42f, 15.85f, 10.77f, 15.56f, 11.06f,
CUBIC_TO, 15.26f, 11.35f, 14.91f, 11.5f, 14.5f, 11.5f,
CLOSE
1 change: 1 addition & 0 deletions chrome/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1996,6 +1996,7 @@ static_library("browser") {
"//chrome/common:supervised_user_commands_mojom",
"//chrome/common:version_header",
"//chrome/common/cart:mojo_bindings",
"//chrome/common/chat:mojo_bindings",
"//chrome/common/net",
"//chrome/common/notifications",
"//chrome/installer/util:with_no_strings",
Expand Down
7 changes: 6 additions & 1 deletion chrome/browser/chrome_browser_interface_binders.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
#include "chrome/browser/ui/webui/suggest_internals/suggest_internals_ui.h"
#include "chrome/browser/ui/webui/usb_internals/usb_internals.mojom.h"
#include "chrome/browser/ui/webui/usb_internals/usb_internals_ui.h"
#include "chrome/browser/ui/webui/side_panel/chat/chat.mojom.h"
#include "chrome/browser/ui/webui/side_panel/chat/chat_ui.h"
#include "chrome/browser/web_applications/web_app_utils.h"
#include "chrome/common/buildflags.h"
#include "chrome/common/chrome_features.h"
Expand Down Expand Up @@ -1242,7 +1244,7 @@ void PopulateChromeWebUIFrameBinders(
policy::local_user_files::LocalFilesMigrationUI,
#endif
NewTabPageUI, OmniboxPopupUI, BookmarksSidePanelUI, CustomizeChromeUI,
InternalsUI, ReadingListUI, TabSearchUI, WebuiGalleryUI,
InternalsUI, ReadingListUI, ChatUI, TabSearchUI, WebuiGalleryUI,
HistoryClustersSidePanelUI, ShoppingInsightsSidePanelUI,
media_router::AccessCodeCastUI, commerce::ProductSpecificationsUI>(map);

Expand Down Expand Up @@ -1374,6 +1376,9 @@ void PopulateChromeWebUIFrameBinders(
side_panel::mojom::BookmarksPageHandlerFactory, BookmarksSidePanelUI>(
map);

RegisterWebUIControllerInterfaceBinder<
chat::mojom::PageHandlerFactory, ChatUI>(map);

RegisterWebUIControllerInterfaceBinder<
shopping_service::mojom::ShoppingServiceHandlerFactory,
BookmarksSidePanelUI, commerce::ProductSpecificationsUI,
Expand Down
Loading