Skip to content

Refresh the help and rules pages, and fix the popup at longer translations - #133

Merged
forgetso merged 1 commit into
masterfrom
help-rules-popup-refresh
Sep 21, 2026
Merged

forgetso merged 1 commit into
masterfrom
help-rules-popup-refresh

Conversation

@forgetso

Copy link
Copy Markdown
Owner

Screenshots

Every popup screenshot was out of date — they showed the green-and-white redesign that was never shipped, and some illustrated nothing at all (setup-wordpress-6.png had empty fields and no options ticked).

scripts/screenshots.mjs (npm run screenshots) now renders assets/popup.html itself over the DevTools Protocol, so the images can't drift from the real markup or style.css again. Each shot is written at 1x and 2x and offered through srcset — a 2x image displayed at half size is visibly soft on an ordinary monitor. 15 obsolete images are deleted, which were shipping ~500 KB of dead weight in the release zip.

--headless=new --screenshot couldn't be used: it gives a viewport ~87 CSS px shorter than the requested --window-size while writing an image of the full requested size, so the popup's footer was silently cropped out of every shot.

Help text

Was Now
"WordPress is currently on version 6.6, as of March 2023", with separate WP5/WP6 setups The extension reaches into the block editor's own frame, so no special options are needed
Save_apply_p1 ended mid-sentence: "These will take and re-opened your browser." Fixed
Contents linked #case; the heading's id was Matching_case Dead anchor fixed
Two strings described checkboxes that don't exist ("Visible elements only?", "Only change visible content?") Removed

Added an option-by-option reference, a section on History/Swap/language, and a troubleshooting checklist.

Design

New assets/pages.css for the two full-tab pages, in the popup's greys, with Bootstrap dropped from them (232 KB of CSS for a handful of utility classes). Help gets a sticky contents rail with scrollspy, section cards, framed figures and callouts; Saved Rules gets a card grid.

In the popup, About is rebuilt with the version, author, licence and links, and History entries — previously a bare term -> term string on white and grey stripes that ran off the edge — are now cards that wrap and list the options that were set.

Fitting the popup

Rendered the popup in all 10 locales and had it report any element wider than its box:

  • "Reemplazar Todo" and "Заменить все" were clipped by the popup edge. Three things stopped the buttons sizing to their labels: white-space: nowrap; flex: 1 1 0 combined with the blanket button { width: 100% }, which made the basis resolve to the full row width for both so they always collapsed to exact halves; and Bootstrap's 16px .btn, oversized next to the popup's 13px body text.
  • Chrome caps a popup at 600px and then scrolls the whole thing. History with 10 entries came to 806px, and the form was already over in German (609), Spanish (607) and Russian (627) because the longer checkbox labels wrap.
form history
en 590 → 554 806 → 590
de 609 → 573 806 → 590
es 607 → 571 806 → 590
ru 627 → 591 806 → 590

Also fixed

  • No change event was ever dispatched, only input. Enough for React, but Angular's ngModel, jQuery .change() handlers and plain onchange attributes never saw the replacement, so the site kept using the pre-replacement text. This is the likely cause of the store report about Jira changes only appearing after clicking save — I could not reproduce against a real Jira instance, so it's a strong lead rather than a confirmed fix. All six dispatch sites now go through one helper firing a real InputEvent (inputType: 'insertText') then change, both composed. Replacements outside inputs also announced themselves three times over.
  • Saved rule fields couldn't show a URL pattern longer than the card — now auto-growing textareas that wrap.
  • The Replace Term field was labelled "Search Term"; rule inputs had no name attribute and duplicated ids across cards (getFieldValue relies on form.elements.namedItem); values weren't HTML-escaped.
  • version_number was a duplicated id, so the footer copy was never set.

Translations

All 131 strings are translated into all 10 locales. scripts/merge-locale.mjs merges a batch of translations and reorders a locale file to match English. Nine now-inaccurate translations of the old WordPress paragraph were dropped rather than left saying something untrue.

Checks

npm run checks passes — typecheck, lint, format, 627 tests, build.

🤖 Generated with Claude Code

…tions

Screenshots
  Every popup screenshot was stale: they showed the green-and-white redesign
  that was never shipped, and some illustrated nothing at all (the WordPress
  one had empty fields and no options ticked). scripts/screenshots.mjs now
  renders assets/popup.html itself over the DevTools Protocol, so the images
  cannot drift from the real markup again. Run with `npm run screenshots`.

  Each shot is written at 1x and 2x and offered through srcset: a 2x image
  displayed at half size is visibly soft on an ordinary monitor. 15 obsolete
  images are deleted, which were shipping ~500KB of dead weight in the zip.

Help text
  The WordPress section claimed "WordPress is currently on version 6.6, as of
  March 2023" and gave separate WP5/WP6 setups; the extension now reaches into
  the block editor's own frame, so no special options are needed. Save_apply_p1
  ended mid-sentence. The contents list linked #case while the heading's id was
  Matching_case. Two strings described checkboxes that do not exist. Added an
  option-by-option reference, a section on History/Swap/language, and a
  troubleshooting checklist.

Design
  New assets/pages.css for the two full-tab pages, in the popup's greys, with
  Bootstrap dropped from them: 232KB of CSS for a handful of utility classes.
  Help gets a sticky contents rail with scrollspy, section cards, framed
  figures and callouts. Saved Rules gets a card grid.

Popup
  About is rebuilt with the version, author, licence and links. History entries
  were a bare "term -> term" string on white and grey stripes that ran off the
  edge; they are now cards that wrap, listing the options that were set.

Fitting
  "Reemplazar Todo" and "Заменить все" were clipped by the popup edge, and the
  form ran past the 600px at which Chrome scrolls the whole popup in German,
  Spanish and Russian. Every section now fits in all ten locales.

Also fixed
  - No `change` event was ever dispatched, only `input`, so sites wired to
    Angular's ngModel, jQuery handlers or plain onchange attributes kept using
    the pre-replacement text. This is the likely cause of the Jira report about
    changes only appearing after clicking save. Replacements outside inputs
    also announced themselves three times over.
  - Saved rule fields could not show a URL pattern longer than the card.
  - The Replace Term field was labelled "Search Term", rule inputs had no name
    attribute and duplicated ids across cards, and values were not escaped.
  - version_number was a duplicated id, so the footer copy was never set.

All 131 strings are translated into all ten locales; scripts/merge-locale.mjs
merges a batch of translations and reorders a locale file to match English.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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