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 72 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
72 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
2986f68
Enhance chat UI and manage color updates.
nyinyithann Dec 3, 2024
0159670
Refactor chat container styles for consistency
nyinyithann Dec 3, 2024
9d84e4c
Add YepChat prompt background color support for both light and dark t…
nyinyithann Dec 3, 2024
a716e12
Add Yep Chat color customization
nyinyithann Dec 4, 2024
11c238c
Refactor URL handling to exclude protocol
nyinyithann Dec 4, 2024
77f888b
Add query submission state handling
nyinyithann Dec 4, 2024
1ce332b
Refactor site info components to improve structure
nyinyithann Dec 5, 2024
a62f07b
Update chat app icons and styling for buttons
nyinyithann Dec 5, 2024
959f131
Enhance Chat UI styles especially in Prompt Input, and put Prompts to…
nyinyithann Dec 6, 2024
64bbbb8
Revise chat input and styling
nyinyithann Dec 6, 2024
11b4b80
Add 'marked' package and update npm include/exclude lists
nyinyithann Dec 10, 2024
0620689
Add 'marked' package and update npm include/exclude lists
nyinyithann Dec 10, 2024
075f990
Add third-party Marked library dependencies
nyinyithann Dec 11, 2024
8c77187
Add Markdown support using marked library integration
nyinyithann Dec 12, 2024
5b88335
Add Markdown support using marked library integration
nyinyithann Dec 12, 2024
5cb7105
Refactor chat message rendering with Markdown support
nyinyithann Dec 13, 2024
f47aa58
Improve styling and scrolling behavior for markdown pre element
nyinyithann Dec 18, 2024
6d5915b
Refactor chat panel styles and structure.
nyinyithann Dec 18, 2024
6f9e80d
Removed replacing invisible html white space chars because it negativ…
nyinyithann Dec 18, 2024
58de3be
Refactor chat app UI and improve response handling
nyinyithann Dec 18, 2024
eb0b11c
Add credit comment for third-party/marked usage
nyinyithann Dec 18, 2024
e50d868
Add ChatPromputInput component - WIP
nyinyithann Dec 18, 2024
720c264
Improve ChatPromptInput component
nyinyithann Dec 19, 2024
6f8296e
Remove markedJS from chrome://resources because it is coped to Chat f…
nyinyithann Dec 20, 2024
a3f64fc
Improve chat input UX and adjust markdown list spacing
nyinyithann Dec 20, 2024
e555384
Disable interactions and improve UI for invalid/ongoing states
nyinyithann Dec 20, 2024
225135d
Add sub action menu for Translate and Social Draft
nyinyithann Dec 20, 2024
e31f21c
Add action parameters and menus for chat actions
nyinyithann Dec 24, 2024
344b390
Refactor chat action menu and enhance functionality
nyinyithann Dec 26, 2024
86cc00c
Refactor chat components and enhance query prompt handling.
nyinyithann Dec 26, 2024
3141a7d
Adjust the height of prompt input
nyinyithann Dec 26, 2024
a189818
Adjust top padding value for site-info and query container
nyinyithann Dec 26, 2024
22334fe
Add send button styling and focus behavior for chat UI
nyinyithann Dec 27, 2024
d05bf68
Focus input field after query completion in chat app
nyinyithann Dec 27, 2024
997f325
Add stop icon to display while querying prompt
nyinyithann Dec 27, 2024
ddca839
Improve prompt query display and prompt input
Jan 4, 2025
3f4351c
Add validation for max token count in chat input
nyinyithann Jan 6, 2025
1077db8
Add query cancellation functionality to chat interface
nyinyithann Jan 8, 2025
6815e91
Fix SSE response handling error
nyinyithann Jan 8, 2025
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
57 changes: 57 additions & 0 deletions chrome/app/generated_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -8965,6 +8965,63 @@ 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 to...
</message>
<message name="IDS_CHAT_TRANSLATE_LANGS" desc="Use in sub menu list">
Afrikaans, Albanian, Amharic, Arabic, Armenian, Assamese, Azerbaijani, Basque, Belarusian, Bengali, Bosnian, Bulgarian, Catalan, Cebuano, Chichewa, Chinese (Simplified), Chinese (Traditional), Corsican, Croatian, Czech, Danish, Dutch, English, Esperanto, Estonian, Filipino, Finnish, French, Frisian, Galician, Georgian, German, Greek, Gujarati, Haitian Creole, Hausa, Hawaiian, Hebrew, Hindi, Hmong, Hungarian, Icelandic, Igbo, Indonesian, Irish, Italian, Japanese, Javanese, Kannada, Kazakh, Khmer, Kinyarwanda, Korean, Kurdish (Kurmanji), Kyrgyz, Lao, Latin, Latvian, Lithuanian, Luxembourgish, Macedonian, Malagasy, Malay, Malayalam, Maltese, Maori, Marathi, Mongolian, Myanmar (Burmese), Nepali, Norwegian, Odia, Pashto, Persian, Polish, Portuguese, Punjabi, Romanian, Russian, Samoan, Scots Gaelic, Serbian, Sesotho, Shona, Sindhi, Sinhala, Slovak, Slovenian, Somali, Spanish, Sundanese, Swahili, Swedish, Tajik, Tamil, Tatar, Telugu, Thai, Turkish, Turkmen, Ukrainian, Urdu, Uyghur, Uzbek, Vietnamese, Welsh, Xhosa, Yiddish, Yoruba, Zulu
</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 post for...
</message>
<message name="IDS_CHAT_SOCIAL_MEDIAS" desc="Use in sub menu list">
X (Twitter), Facebook, Instagram, LinkedIn
</message>
<message name="IDS_CHAT_DRAFT_FACT_CHECK" desc="Label of the button in Chat to fact-check the current page's content.">
Fact check
</message>
<message name="IDS_CHAT_PROMPT_SUMMARIZE_THIS_PAGE" desc="Prompt to summarize the current page.">
Provide a brief summary of the key takeaways for this page.
</message>
<message name="IDS_CHAT_PROMPT_EXPLAIN_IT_IN_SIMPLE_LANGUAGE" desc="Prompt to explain the current page's content in simple language.">
Explain this page in simple language.
</message>
<message name="IDS_CHAT_PROMPT_TRANSLATE" desc="Prompt to translate the current page's content.">
Translate this page to
</message>
<message name="IDS_CHAT_PROMPT_DRAFT_A_SOCIAL_MEDIA_POST" desc="Prompt to draft a social media post of the current page's content.">
Draft a post about this page for
</message>
<message name="IDS_CHAT_PROMPT_DRAFT_FACT_CHECT" desc="Prompt to fact-check the current page's content.">
Fact check this page and highlight major claims that may require verification or be biased.
</message>
<message name="IDS_CHAT_ASK_ANYTHING" desc="Use in the chat prompt input box.">
Ask anything...
</message>
<message name="IDS_CHAT_CHAT_ABOUT_THIS_PAGE" desc="Use in the chat prompt input box.">
Chat about this page
</message>
<message name="IDS_CHAT_PROMPT_INPUT_EXCEED" desc="Use to display the error message when prompt exceeds max length.">
Your message is too long
</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