Skip to content

feat: Word add-in — chat, tracked-changes rewrites, workflows and projects in Word - #37

Open
amal66 wants to merge 1 commit into
upstream-mainfrom
upstream-pr/word-addin
Open

feat: Word add-in — chat, tracked-changes rewrites, workflows and projects in Word#37
amal66 wants to merge 1 commit into
upstream-mainfrom
upstream-pr/word-addin

Conversation

@amal66

@amal66 amal66 commented Jul 17, 2026

Copy link
Copy Markdown
Owner

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:
    • Task pane app (src/taskpane/): chat panel with SSE streaming and stop/regenerate, tracked-changes document actions (rewrites anchored to Word ranges via useWordDoc/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.sh one-step dev bootstrap.
    • Hermetic Playwright suite (e2e/): in-page Office.js shim + recorded Word calls, page.route interception 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/* to src/vendor/*. No add-in source file changed.
  • The fork's CI workflow for the add-in is deliberately not ported.

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/shared from a monorepo packages/ directory; upstream has no packages/, so the exact files it imports are vendored under word-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 a packages/ 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 build with 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); writes dist/ + 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.
  • Not exercised: sideloading into desktop Word (needs an Office host); the e2e suite's Office.js shim covers the Word API surface the add-in uses.

Provenance

All added lines are mechanical ports from amal66/mike — word-addin/ and the vendored files from feat/word-addin-pr (the fork's standalone-review branch for the add-in, which is origin/main b3166dd + 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/* to src/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.localfrontend/.env.local, apps/api/.envbackend/.env, root npm run dev:apinpm run dev in backend/).

Vendored files (17, each a verbatim copy of the fork file at the same relative name):

Vendored at word-addin/src/vendor/ Fork source
api-client/index.ts packages/api-client/src/index.ts
core/index.ts packages/core/src/index.ts
core/apiKeyProviders.ts packages/core/src/apiKeyProviders.ts
core/storagePaths.ts packages/core/src/storagePaths.ts
core/types.ts packages/core/src/types.ts
shared/chat/ChatBubble.tsx packages/shared/chat/ChatBubble.tsx
shared/chat/ChatInput.tsx packages/shared/chat/ChatInput.tsx
shared/chat/Markdown.tsx packages/shared/chat/Markdown.tsx
shared/chat/mike-icon.tsx packages/shared/chat/mike-icon.tsx
shared/lib/utils.ts packages/shared/lib/utils.ts
shared/styles/tokens.css packages/shared/styles/tokens.css
shared/ui/button.tsx packages/shared/ui/button.tsx
shared/ui/input.tsx packages/shared/ui/input.tsx
shared/ui/label.tsx packages/shared/ui/label.tsx
shared/ui/select.tsx packages/shared/ui/select.tsx
shared/ui/spinner.tsx packages/shared/ui/spinner.tsx
shared/ui/switch.tsx packages/shared/ui/switch.tsx

🤖 Generated with Claude Code

https://claude.ai/code/session_01CEguyEgXa9JjCciXCcVemC

…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant