Add Google Docs support - #382
Merged
Merged
Conversation
Adds a Google Docs adapter that reads the logical document model through the MAIN-world annotated-text API and applies suggestions as verified single-use edit transactions. Reuses the existing predictor, grammar, theme and local learning services. Includes model/transaction unit tests, a Chromium MAIN/isolated-world fixture suite, an operator-assisted live check script and docs. Activation is opt-in via the fluentTyperDocs=1 URL parameter pending live validation. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Verified in Chrome against real Google Docs. Docs' setSelection blurs the editable inside the text-event iframe, so the bridge now refocuses it before pasting and accepts a blurred editable while the frame is focused. Docs strips edge ASCII spaces from a plain-text paste but converts NBSP to a space, so trailing spaces are sent as NBSP. An unverified write now stops blocking after the next trusted user interaction instead of locking the adapter for the session. The fixture editor mirrors the paste normalization. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Drops the fluentTyperDocs=1 opt-in parameter after live verification in Chrome; per-site enable/disable still governs docs.google.com. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Docs renders collaborator carets with colored borders and the local caret with a black one. Prefer the black caret before treating multiple visible carets as ambiguous, which previously pushed the menu to the fallback corner. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
When a space already follows the completed word, the predictor appends none; the edit now consumes that space so the caret lands after it, matching the insert-space-after-autocomplete setting. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The fixture editor now blurs its editable on setSelection like live Docs, a colored collaborator caret must not displace the local caret anchor, and an unverified write is released after the next user interaction. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…t element The caret element carries Docs' 13px UI font, so the ghost rendered small and raised. A hidden style host now mirrors the toolbar font family, point size and zoom, with the caret height as line height and a caret-derived fallback. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…nline ghost Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Sep 15, 2026
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
Adds local autocomplete for Google Docs through the editor's annotated-canvas API, reusing the existing predictor, grammar rules, themes, snippets and local learning. No new permissions, hosts, dependencies or network calls.
_docs_annotate_canvas_by_extto FluentTyper's own extension ID atdocument_start, then reads the logical text and selection via_docs_annotate_getAnnotatedText.GoogleDocsAdaptertalks to the bridge over JSONCustomEvents and applies suggestions as single-use, model-verified transactions: select the minimal range, dispatch one synthetic plain-text paste, verify the resulting text. Unverified writes are never retried.SuggestionManagerstays active for titles and comments; only the hidden text-event iframe is excluded.docs.google.com/document/.../editURL, subject to the existing per-site enable/disable.Verified live in Chrome against real Google Docs
Suggestions render at the caret, Tab acceptance is verified as applied, native undo/redo work, predictions continue normally after an accept, and the inline ghost matches the document text. Fixes made from that testing:
setSelection; the bridge refocuses it before pasting.Tests
bun run check, full unit suite,bun run test:e2e:docs(25 Chromium MAIN/isolated-world fixtures),bun run test:e2esmoke, and Chrome/Edge/Firefox builds all pass; CI is green.tests/GoogleDocsModel.test.ts,tests/GoogleDocsTransaction.test.ts,tests/e2e/google-docs.e2e.test.tsplus fixture; the Docs fixture suite runs in the Chrome CI job. The fixture editor mirrors the live quirks above (blur on setSelection, paste space normalization, collaborator caret).bun run test:e2e:docs:live -- --help.Reviewer notes
docs/google-docs-integration.mdfor the full matrix and limits.🤖 Generated with Claude Code