Skip to content

Add optional real-time grammar feedback powered by Harper #38

Description

@TyceHerrman

Problem

Cai currently checks writing only after the user selects content and presses ⌥C. Fix Grammar is an LLM action, so Cai doesn't flag issues while the user is typing.

Proposal

Add an opt-in Live Writing Feedback mode powered by Harper:

  • Monitor the focused editable field through macOS Accessibility.
  • Lint locally with Harper after a short debounce.
  • Underline spelling, punctuation, grammar, and style issues as they appear.
  • Show Harper's explanation and suggestions when an underline is selected.
  • Allow applying or ignoring a suggestion, disabling its rule, or adding a word to the dictionary.
  • Keep Cai's existing ⌥C actions for optional AI rewriting.

Live checking shouldn't call an LLM, silently change text, or inspect background applications.

Privacy and compatibility

  • Off by default, with per-app controls and an easy pause switch.
  • Monitor only the focused nonsecure text field.
  • Keep all linting on-device.
  • Start with standard Accessibility text controls.
  • If an application doesn't expose reliable text-range bounds, show a feedback list or disable live checking rather than using continuous OCR.

A persistent harper-core or harper-ls engine could supply structured lint spans and suggestions for an Accessibility-positioned overlay.

This would give Cai a useful hybrid workflow: continuous deterministic feedback from Harper plus user-invoked AI rewriting when wanted.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions