Add Coach: an in-editor writing coach for drafts#205
Draft
leomattic wants to merge 2 commits into
Draft
Conversation
A right-rail Coach tab that reviews a draft and helps improve it, aimed at foreign-language writers and anyone who wants coaching: - Review: scans the draft for grammar, style (collocations, repetition, filler, passive voice) and AI-tell issues, underlines them in the editor, and explains each in a teaching popover. Auto-runs on entering the tab when results are stale. - Rewrite: selection-driven actions (Beautify, Natural, Fix, Simpler, Rephrase, Humanize) returning one suggestion, shown as a before/after diff before you apply. - Structure: opt-in paragraph-level review (organization, transitions, weak openings/endings) with click-to-jump. - A "how this reads" summary (AI register + local readability) and a richer hover popover (definition, synonyms, sentence rewrite). Generated prose is de-dashed so the tool that flags AI tells doesn't emit them itself. New pure helpers (deDash, wordDiff, readability) and the JSON parser are unit-tested. Closes #189 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Conflicts: # src/main/channels/ui-prefs-set.ts # src/renderer/components/DraftSidebar.tsx # src/renderer/screens/DraftEditorScreen.tsx
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.
Closes #189
What this adds
Coach is a new right-rail mode in the draft editor that reviews a draft and helps improve it, aimed at people writing in a non-native language and anyone who wants coaching beyond a spell check.
Open it from the rail. Three sections:
Review (whole document)
Scans the draft into three lenses, each with its own editor underline and a teaching popover on click:
Each finding explains why, not just what to change. Pills toggle each lens. The scan auto-runs on entering the tab when the draft changed since the last scan; "Rescan" forces it. A one-line summary shows register (from the scan) plus reading level (Flesch grade, computed locally and live).
Rewrite (selection)
Selection driven, falling back to the current sentence. Six actions, two per line: Beautify, Natural, Fix, Simpler, Rephrase, Humanize. Each returns one suggestion as a before/after diff before you apply. My voice is a placeholder for a later samples-based feature.
Structure (whole document, opt-in)
A separate heavier pass (Sonnet) on organization and flow: buried ledes, paragraphs doing two jobs, weak openings/endings, abrupt transitions. Notes link to the paragraph. Opt-in so the fast loop stays cheap.
Hover popover
Hovering a word shows a definition, the meaning in context, tappable synonyms, and a one-line sentence rewrite. Synonyms and the rewrite apply in place.
Notes
deDash,wordDiff,readability) and the shared model-JSON parser are unit tested.Testing
tsc, ESLint, Stylelint clean; 482 unit tests pass.trunk(History tab + voice work); both coexist, no console errors.Known rough edges
🤖 Generated with Claude Code