Fix change-verb regression + collapse doubled articles#3
Conversation
PWA: web app manifest, offline service worker (precaches the app shell and the humanizer package, caches Pyodide on first use), iOS meta tags and apple-touch-icon, and placeholder app icons (192/512/maskable/180). Users can Add to Home Screen for a full-screen, offline, deletable/re-addable app with no app store. Adds ios/ — a SwiftUI WKWebView wrapper plus a complete build/submit plan for a future native App Store listing. README documents install steps for iOS/Android/desktop. https://claude.ai/code/session_015REKyF6JmJchTnZWoLth7Y
Leads with Open/Install badges and a per-device Add-to-Home-Screen table so anyone landing on the repo can install the app from the live link in seconds. https://claude.ai/code/session_015REKyF6JmJchTnZWoLth7Y
Review feedback on PR #2: expanded dictionaries gave `change` (and the per-tone overrides + `changes`) noun-only alternatives, so "change the plan" became "transformation the plan". Restore verb-form, tone-flavoured replacements for change/changes across BASE and all 9 tones. Also harden _fix_articles to collapse a doubled article introduced when a single word is replaced by an article-led phrase ("the the strategy" -> "the strategy"), preserving capitalization and a/an agreement. All 41 tests pass. https://claude.ai/code/session_015REKyF6JmJchTnZWoLth7Y
Repo visibility changed to public, so GitHub Pages can now be enabled and the deploy job (configure-pages with enablement: true) should succeed. https://claude.ai/code/session_015REKyF6JmJchTnZWoLth7Y
A ~2s deploy-job failure on feature branches was GitHub's github-pages environment protection rejecting deployments from a non-default branch. Gate the deploy job with if: github.ref == 'refs/heads/main' so it is skipped (not failed) on branches and runs for real once merged to main, where the environment permits it and the Pages source is GitHub Actions. https://claude.ai/code/session_015REKyF6JmJchTnZWoLth7Y
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f9451a6390
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if ("serviceWorker" in navigator) { | ||
| window.addEventListener("load", () => { | ||
| navigator.serviceWorker.register("./sw.js").catch(() => {}); |
There was a problem hiding this comment.
Register the service worker before loading Pyodide
Because registration is deferred until window.load, and index.html loads the CDN pyodide.js script before app.js, the service worker cannot see or cache that required runtime during a user's first visit. In a fresh install, going offline immediately after the first successful open can leave the PWA unable to reload because the top-level Pyodide script was never placed in the app cache; register earlier or explicitly precache the runtime URLs before advertising first-open offline support.
Useful? React with 👍 / 👎.
| const cached = await caches.match(req); | ||
| if (cached) return cached; |
There was a problem hiding this comment.
Revalidate cached assets after deployments
With a fixed humanizer-v1 cache and this cache-first return, anyone who has opened the PWA keeps receiving the old app.js, humanizer/__files__.json, and package files after a later GitHub Pages deploy unless sw.js/CACHE is also changed. That means future dictionary or core fixes can be invisible to installed users even though the README/iOS wrapper says site updates are picked up automatically; use revisioned cache names/generated manifests or a network-first/stale-while-revalidate path for these app assets.
Useful? React with 👍 / 👎.
| 'increase': ['augment', 'amplify', 'elevate', 'intensify'], | ||
| 'decrease': ['attenuate', 'diminish', 'abate', 'curtail'], | ||
| 'change': ['modification', 'alteration', 'perturbation', 'variation'], | ||
| 'change': ['alter', 'modify', 'revise', 'recalibrate', 'adjust'], |
There was a problem hiding this comment.
Preserve noun-safe replacements for change
The lexical pass does not do POS tagging, so this verb-only override also fires when change is a noun; for example, academic tone can turn We need a change into we demand a reshape/a revise. The previous values were noun phrases, so this introduces ungrammatical output for common noun contexts while fixing imperative verb contexts; keeping alternatives that work as both nouns and verbs or handling noun forms separately would avoid trading one regression for another.
Useful? React with 👍 / 👎.
Summary
Follow-up to PR #2 (merged). PR #2 was merged at
c70307b, just beforethese fixes, so
maincurrently has the regression the automated reviewflagged. This lands the fix.
changeverb regression: the expanded dictionary gavechange,changes, and the per-tone overrides for all 9 tones noun-onlyalternatives, so "change the plan" → "transformation the plan". Restored
verb-form, tone-flavoured replacements everywhere
(professional → "realign the strategy", academic → "modify the strategy",
witty → "flip the grand scheme", …).
(e.g.
plan → "the strategy"); when the original word already had anarticle this produced "the the strategy". Hardened
_fix_articlestocollapse a doubled article, preserving capitalization and a/an agreement.
The curated phrases are intentionally left intact.
Validation
python -m py_compileclean; every tone still ≥ 3,000 effective synonyms.Test plan
testcheck greendeploycheck green now that the repo is public and Pages source ="GitHub Actions" (then the site/PWA is live at
https://carlosa49.github.io/Humanizer-tester/)
https://claude.ai/code/session_015REKyF6JmJchTnZWoLth7Y
Generated by Claude Code