Skip to content

Redesign Topic Prefixes into Tagging system - #35

Open
iMattPro wants to merge 66 commits into
phpbb-extensions:masterfrom
iMattPro:redesign
Open

iMattPro wants to merge 66 commits into
phpbb-extensions:masterfrom
iMattPro:redesign

Conversation

@iMattPro

@iMattPro iMattPro commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Updates the topic title prefixing into a full fledges topic tagging system with filtering/search and prettier badges.

Will require this PR: phpbb/phpbb#7052 - adds events that will allow the tags to appear in most places where topics appear (such as in UCP and MCP panels).

ACP panel
Screenshot 2026-09-23 at 5 53 37 PM

Posting panel:
Screenshot 2026-09-20 at 6 43 24 AM

Viewing forum:
Screenshot 2026-09-23 at 5 52 50 PM

Viewing topic:
Screenshot 2026-09-23 at 5 53 16 PM

Closes #17
Closes #18

@codecov-commenter

codecov-commenter commented Sep 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.69976% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.67%. Comparing base (eba4b2d) to head (52fbd8b).

Files with missing lines Patch % Lines
controller/admin_controller.php 88.83% 22 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #35      +/-   ##
============================================
- Coverage     99.11%   98.67%   -0.44%     
- Complexity       83      474     +391     
============================================
  Files             7       15       +8     
  Lines           225     1736    +1511     
============================================
+ Hits            223     1713    +1490     
- Misses            2       23      +21     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

A nonexistent phpBB lifecycle event leaves ACP-relocated topics without tags, and global-topic badges produce inaccessible no-op links.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Redesigns topic prefixes as relational, multi-tag metadata with filtering, colored badges, lifecycle handling, and legacy-data migration.

Changes:

  • Adds tag management, rendering, filtering, and phpBB event integrations.
  • Migrates legacy prefixes into normalized tag relationships.
  • Replaces legacy tests and UI with comprehensive tagging coverage.
File Description
tests/​tags/​renderer_test.php Tests badge rendering and filter URLs.
tests/​event/​viewforum_listener_test.php Tests forum filtering and pagination.
tests/​event/​posting_listener_test.php Tests posting and editing assignments.
tests/​event/​listener_test.php Removes legacy listener tests.
tests/​event/​lifecycle_listener_test.php Tests lifecycle tag preservation.
tests/​event/​display_listener_test.php Tests tags across display surfaces.
tests/​dbal/​tags_base.php Adds shared database test setup.
tests/​dbal/​tag_manager_test.php Tests tag catalog and CRUD behavior.
tests/​dbal/​simple_test.php Removes legacy schema test.
tests/​dbal/​manager_update_prefix_test.php Removes legacy update tests.
tests/​dbal/​manager_prepend_prefix_test.php Removes title-prefix tests.
tests/​dbal/​manager_move_prefix_test.php Removes legacy ordering tests.
tests/​dbal/​manager_get_prefixes_test.php Removes legacy retrieval tests.
tests/​dbal/​manager_get_prefix_test.php Removes single-prefix tests.
tests/​dbal/​manager_get_active_prefixes_test.php Removes active-prefix tests.
tests/​dbal/​manager_delete_prefix_test.php Removes legacy deletion tests.
tests/​dbal/​manager_base.php Removes legacy test base.
tests/​dbal/​manager_add_prefix_test.php Removes legacy creation tests.
tests/​dbal/​legacy_migration_test.php Tests legacy data conversion.
tests/​dbal/​fixtures/​topic_tags.xml Adds relational tag fixtures.
tests/​dbal/​fixtures/​topic_prefixes.xml Removes legacy fixtures.
tests/​dbal/​filter_test.php Tests multi-tag filtering.
tests/​dbal/​assignment_manager_test.php Tests assignment persistence and copying.
tests/​controller/​move_prefix_test.php Removes legacy controller test.
tests/​controller/​main_test.php Removes legacy routing test.
tests/​controller/​edit_prefix_test.php Removes legacy editing test.
tests/​controller/​display_settings_test.php Removes legacy display test.
tests/​controller/​delete_prefix_test.php Removes legacy deletion test.
tests/​controller/​admin_controller_test.php Tests new ACP tag controller.
tests/​controller/​admin_controller_base.php Removes legacy controller fixture.
tests/​controller/​add_prefix_test.php Removes legacy creation test.
tests/​acp/​acp_module_test.php Updates namespaced ACP tests.
tags/​renderer.php Builds badges and filter URLs.
tags/​manager.php Manages tag definitions and availability.
tags/​filter.php Implements tag-aware SQL filtering.
styles/​all/​theme/​topic_tags.css Styles badges and controls.
styles/​all/​template/​topic_tag_badges.html Renders reusable tag badges.
styles/​all/​template/​event/​viewtopic_topic_title_prepend.html Adds view-topic badges.
styles/​all/​template/​event/​viewforum_body_topic_row_before.html Adds forum filter controls.
styles/​all/​template/​event/​topiclist_row_prepend.html Adds topic-list badges.
styles/​all/​template/​event/​search_results_topic_title_prepend.html Adds post-search badges.
styles/​all/​template/​event/​posting_editor_subject_before.html Adds tag checkboxes.
styles/​all/​template/​event/​overall_header_head_append.html Loads frontend tag styles.
styles/​all/​template/​event/​mcp_forum_topic_title_before.html Adds MCP badges.
README.md Documents the tagging system.
prefixes/​nestedset_prefixes.php Removes nested-set implementation.
prefixes/​manager.php Removes legacy prefix manager.
prefixes/​manager_interface.php Removes legacy manager interface.
migrations/​v200_schema.php Adds relational tagging schema.
migrations/​v200_data.php Migrates legacy prefix data.
migrations/​v200_cleanup.php Removes obsolete columns.
language/​en/​topic_prefixes.php Adds frontend tag messages.
language/​en/​info_acp_topic_prefixes.php Updates ACP metadata and logs.
language/​en/​acp_topic_prefixes.php Adds ACP tag language.
ext.php Raises runtime requirements.
event/​viewforum_listener.php Integrates filters and forum badges.
event/​posting_listener.php Validates and saves assignments.
event/​listener.php Removes legacy listener.
event/​lifecycle_listener.php Handles topic lifecycle operations.
event/​display_listener.php Integrates non-forum displays.
config/​tables.yml Registers relationship tables.
config/​services.yml Registers tag services and listeners.
composer.json Declares version 2 requirements.
CHANGELOG.md Documents the 2.0 redesign.
adm/​style/​acp_topic_prefixes.js Removes obsolete forum switching.
adm/​style/​acp_topic_prefixes.html Rebuilds the ACP interface.
adm/​style/​acp_topic_prefixes.css Styles ACP badges and controls.
acp/​topic_prefixes_module.php Updates the ACP page title.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread event/lifecycle_listener.php Outdated
Comment thread styles/all/template/topic_tag_badges.html
@iMattPro
iMattPro requested a review from rxu September 20, 2026 21:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Disabled assigned tags are incorrectly exposed as available forum filter choices.

Review effort: Balanced
Findings: None

Resolved since last review (2)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Prevent disabled tags from appearing as filter choices

event/​viewforum_listener.php:125

Disabled tags become visible as filter choices whenever they remain assigned to a moved/global topic. This bypasses the enabled-only filtering above; the later loop already restores a disabled tag when it is actually selected, so only enabled unavailable tags should be added here.

@rxu rxu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Couldn't really test the functionality due to phpBB 3.3.18 requirement (new events are pending to be merged probably).

Comment thread migrations/v200_data.php Outdated
Comment thread migrations/v200_data.php Outdated
Comment thread migrations/v200_data.php
Comment thread migrations/v200_data.php Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Legacy-data rewrites require human upgrade validation, and unresolved access-control and pagination issues need correction.

Review effort: Balanced
Findings: 1 High severity

Open (1)
Resolved since last review (2)
Previously missed (3)

In code that hasn't changed since last review

Medium severity Remove badge gradient to preserve calculated contrast

adm/​style/​acp_topic_prefixes.css:15

This white gradient undermines the ACP badge contrast calculated from the solid background. For the default #4A76A8, the renderer selects white text, but contrast drops from 4.72:1 on the base color to 3.41:1 at the gradient midpoint, below 4.5:1 for normal-sized text. Remove the overlay so the rendered background matches the contrast calculation.

Medium severity Revalidate pagination offset against the filtered topic count

event/​viewforum_listener.php:143

phpBB has already validated start against the unfiltered forum count before this event runs. A stale filtered URL with start=100 and only 10 matching regular topics therefore keeps an invalid offset: at 25 topics per page, the reverse query returns one topic and pagination reports “page 5 of 1.” Revalidate the offset against the filtered count through a hook that exposes start, before reverse-query offsets and pagination are calculated.

Medium severity Preserve selected tags in the pagination base URL

event/​viewforum_listener.php:208

The pagination hook preserves tags in individual page links, but phpBB subsequently assigns the unfiltered URL to BASE_URL. The “Jump to page” control uses that value when there are more than six pages, so jumping drops the selected tags. This core.viewforum_modify_topics_data callback runs after pagination generation; update BASE_URL here with the selected tags and saved sorting parameters.

Comment thread event/display_listener.php Outdated
@iMattPro
iMattPro force-pushed the redesign branch 2 times, most recently from 1f5a1ed to 29c5aa4 Compare October 7, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature request] Copy prefixes Feature suggestions to improve the functionality and visual design this extension

5 participants