Add a margin button to ask the assistant about a paragraph#4328
Open
zenoachtig wants to merge 4 commits into
Open
Add a margin button to ask the assistant about a paragraph#4328zenoachtig wants to merge 4 commits into
zenoachtig wants to merge 4 commits into
Conversation
Make the "ask the assistant about a selection" feature more discoverable by adding a hover-revealed icon button in the document margin for every paragraph. - AskAIParagraphButton: an absolutely-positioned, pointer-fine-only button that stages the paragraph's text as a chat reference and opens/focuses the assistant. Per-block position nudges live in the component via `in-[…]` ancestor variants. - Paragraph: wrap each paragraph in a `group/ask-ai` container and render the button when the site is in Assistant mode (on screen, non-empty paragraphs). - i18n: generalize `ai_chat_ask_about_page` -> `ai_chat_ask_about` with a parameterized target and add `this_page`/`this_text` keys across all locales; update PageActions to pass the target. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 0ffe0ee The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
Show the button at full opacity when revealed instead of dimming it to 50%. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The per-block nudge comment referenced a removed `blockContextOffset` constant; describe the inline `in-[…]` approach instead. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
in-[…]ancestor variants, localized toAskAIParagraphButton) keep it clear of markers/rails/borders; it's hidden inside tables and on touch / hover-less devices.ai_chat_ask_about_pagelabel into a reusableai_chat_ask_about("Ask ${1} about ${2}") with newthis_page/this_textkeys across all locales, so the page action and the paragraph button share one parameterized string.Demo
Margin button revealed on hover (top-level paragraph):
On nested content (list items):
Clicking stages the paragraph as a reference in the assistant:
— Authored by Claude