Skip to content

refactor: DRY maint page layout wrapper#46

Open
somethingwithproof wants to merge 1 commit intoCacti:developfrom
somethingwithproof:fix/dry-layout-45
Open

refactor: DRY maint page layout wrapper#46
somethingwithproof wants to merge 1 commit intoCacti:developfrom
somethingwithproof:fix/dry-layout-45

Conversation

@somethingwithproof
Copy link

Summary

  • add shared maint_render_with_layout() helper for page layout wrappers
  • route edit and default action rendering in maint.php through the helper
  • preserve existing behavior while reducing duplicated top_header()/bottom_footer() wrapper logic

Tests

  • php -l maint.php
  • php -l ui_helpers.php
  • php -l tests/test_layout_wrapper.php
  • php tests/test_layout_wrapper.php

Closes #45

Copilot AI review requested due to automatic review settings March 15, 2026 23:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Extracts repeated top_header()/bottom_footer() wrapping into a shared maint_render_with_layout() helper in a new ui_helpers.php file, and routes the edit and default actions through it.

Changes:

  • New ui_helpers.php with maint_render_with_layout() helper
  • maint.php routes edit and default actions through the new helper
  • New standalone test verifying wrapper call ordering and routing

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
ui_helpers.php New shared layout wrapper function
maint.php Include helper and use it for edit/default actions
tests/test_layout_wrapper.php Regression test for wrapper behavior and routing

You can also share your feedback on Copilot code review. Take the survey.

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.

refactor: DRY maint page layout wrapper

2 participants