enhance(office-addin): replace React runtime with plain TypeScript - #4643
Conversation
Current Aviator status
This pull request is currently open (not queued). How to mergeTo merge this PR, comment
See the real-time status of this PR on the
Aviator webapp.
Use the Aviator Chrome Extension
to see the status of your PR within GitHub.
|
📝 WalkthroughWalkthroughThe Office Add-in is rewritten from React to vanilla TypeScript. It adds strict evaluation URL validation, Office settings migration and serialization, a static embedded-evaluation UI, a simplified Rollup build, docs parity verification, and updated testing and release documentation. ChangesOffice Add-in rewrite
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant PowerPoint
participant ContentController
participant OfficeSettings
participant EvaluationPage
PowerPoint->>ContentController: initialize add-in
ContentController->>OfficeSettings: read embeddedUrl or migrate legacy setting
ContentController->>ContentController: validate evaluation URL
ContentController->>OfficeSettings: serialize and save embeddedUrl
ContentController->>EvaluationPage: load URL in sandboxed iframe
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.agents/skills/klicker-testing-verification/SKILL.md:
- Around line 12-18: Update the Office Add-in row in the test-routing table to
include pnpm --filter `@klicker-uzh/office-addin` test alongside its existing
check, lint, documentation, and validation commands, preserving the current
stubbed Office API and sideloading guidance.
In `@apps/office-addin/README.md`:
- Around line 81-83: Update the manifest validator advisory warning in the
README to remove the obsolete uuid advisory, while retaining the adm-zip warning
and the existing restriction against untrusted manifest or archive input.
In `@docs/getting-started.md`:
- Line 19: Update the TypeScript baseline statement in the getting-started
documentation to explicitly exclude the legacy Cypress setup documented in
docs/testing.md, which remains on TypeScript 5 with its non-strict contract.
Preserve the existing TypeScript 6 baseline for all other packages, including
apps/office-addin, and clarify that no syncpack exception is needed beyond this
documented Cypress exception.
In `@project/2026-07-07-pr4643-office-addin-review.md`:
- Around line 58-66: Update both fenced manifest examples in the documentation
section around the SourceLocation and IconUrl snippets to use the xml language
tag, including the opening fences while preserving their contents and closing
fences.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 69496de5-9d8f-481e-9692-11669a1d4dcb
⛔ Files ignored due to path filters (5)
apps/docs/static/office-addin/content.js.mapis excluded by!**/*.mapapps/docs/static/office-addin/polyfill.js.mapis excluded by!**/*.mapapps/docs/static/office-addin/taskpane.js.mapis excluded by!**/*.mapapps/docs/static/office-addin/vendor.js.mapis excluded by!**/*.mappnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (42)
.agents/skills/klicker-testing-verification/SKILL.md.syncpackrc.mjsapps/docs/static/office-addin/3564e456b2d9d6c8b74b.cssapps/docs/static/office-addin/content.htmlapps/docs/static/office-addin/content.jsapps/docs/static/office-addin/content.js.LICENSE.txtapps/docs/static/office-addin/manifest-taskpane.xmlapps/docs/static/office-addin/manifest.xmlapps/docs/static/office-addin/polyfill.jsapps/docs/static/office-addin/polyfill.js.LICENSE.txtapps/docs/static/office-addin/styles.cssapps/docs/static/office-addin/taskpane.htmlapps/docs/static/office-addin/taskpane.jsapps/docs/static/office-addin/vendor.jsapps/docs/static/office-addin/vendor.js.LICENSE.txtapps/office-addin/.gitignoreapps/office-addin/CLAUDE.mdapps/office-addin/README.mdapps/office-addin/eslint.config.mjsapps/office-addin/manifest.xmlapps/office-addin/package.jsonapps/office-addin/postcss.config.cjsapps/office-addin/rollup.config.jsapps/office-addin/scripts/clean-cache.jsapps/office-addin/scripts/sync-docs.mjsapps/office-addin/src/content/components/App.tsxapps/office-addin/src/content/components/URLForm.tsxapps/office-addin/src/content/content.htmlapps/office-addin/src/content/content.tsapps/office-addin/src/content/evaluation-url.tsapps/office-addin/src/content/index.tsxapps/office-addin/src/content/office-utils/powerPointAPI.tsapps/office-addin/src/manifest-taskpane.xmlapps/office-addin/src/styles.cssapps/office-addin/src/taskpane/index.tsxapps/office-addin/src/taskpane/taskpane.htmlapps/office-addin/tests/evaluation-url.test.mjsapps/office-addin/tsconfig.jsondocs/getting-started.mddocs/log.mddocs/testing.mdproject/2026-07-07-pr4643-office-addin-review.md
💤 Files with no reviewable changes (15)
- apps/office-addin/src/taskpane/index.tsx
- apps/docs/static/office-addin/taskpane.html
- apps/docs/static/office-addin/vendor.js.LICENSE.txt
- apps/office-addin/src/manifest-taskpane.xml
- apps/office-addin/src/taskpane/taskpane.html
- apps/docs/static/office-addin/polyfill.js.LICENSE.txt
- apps/docs/static/office-addin/content.js.LICENSE.txt
- apps/office-addin/src/content/index.tsx
- apps/office-addin/postcss.config.cjs
- apps/office-addin/src/content/components/App.tsx
- apps/office-addin/src/content/components/URLForm.tsx
- apps/docs/static/office-addin/taskpane.js
- apps/office-addin/src/content/office-utils/powerPointAPI.ts
- apps/docs/static/office-addin/manifest-taskpane.xml
- apps/office-addin/scripts/clean-cache.js
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/docs/static/office-addin/content.js`:
- Line 1: Update the source implementation behind the Office add-in settings
helpers so all settings set/remove mutations and their subsequent saveAsync
calls are serialized through a shared promise queue, preserving mutation order
across embed, migration, and change-URL flows. Ensure UI state updates only
after the queued persistence operation completes, then regenerate
apps/docs/static/office-addin using the documented docs build.
- Line 1: Update the legacy settings migration and Clear Saved URL flows to
persist rollback changes after an initial saveAsync failure: after restoring or
removing settings, invoke saveAsync again and report if that rollback save also
fails. Anchor the changes in the migration logic inside the Office.onReady
handler and the changeUrlButton click handler, preserving their existing
user-facing failure messages while adding rollback-specific reporting.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: af21b043-101a-40de-a8eb-086cc7922179
⛔ Files ignored due to path filters (1)
apps/docs/static/office-addin/content.js.mapis excluded by!**/*.map
📒 Files selected for processing (10)
.agents/skills/klicker-testing-verification/SKILL.mdapps/docs/static/office-addin/content.jsapps/office-addin/README.mdapps/office-addin/src/content/content.tsapps/office-addin/src/content/evaluation-url.tsapps/office-addin/tests/evaluation-url.test.mjsdocs/getting-started.mddocs/testing.mdproject/2026-07-07-pr4643-office-addin-review.mdsonar-project.properties
🚧 Files skipped from review as they are similar to previous changes (5)
- docs/testing.md
- apps/office-addin/README.md
- docs/getting-started.md
- project/2026-07-07-pr4643-office-addin-review.md
- apps/office-addin/src/content/content.ts
|



What
Replaces the React and Webpack Office Add-in with a small Rollup-built TypeScript content add-in. The new flow accepts only KlickerUZH evaluation links, embeds them in PowerPoint, and persists each content add-in instance's URL through Office document settings.
Changes
saveAsynccall, and persists rollback state after failed writesno-referrerand the minimum required sandbox permissions/office-addin/and verifies exact parity between Rollup output and all 13 deployed docs-static filesBranch coverage
v3atc8de9c897d6f3afb82Review focus
embeddedUrlkey therefore remains instance-scoped: https://learn.microsoft.com/en-us/office/dev/add-ins/develop/persisting-add-in-state-and-settingsevaluation-url.tsaccepts only the production Manage host, optionalenorde, currentquizzesor legacysessions, a UUID,evaluation, and the backend-compatible lowercase 64-character hexadecimal HMACsettings-mutation-queue.tskeeps mutation and persistence atomic across handlers, then performs and saves a rollback before allowing the next mutation to beginbuild:docsandverify:docsmust continue to keep the production manifest, runtime files, styles, maps, and assets identical to the built outputVerification
Full repository checks after the final runtime fix:
git diff --check: passedCurrent head after the final security, review, and native-verification adjustments:
build:docs, 13-file deployment parity, and Microsoft manifest validation under pinned Node 24.16.0 and pnpm 11.5.0: passedbc5d73313, before the final queue hardening, with the exact candidate bundle and a fresh tunnel-backed manifest:4e81d8bd8passed all GitHub CI checks, including all eight Playwright shards and the aggregate status gate; the first shard 6 attempt had an unrelated KPRIM assertion failure and its failed-job rerun passedWarnings and limits:
adm-zipin Microsoft's latest manifest validator andbrace-expansionin the lint tree. Neither package ships in the add-in runtime or processes user-controlled production input. The earlieruuidfinding is fixed byoffice-addin-manifest2.1.6.Security and privacy
Blocking before merge
Follow-up after merge