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 95 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.
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 6 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.
Introduced the ability to cancel ongoing queries across the chat API, backend, and user interface. Refactored several methods to manage query cancelation states and ensure smooth handling of page content extraction interruptions.
Added logic to handle incomplete or invalid JSON chunks by preserving and combining them to ensure proper processing. Enhanced logging for debugging invalid JSON segments in streamed responses.
Updated CSS to improve layout flexibility, spacing, and applied consistent styling for message containers. Removed redundant padding rules and simplified the empty state HTML by eliminating the `vertical-space` div.
Simplified invalid chunk handling by refactoring first and last chunk validation. Replaced inefficient operations with streamlined logic to improve readability and maintainability. Removed unused testing method from the class header.
nyinyithann pushed a commit that referenced this pull request Jan 9, 2025
… document.scripts()"

This reverts commit 14d9421.

Reason for revert: extensions_unittests failures started after this
CL on Linux UBSAN, see failed build at https://ci.chromium.org/ui/p/chromium/builders/ci/Linux%20UBSan%20Tests/2624/overview
Specific test failure:
https://luci-milo.appspot.com/ui/inv/build-8726283549253023857/test-results?q=ScriptContextSetTest.Lifecycle&sortby=&groupby=
Partial stack trace seems related to this CL:
../../v8/include/cppgc/member.h:258:43: runtime error: reference binding to null pointer of type 'blink::Element'
    #0 0x6285783a4e16 in operator* v8/include/cppgc/member.h:258:36
    #1 0x6285783a4e16 in blink::Document::UpdateBaseURL() third_party/blink/renderer/core/dom/document.cc:4597:52
    chromium#2 0x6285783a22db in blink::Document::Document(blink::DocumentInit const&, base::EnumSet<blink::DocumentClass, (blink::DocumentClass)0, (blink::DocumentClass)7>) third_party/blink/renderer/core/dom/document.cc:918:5
    chromium#3 0x6285764452e4 in blink::HTMLDocument::HTMLDocument(blink::DocumentInit const&, base::EnumSet<blink::DocumentClass, (blink::DocumentClass)0, (blink::DocumentClass)7>) third_party/blink/renderer/core/html/html_document.cc:67:7

Original change's description:
> SpeculationRules: Use Traversal<HTMLScriptElement> instead of document.scripts()
>
> It's possible to run Document::UpdateBaseURL() while processing the
> removal of elements (ContainerNode::RemovedFrom), but before the
> HTMLCollections (like document.scripts()) are invalidated (which
> happens in ContainerNode::ChildrenChanged after all removals are
> complete).
>
> Bug: 386547460
> Change-Id: Ifc8036887dad3b999e77b1a014b950b97a20484a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6148370
> Reviewed-by: Jeremy Roman <[email protected]>
> Reviewed-by: Mason Freed <[email protected]>
> Commit-Queue: Adithya Srinivasan <[email protected]>
> Cr-Commit-Position: refs/heads/main@{#1403679}

Bug: 386547460
Change-Id: Ibfaa45470d3f303610fdf8ceb4048dc22ea3029f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6158707
Commit-Queue: Justin Lulejian <[email protected]>
Bot-Commit: Rubber Stamper <[email protected]>
Owners-Override: Justin Lulejian <[email protected]>
Reviewed-by: Adithya Srinivasan <[email protected]>
Reviewed-by: Justin Lulejian <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1403868}
Increase max prompt input length to 90,000 and introduce logic to hide the site info container when the current page's content is used as chat context. Clear extracted content cache in page handler to prevent stale data. Adjust HTML rendering to support the new site info visibility logic.
Updated chat API to handle structured message inputs and support conversation history. Refined prompts and fixed typo in fact-check prompt definition. Improved page content extraction logic and streamlined API communication with better context management.
nyinyithann pushed a commit that referenced this pull request Jan 12, 2025
Updates the GPU pixel tests which force a context loss to restart the
browser afterwards as a tentative fix for flakes in subsequent tests.

This requires two related changes:

1. A new post-test hook is defined that GpuIntegrationTest calls
  since restarting the browser in the test method breaks the
  expected crash checks that GpuIntegrationTest performs.
2. Adding support for specifying platform-specific expected crashes.
   This allows us to work around Fuchsia-specific weirdness related
   to how expected crashes are checked that has been uncovered due
   to changing when the browser is restarted as part of #1.

Bug: 382422293
Change-Id: I3a4a7cb75247776f7836bfcadb7a639893a03cf9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6160817
Auto-Submit: Brian Sheedy <[email protected]>
Commit-Queue: Yuly Novikov <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1404724}
Replaces string-based query parameters with structured `CompletionMessage` inputs across `QueryPrompt` and related APIs. This improves clarity, enables better context management, and standardizes data handling for API interactions.
Implemented proper error handling and user feedback for chat API responses by adding error tracking variables, updating error messaging logic, and improving UI to display errors clearly. Removed unused code and improved JSON response handling for edge cases.
This commit implements the `OpenURL` method, allowing URLs to be opened with various click modifiers (e.g., Ctrl, Shift, middle-click) from the Chat side panel. Updates include handler logic, API proxy support, and UI interactions like clickable elements. This enhancement improves navigation workflows for users interacting with chat-generated URLs.
Introduced a helper function `BuildPrompt` to streamline chat context prompt construction. Refined localized strings for chat context too.
… references.

Replaced `raw_ptr` with `base::WeakPtr` for `content::WebContents` to ensure safer and more robust handling of lifetimes. This change reduces the risk of accessing invalid pointers and improves memory safety.
Updated the chat UI layout and styling for enhanced usability, including button behavior and label appearance. Refactored prompt handling to support additional action types and ensure clearer, more user-friendly responses. Adjusted prompt phrasing for better alignment with conversational standards.
…tructure

Updated CSS styles to enhance side panel and chat app layout, including new headers and spacing adjustments. Removed or commented redundant functions and elements in C++ files for better code maintainability. Introduced additional fields and properties in the chat app for improved functionality and UI interaction.
Added tooltips for "Close side panel" and "New Chat" buttons to improve user accessibility. Cleaned up variable naming for `isQueryCancellingInProgress` across the codebase for better readability. Adjusted CSS margin to improve layout consistency in the chat UI.
Added necessary `chat:mojo_bindings` dependencies to multiple BUILD.gn files to ensure proper integration and functionality.
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