Skip to content

Conversation

@GaryJones
Copy link
Collaborator

Summary

Replaces inline edit with a dedicated full-page edit form, providing better UX and reliable autocomplete support for conditional arguments.

  • Adds new edit page at ?page=ad-code-manager&action=edit&id=X
  • Full-page form with WordPress form-table layout
  • Pre-populates all fields with existing ad code data
  • Autocomplete for conditional arguments using Select2
  • Dynamic show/hide of logical operator based on condition count
  • Removes legacy inline edit functionality (simplifies codebase)

Changes

  • src/class-ad-code-manager.php: Added routing in admin_view_controller() and new render_edit_page() method
  • views/edit-ad-code.tpl.php: New template for edit page
  • src/class-acm-wp-list-table.php: Simplified to just Edit/Delete links, removed inline edit code
  • acm-autocomplete.js: Extended for edit page, added addConditionalRow() function
  • acm.css: Added edit page styles, removed inline edit styles
  • acm.js: Deleted (was only used for inline edit)

Test plan

  • Click "Edit" on an existing ad code → opens dedicated edit page
  • All fields pre-populated with correct values
  • Autocomplete works for conditionals (is_category, is_tag, etc.)
  • "Add another condition" button adds new row
  • "Remove" link removes conditional row
  • Logical Operator shows only with 2+ conditions
  • Submit → redirects to main page with success message
  • Invalid ID shows error with back link

Resolves #195

🤖 Generated with Claude Code

Replace the inline edit functionality with a full-page edit interface that provides clearer layout and better autocomplete support for conditional arguments. The dedicated edit page allows users to see all ad code properties simultaneously without table layout constraints.

The new edit page includes Select2 autocomplete for conditional arguments, dynamically shows or hides the logical operator field based on the number of conditions, and provides a more intuitive editing experience. This change removes the legacy inline edit JavaScript (acm.js), associated CSS styles, and the column_id() and inline_edit() methods from the list table class.

Resolves #195
@GaryJones GaryJones requested a review from a team as a code owner December 21, 2025 22:56
@GaryJones GaryJones self-assigned this Dec 21, 2025
@GaryJones GaryJones added the type: enhancement New feature or request label Dec 21, 2025
@GaryJones GaryJones added this to the 0.8.0 milestone Dec 21, 2025
@GaryJones GaryJones merged commit 6ce120f into develop Dec 21, 2025
17 checks passed
@GaryJones GaryJones deleted the feature/195-dedicated-edit-page branch December 21, 2025 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create dedicated edit page for ad codes

2 participants