feat(languagetool): 'Check this scene' grammar panel (PR-C1 MVP)#236
Merged
Conversation
On-demand, self-hosted LanguageTool grammar/spell check wired into the Writer tools sidebar — deterministic, no AI tokens, separate from the AI generation flow. - hooks/useLanguageToolCheck.ts — orchestration: resolves locale→LT code from the SSOT (getLanguageToolCode), enforces the privacy gate (assertLanguageToolAllowed), runs checkText on the active section (abortable), and applies/ignores/dictionaries results. Apply is offset-safe and re-checks (offsets shift); add-to-dictionary persists to advancedEditor.customDictionary and drops the word's spelling matches. - components/writing/GrammarCheckPanel.tsx — button + diagnostics list (category, message, flagged span, replacement chips → one-click apply, ignore, add-to- dictionary). Hidden entirely for LanguageTool-unsupported locales (tr/he/fi/hu/ is/eu/ko); enable hint when the integration is off; offline/error degrade quietly. - i18n: 14 writer.grammar.* keys across all 19 locales (core-5 hand-translated, others English-seeded for parity; bulk-MT later) + rebuilt bundles. - Tests: GrammarCheckPanel integration (check→list, apply→dispatch+recheck, ignore, unsupported-locale hidden, disabled hint) — 5; service core already covered. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| Docker | Jun 24, 2026 10:06p.m. | Review ↗ | |
| JavaScript | Jun 24, 2026 10:06p.m. | Review ↗ | |
| CSS | Jun 24, 2026 10:06p.m. | Review ↗ | |
| Rust | Jun 24, 2026 10:06p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
…nel test + JS-0357 - useLanguageToolCheck: defensive ?? defaults on settings.integrations/advancedEditor so the panel never crashes on a partial persisted-settings object (project convention) — fixes the Quality Gate failure where WriterView/WriterViewUI tests render ToolsPanel. - ToolsPanel.test: stub GrammarCheckPanel (it pulls in Redux) to keep ToolsPanel's unit test isolated, matching the existing ToolInputs/Select stubs. - GrammarCheckPanel: declare GrammarMatchItem before use (DeepSource JS-0357). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…ov/patch) Add a dedicated useLanguageToolCheck hook test (unsupported/disabled/unknown- section/offline/error in check, apply + stale no-op, dictionary add/dedup/blank, ignore, clear) and panel display tests (noIssues/offline/error/add-to-dictionary/ no-suggestions). Lifts patch coverage of the hook+panel from ~67% to ~99% lines. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
qnbs
added a commit
that referenced
this pull request
Jun 24, 2026
…e loop (#237) * docs(deepsource): inline review threads now resolvable — reply+resolve loop (§1/§3a/§11) DeepSource began posting inline PR review comments in resolvable threads (deepsource-io[bot]) on code PRs #235/#236 — the earlier 'no resolveReviewThread step' note is obsolete. Update the loop to: fix → status green → reply citing the commit + resolveReviewThread, 0 unresolved (mirrors CodeAnt). Add §3a GraphQL snippet, correct the status-vs-check-run reality (read commits/$SHA/status + target_url), and log the JS-C1002/JS-0357 + tests/unit-is-analyzed + codecov/patch lessons. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * docs(deepsource): termination condition also requires 0 unresolved threads Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
qnbs
added a commit
that referenced
this pull request
Jun 25, 2026
* docs(languagetool): feature guide + ADR 0010 + CHANGELOG + README Document the shipped LanguageTool integration (registry metadata #234, service #235, on-demand panel #236, live inline overlay #238): docs/LANGUAGETOOL.md (setup, privacy model, locale coverage, architecture), ADR 0010 (self-hosted + overlay-reuse + locale-mapping rationale), CHANGELOG [Unreleased] entry, README feature line + Documentation Hub row. Locale-addition rollout (pl/nl/tr/uk/ro) is tracked separately and intentionally not covered here. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * docs(i18n): dedicated TODO for the LanguageTool new-locale rollout (deferred) Self-contained plan for the remaining program tail — adding pl/nl/tr/uk/ro UI locales (per-locale recipe, LT metadata, sequencing, gotchas) + the locale-dependent closing docs (README 19→24, handover report). Deferred for later execution after other planned work. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- 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.
Summary
PR-C1 of the LanguageTool program — the on-demand grammar/spell MVP wired into the Writer tools sidebar, built on the tested
languageToolService(#235). Deterministic, self-hosted, no AI tokens, separate from the AI generation flow.What's new
hooks/useLanguageToolCheck.ts— orchestration. Resolves the active locale → LanguageTool code from the SSOT (getLanguageToolCode, feat(i18n): LanguageTool registry metadata + Phase-0 report (Workstream B) #234), enforces the privacy gate (assertLanguageToolAllowed), runscheckTexton the active section (abortable; a rapid re-trigger cancels the prior run). Apply is offset-safe and re-checks (offsets shift after an edit); add-to-dictionary persists toadvancedEditor.customDictionary(reused — no new settings field) and drops the word's spelling matches; ignore dismisses one match.components/writing/GrammarCheckPanel.tsx— "Check this scene" button + diagnostics list (category, message, flagged span, replacement chips → one-click apply, ignore, add-to-dictionary). Hidden entirely for LanguageTool-unsupported locales (tr/he/fi/hu/is/eu/ko); shows an enable hint when the integration is off; offline/error degrade quietly so typing is never blocked.ToolsPanelbelow the AI tools (bordered section).writer.grammar.*keys across all 19 locales (core-5 hand-translated: en/de/es/fr/it; others English-seeded for parity, bulk-MT later) + rebuilt bundles.GrammarCheckPanel.test.tsx, 5): check→list, apply→dispatch+re-check, ignore removes, unsupported-locale hidden, disabled hint. Service core covered by feat(languagetool): real grammar-check service (checkText + offset-safe apply) #235's 13 tests; gating bylanguageToolClient.test.Test plan
pnpm run lint✅ ·pnpm run typecheck✅ ·pnpm run i18n:check✅ (+14 keys/bundle, parity OK) ·pnpm run suppressions:check✅ (no new suppressions)pnpm exec vitest run tests/unit/GrammarCheckPanel.test.tsx tests/unit/languageToolService.test.ts tests/unit/i18nPlaceholders.test.ts✅ (55)Verification (manual, later)
Run a local LanguageTool (
docker run -p 8010:8010 erikvl87/languagetool), enable it in Settings → Connections, then "Check this scene" on a section with a planted error → fix applies offset-safe; add-to-dictionary suppresses a flagged name; server-down degrades silently.Next in the stack
PR-C2 — live inline underlines on the ManuscriptEditor overlay + suggestion popover.
🤖 Generated with Claude Code