refactor: DRY evidence tab page wrapper - #23
Open
somethingwithproof wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the Evidence tab page to remove duplicated “wrapper” rendering logic by introducing a shared helper and routing tab actions through it, with a small regression test to ensure wrapper call order and that the helper is used.
Changes:
- Added
evidence_render_tab_page()helper to centralizegeneral_header()→evidence_display_form()→ content →bottom_footer()ordering. - Updated
evidence_tab.phpto use the helper for thefindand default actions. - Added a lightweight regression test validating wrapper call order and asserting the new helper calls exist in source.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
include/ui_helpers.php |
Adds shared evidence_render_tab_page() wrapper helper. |
evidence_tab.php |
Routes find and default actions through the new helper and includes it. |
tests/test_tab_wrapper.php |
Adds a standalone regression test for wrapper order and helper usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
This was referenced Apr 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements issue #22 by removing duplicated evidence tab page wrapper logic.
Changes
evidence_render_tab_page()ininclude/ui_helpers.phpevidence_tab.php:findaction now usesevidence_render_tab_page('evidence_find')evidence_render_tab_page('evidence_stats')tests/test_tab_wrapper.phpValidation
php -l evidence_tab.phpphp -l include/ui_helpers.phpphp -l tests/test_tab_wrapper.phpphp tests/test_tab_wrapper.phpIssue
Closes #22