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 70 commits into
base: tt/develop
Choose a base branch
from
Draft

Conversation

nyinyithann
Copy link
Collaborator

This PR mainly about adding Yep Chat in Taktak.

This commit introduces a toolbar button that allows users to toggle the visibility of the chat side panel.  The button provides a visual cue by highlighting with a rounded background when the chat panel is active.
…nel can be toggled from the toolbar and displays AI chat alongside current web content.
…so it can be localized into different languages.
Deleted ChatContextObserver class and its dependencies to simplify codebase. Adjusted related headers and implementation files to reflect the removal, and corrected remaining references and comments accordingly.
Implemented different prompts for chat actions: summarize page, explain page, and fact check page. Updated function signatures and button click handlers to utilize the new action-specific prompts.
Previously, the full content was passed to the query without length restriction, which could cause issues. Now, the content is truncated to a maximum of 32768 tokens to ensure it adheres to the defined limit.
Included the 'marked' package in the package
Included the 'marked' package in the package
Introduces the third-party Marked library to the project, including its build file, source code, and license information. The library provides a Markdown parser and is integrated into the build system for resource generation.
Integrated the marked library into the side-panel chat application for rendering Markdown. Updated relevant build files and TypeScript configurations to include the marked library and its definitions. Introduced a helper `getTrustedHTML` in `parse_html_subset.ts` and used `marked.parse` in `chat_app.ts` to parse responses to Markdown.
Integrated the marked library into the side-panel chat application for rendering Markdown. Updated relevant build files and TypeScript configurations to include the marked library and its definitions. Introduced a helper `getTrustedHTML` in `parse_html_subset.ts` and used `marked.parse` in `chat_app.ts` to parse responses to Markdown.
Updated chat message rendering to use `marked` library for Markdown parsing.  Ensured safe HTML rendering using `getTrustedHTML` and replaced manual text handling with parsed Markdown output.
Replaced `div` elements with semantic `article` tags for better accessibility. Updated scroll behavior and appearance for smoother UX, adjusted padding and layout for consistency, and refined CSS rules to optimize styling across components. Improved scrollbar theming for a more modern look.
Refactored CSS styles for better alignment and consistency, including border addition and adjustments to line-height and H2 styling. TypeScript changes include exporting `conversationRecord` type, adding debug logging, and refactoring response handling with a new utility function in the HTML template for cleaner, reusable code.
Added a comment to properly credit the third-party/marked library, adhering to Chromium's recommended practices. This ensures compliance with attribution guidelines for third-party code.
Refined textarea height management to handle up to 10 lines dynamically, ensuring better usability by avoiding unnecessary scrollbars. Updated chat markdown lists with reduced padding and consistent list item spacing. Added custom scrollbar styling for improved visual consistency.
Added `disabled` states for UI elements like the input field and send button to prevent interactions during query submission or when input is invalid. Enhanced visual feedback through styles such as cursor change and reduced opacity for disabled elements. Fixed button behavior to avoid submitting empty queries.
Introduced support for passing parameters to chat actions, enabling more dynamic prompts for translation and social media. Added dropdown menus for selecting translation languages and social media platforms. Fixed a typo in the fact-check prompt and improved overall UI structure for better functionality.
Renamed variables for better readability and consistency, such as replacing `translateToSubItems_` with `translateToLanguages_`. Refactored social media post handling to use a unified `action-menu` component with event-driven logic. Added support for additional languages and cleaned up redundant menu elements.
The CSS and HTML structures for query prompts were refactored for better modularity and maintainability. Introduced `getQueryPromptSection` for improved query rendering and added a `resetToAutoHeight` method to streamline input field resizing. Removed unused imports and simplified the codebase for clarity, addressing minor issues in text handling and logging.
Introduced new color IDs and updated styling for the chat send button, providing improved visuals in both light and dark modes. Refactored CSS and HTML structure for better alignment, including a new icon design. Enhanced functionality by adding focus behavior to the input field after message submission.
nyinyithann pushed a commit that referenced this pull request Dec 27, 2024
The answers feature check in the history WebUI controller can be
safely removed, because #1 answers may be disabled for the profile
even if the answers feature itself is enabled. and chromium#2 when the
feature is disabled, the answer mojom fields fall back to default
values with the exception of the answer text which should be empty.

Bug: 381108241
Change-Id: I2c7bcd3bd38aab64263103cbea923ac1d25ad75a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6116038
Commit-Queue: Moe Ahmadi <[email protected]>
Reviewed-by: John Lee <[email protected]>
Code-Coverage: [email protected] <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1400350}
nyinyithann pushed a commit that referenced this pull request Jan 3, 2025
No change to logic. This flag is not currently in use, as we instead
opted to proceed with the SITE_BLOCK flag. This removes most references
to the switch, however we still need to leave the flag definition so
that downstream references can be safely cleaned up.

This is change #1/3.

Bug: 356234122
Test: autoninja -C out/Default system_webview_google_apk
Test: tools/autotest.py -C out/Default AwSupervisedUserTest
Change-Id: I8c1e84ccec844064fb6648d791776b1d2da00874
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6107741
Commit-Queue: Peter Pakkenberg <[email protected]>
Reviewed-by: Peter Pakkenberg <[email protected]>
Auto-Submit: Nate Fischer <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1401748}
Nyi Nyi and others added 2 commits January 4, 2025 19:43
Introduce a character limit for chat input and display an error message when this limit is exceeded. Updated styles, UI logic, and string resources to enforce and visually represent the new constraint.
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