Skip to content

GH#101: respect browser motion preferences and filter control reveal - #121

Draft
superdav42 wants to merge 4 commits into
masterfrom
feature/auto-20261015-125859-gh101
Draft

superdav42 wants to merge 4 commits into
masterfrom
feature/auto-20261015-125859-gh101

Conversation

@superdav42

@superdav42 superdav42 commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Resolves #101. Updated to follow the requested browser/filter policy rather than adding an admin option.

  • Remove the proposed Reduced Motion checkbox, option default, and sanitization entry. No new admin setting remains.
  • Respect prefers-reduced-motion: reduce for every button theme.
  • Add sce_skip_control_reveal (default boolean, comment ID). Its default is true when WP ULike is active, detected by WP_ULIKE_VERSION, so SCE does not add a decorative fade beside ULike's buttons. Plugins can return true or false; false never overrides the browser's reduced-motion preference.
  • Keep the normal 0.6-second reveal otherwise. Controls still wait for an affirmative uncached permission response, including unlimited editing; failed checks stay hidden and outside keyboard navigation. This removes decorative delay, not the authorization round trip or differences in independent plugin rendering times.
  • Merge current master, preserving the dynamic-comment initializer and WooCommerce changes.

Files and patterns

  • simple-comment-editing.php: existing wrapper-class/filter pattern, with the documented per-comment reveal filter.
  • src/scss/frontend.scss: hidden/pending controls and theme-independent reduced-motion overrides.
  • src/js/comment-editing/editing.js: affirmative can_edit requirement and fail-closed permission errors, preserving repeat-safe initialization.
  • dist/sce-editing.js, dist/sce-frontend.css, dist/sce-frontend.css.map: rebuilt using the existing webpack command.
  • README.md, readme.txt, DESIGN.md: filter contract, browser precedence, caching/authorization limits and motion policy.
  • includes/Options.php and includes/Admin/Tabs/Settings.php now match master; the proposed setting has been removed entirely.

Verification

Implementation head: 9e250eb (plus the resolved master merge 8f4ed54).

Passed locally:

git diff --check
php -l simple-comment-editing.php
composer phpcs -- includes/Options.php includes/Admin/Tabs/Settings.php simple-comment-editing.php
php -d memory_limit=1G vendor/bin/phpstan analyse --memory-limit=1G simple-comment-editing.php includes/Options.php includes/Admin/Tabs/Settings.php
npx --no-install eslint src/js/comment-editing/editing.js
npm run build

PHPCS: no errors, four existing direct-database warnings in unchanged cleanup queries. Scoped PHPStan: no errors. ESLint: no errors, six existing warnings. Webpack succeeds with the existing admin-bundle size/performance warnings; unrelated admin-bundle regeneration drift was discarded.

The existing focused PHPUnit command was attempted but exits before running: Set WP_TEST_DB_NAME to a disposable database ending in _test. The development site's database was not used for PHPUnit. Current-head CI remains required; old-head green checks are not evidence for this update.

Real-browser verification

Tested the actual built PR worktree on the configured WordPress site with Twenty Twenty-Five, using separate named Chromium sessions for the guest owner, subscriber and non-owner. The shared plugin symlink was switched with operator permission; stale local PHP bootstrap caching was resolved by an operator-authorized graceful PHP reload.

Check Observed result
WP ULike 5.2.4 inactive, normal motion No ULike markup; authorized SCE controls use showContainer, duration 0.6s.
Browser reduced motion Computed animation is none.
WP ULike active, normal motion Both plugins render comment controls; SCE wrapper has sce-reduced-motion, computed animation none.
Filter returns false with ULike active Normal browser uses showContainer; reduced-motion browser still uses none.
Filter returns true without ULike Computed animation is none. Temporary filter consumer removed afterward.
Guest submission, Save, Cancel and timer Submitted in the browser; Save persisted with ULike active and inactive, verified via WP-CLI; Cancel restored saved text; countdown updated.
Subscriber Own timed controls and Save verified; existing unlimited-editing filter scoped to its fixture produced authorized controls without a timer. Enter opened the textarea; Cancel restored its saved content. Temporary policy removed afterward.
Non-owner No editor markup; a request with a valid general nonce returned can_edit: false.
Expiry Expiring the owned guest fixture removed its editor on reload.
Permission failure Invalidated permission nonce returned HTTP 403; controls remained visibility: hidden, with the request error in the status region.
Layout Viewport screenshots inspected at 1280x900 and 390x844 with and without ULike; timer wraps on mobile without horizontal overflow.
Diagnostics Fresh subscriber reload has no console/page errors; permission and Save requests returned 200 in successful flows. Deliberate invalid-nonce requests returned 403.

Separate compatibility finding: WP ULike's like button disappears after guest inline Save until reload. Saved text persists, and reload restores the button. Tracked independently in #123; do not treat this as a complete ULike integration sign-off. Its response/formatting sources are unchanged by this PR.

Temporary fixture post/comments/user and integration policies are removed after testing; ULike is restored to inactive. The site and authorized PR worktree symlink remain available for follow-up. No release, merge, or live deployment is included.


aidevops.sh v3.39.36 plugin for OpenCode

@superdav42 superdav42 added the origin:worker Created by headless/pulse worker session label Oct 15, 2026
@superdav42

Copy link
Copy Markdown
Collaborator Author

Implementation Checkpoint

  • What: Opt-in reduced-motion controls, automatic browser reduced-motion support, and fail-closed permission-dependent visibility; implementation is preserved, not yet runtime-verified.
  • Issue: Offer reduced-delay edit controls without weakening server-side authorization #101.
  • Files changed: Options/settings, permission-checked wrapper rendering, frontend JS/SCSS and generated JS/CSS/source map, DESIGN.md, and readme.txt.
  • Testing: PHP syntax, scoped PHPCS, scoped ESLint, webpack build, and diff whitespace checks pass. Existing warnings are distinguished from introduced failures in the PR. PHPUnit cannot run without a configured disposable _test database; actual WordPress/browser acceptance remains unverified.
  • Key decisions: Preserve the authoritative AJAX permission round trip for timed and unlimited editing; do not infer ownership from cached HTML or reveal controls on request failure. Reduced motion removes only decoration, never authorization. Personalized author HTML still requires shared-cache exclusion.
  • Readiness: Draft remains blocked on the isolated SCE runtime/test database described in the PR. No merge, issue closure, release, or deployment is claimed.

aidevops.sh v3.39.27 plugin for OpenCode v1.19.0 with gpt-6.1-sol spent 9m and 149,287 tokens on this as a headless worker.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@superdav42 superdav42 changed the title GH#101: feat: offer reduced-motion edit controls GH#101: respect browser motion preferences and filter control reveal Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

origin:worker Created by headless/pulse worker session

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Offer reduced-delay edit controls without weakening server-side authorization

1 participant