feat: Word add-in — chat, tracked-changes rewrites, workflows and projects in Word - #37
Open
amal66 wants to merge 1 commit into
Open
feat: Word add-in — chat, tracked-changes rewrites, workflows and projects in Word#37amal66 wants to merge 1 commit into
amal66 wants to merge 1 commit into
Conversation
…jects in Word
Port of the Office.js Word add-in from amal66/mike@feat/word-addin-pr. The
add-in itself (word-addin/) is copied verbatim; in the fork it consumes the
shared @mike/api-client, @mike/core, and @mike/shared packages from the
monorepo's packages/ directory via tsconfig paths + webpack aliases. Upstream
has no packages/ directory, so the specific files it imports are vendored as
mechanical copies under word-addin/src/vendor/{api-client,core,shared}/ and
the aliases retargeted there — no source file changes.
Features: chat task pane with SSE streaming, document-anchored tracked-changes
rewrites, workflow runs, project browsing/upload, API-key onboarding banner,
Supabase auth, hermetic Playwright e2e suite with an in-page Office.js shim.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CEguyEgXa9JjCciXCcVemC
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
Ports the fork's Office.js Word add-in: a task pane inside Microsoft Word with streaming chat, document-anchored tracked-changes rewrites, workflow runs, and project browsing/upload — backed by the same Mike backend and Supabase auth the web app uses. Ships with a fully hermetic Playwright e2e suite (57 tests) that mocks the Office.js host and every network call.
Changes
word-addin/— the complete add-in, copied verbatim from the fork:src/taskpane/): chat panel with SSE streaming and stop/regenerate, tracked-changes document actions (rewrites anchored to Word ranges viauseWordDoc/wordText), workflow picker + streamed runs, project picker with document upload, API-key onboarding banner, Supabase email/password auth with token refresh.manifest.xml(localhost sideloading) +scripts/build-manifest.js(URL-rewritten release manifest), webpack build with an HTTPS dev server that same-origin-proxies the API and Supabase (Word's WebView blocks mixed content),scripts/dev.shone-step dev bootstrap.e2e/): in-page Office.js shim + recorded Word calls,page.routeinterception of all backend traffic, static-serves the production bundle — no Word, no live API, no Supabase needed.word-addin/src/vendor/{api-client,core,shared}/— the shared-package files the add-in imports, vendored as mechanical copies (see Provenance for the full list); tsconfig paths / webpack aliases / the CSS token import retargeted from../packages/*tosrc/vendor/*. No add-in source file changed.Why
Lawyers live in Word. Drafting, markup, and negotiation happen in .docx with tracked changes — a chat that can read the open document and propose revisions as native tracked changes, in place, meets them where the work already is, instead of round-tripping uploads through a browser tab.
In the fork this add-in consumes
@mike/api-client,@mike/core, and@mike/sharedfrom a monorepopackages/directory; upstream has nopackages/, so the exact files it imports are vendored underword-addin/src/vendor/with the aliases retargeted. The fork keeps these as shared packages — vendoring is purely the layout-translation cost of expressing the add-in against this repo's structure, and de-duplicates trivially if upstream ever adopts apackages/directory. Note on intent: the strategy is for this work to live in amal66's namespace; this PR exists so the add-in is reviewable in upstream shape.Testing
All run in
word-addin/as committed:npm ci— clean install, 944 packages.npm run typecheck(tsc --noEmit) — green.npm run buildwith the fork's documented release env vars (REACT_APP_API_BASE_URL,REACT_APP_SUPABASE_URL,REACT_APP_SUPABASE_ANON_KEY,REACT_APP_WEB_APP_URL,WORD_ADDIN_PUBLIC_URL) — green (webpack size warnings only); writesdist/+ the URL-rewritten production manifest.npx playwright test— hermetic suite self-builds and static-serves the bundle: 57 passed, 0 failed (chromium, 31.7s) across auth, chat, document actions, workflows, projects, API-key banner, and smoke specs.Provenance
All added lines are mechanical ports from amal66/mike —
word-addin/and the vendored files fromfeat/word-addin-pr(the fork's standalone-review branch for the add-in, which isorigin/mainb3166dd + the add-in; the fork intentionally keeps the add-in on that branch). Verified verbatim by diff; exceptions (all layout translation, no new logic):word-addin/tsconfig.json,word-addin/webpack.config.js,word-addin/src/taskpane/styles.css—@mike/*path aliases and the tokens.css import retargeted from../packages/*tosrc/vendor/*; out-of-tree include/exclude globs dropped.word-addin/README.md,word-addin/scripts/dev.sh— fork paths/commands translated to upstream layout (apps/web/.env.local→frontend/.env.local,apps/api/.env→backend/.env, rootnpm run dev:api→npm run devinbackend/).Vendored files (17, each a verbatim copy of the fork file at the same relative name):
word-addin/src/vendor/api-client/index.tspackages/api-client/src/index.tscore/index.tspackages/core/src/index.tscore/apiKeyProviders.tspackages/core/src/apiKeyProviders.tscore/storagePaths.tspackages/core/src/storagePaths.tscore/types.tspackages/core/src/types.tsshared/chat/ChatBubble.tsxpackages/shared/chat/ChatBubble.tsxshared/chat/ChatInput.tsxpackages/shared/chat/ChatInput.tsxshared/chat/Markdown.tsxpackages/shared/chat/Markdown.tsxshared/chat/mike-icon.tsxpackages/shared/chat/mike-icon.tsxshared/lib/utils.tspackages/shared/lib/utils.tsshared/styles/tokens.csspackages/shared/styles/tokens.cssshared/ui/button.tsxpackages/shared/ui/button.tsxshared/ui/input.tsxpackages/shared/ui/input.tsxshared/ui/label.tsxpackages/shared/ui/label.tsxshared/ui/select.tsxpackages/shared/ui/select.tsxshared/ui/spinner.tsxpackages/shared/ui/spinner.tsxshared/ui/switch.tsxpackages/shared/ui/switch.tsx🤖 Generated with Claude Code
https://claude.ai/code/session_01CEguyEgXa9JjCciXCcVemC