-
Notifications
You must be signed in to change notification settings - Fork 61
Description
Feature Overview & Value
Summary: This feature allows authors to select existing text blocks and use AI to modify their length or density without changing the core meaning with an Inline Transformation flow. The experience should feel like a "Smart Edit" where the text morphs in place, allowing for quick iteration.
Why it matters: Editors often struggle with pacing. A section might be too verbose (needs condensing) or a key point might feel underdeveloped (needs expanding). This tool acts as an instantaneous editor.
Use Cases
The "TL;DR": A user highlights a long, complex technical paragraph and chooses Condense to make it punchier for mobile readers.
Fleshing out ideas: A user writes a single sentence premise and chooses Expand to have the AI extrapolate it into a full paragraph.
Fitting Layouts: A designer needs a paragraph to be exactly 3 lines long to match a column layout; they use this tool to adjust the length accordingly.
User Interaction Flow
1. Entry Point (The Block Toolbar)
- Trigger: The user selects a standard Paragraph Block (or other blocks that have text exposed like Heading and Cover Blocks).
- The Icon: A native toolbar button (Sparkle or other AI icon) appears alongside standard controls like Bold/Italic/Link.
- The Menu: Clicking the icon opens a Dropdown Menu (not a modal).
- Options: "Shorten", "Expand", "Rephrase".
2. The Transformation Process
- Selection: The user clicks an option (e.g., "Shorten").
- Processing: The block enters a "Loading/Thinking" state (pulsing opacity or skeleton loader).
- Output: The new text is returned.
###3. The Review State (The Diff)
Visuals: The original text is replaced by the new text, but it is highlighted (e.g., a subtle purple background) to indicate it is a "Suggestion."
Floating Controls: A small action bar floats above the block:
- Accept: Commits the change and removes the highlight.
- Retry: Re-runs the specific command.
- Undo: Reverts immediately to the original text.
Technical Requirements
Supported Providers:
- Must support OpenAI, Anthropic, and Google.
Input Data: The prompt must include the current block content as the source material.
Block Compatibility:
- Primary support: Paragraph Blocks.
- Secondary support (Desirable): List Blocks, Heading Blocks, Cover Blocks.
Authentication:
If the user attempts to resize text but has no provider connected, trigger the Connectors Component (if available), else display an error message and direct folks to Settings > Connectors.
UI Mechanics & Component Definitions
###1. The "Transformation Dropdown"
Placement: Anchored to the Toolbar button.
Items: List of actions with icons (e.g., Arrows pinching in for "Shorten", Arrows pushing out for "Expand").
Tone Slider (Future/Optional): Consider adding a "Tone" sub-menu (Professional, Casual) since the backend logic is identical to resizing (see #186 for more on this).
2. Error States
Too Short: If a user tries to "Condense" a 5-word sentence, return a polite notice ("Text is too short to shorten further").
Auth Failure: If the API key fails, display a non-intrusive "toast" error rather than breaking the editor UI.
Credits
Props to @linawiezkowiak, @lwoodmansee, and @rachaelcortellessa for the product definition, and @dkotter for technical review.
Metadata
Metadata
Assignees
Labels
Type
Fields
Give feedbackProjects
Status