Skip to content

Redesign Topic Prefixes into Tagging system - #35

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

iMattPro wants to merge 32 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

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (eba4b2d) to head (362dc14).

Additional details and impacted files
@@              Coverage Diff              @@
##             master       #35      +/-   ##
=============================================
+ Coverage     99.11%   100.00%   +0.88%     
- Complexity       83       260     +177     
=============================================
  Files             7        12       +5     
  Lines           225       930     +705     
=============================================
+ Hits            223       930     +707     
+ Misses            2         0       -2     

☔ 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
Comment thread migrations/v200_data.php Outdated
Comment thread migrations/v200_data.php
Comment thread migrations/v200_data.php Outdated
@rxu

rxu commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Tested it on 3.3.17 a bit.
Updating from Topic tags v.1 worked fine.
Creating, copying, merging topics worked fine.
Filtering by tag worked fine.

When you create a topic f.e. with tags One and Two, then you disable tag Two, the tag disappears from the filters, but is still displayed beside the topic title. Then, when you click it beside the topic title, it gets back again to the filters list together with topics filtering process. Not sure what should be the correct behavior, but probably if you disable a tag while already there're existing topics with such a tag, it shouldn't be removed from filters list (because it's still appears becide topic titles and works for filtering anyway).

2026-09-23.130438.mp4

@iMattPro

Copy link
Copy Markdown
Contributor Author

That is the intended behavior. When disabled you can't assign it any more and it's not part of the filter list by default. But existing topic assignments remain visible. If you click on it then it only appears in the filter list because it's currently being used as a filter and so you can unclick it to stop filtering with it. So it only appears in the filter list if it's being used as a filter otherwise it won't be shown.

In other words when disabled it's removed from assigning and filter panel by default. But when interacting with topics that already have it, it appears so you can unassign it or filter/unfilter with it. This is also true for the behavior when a topic is moved to a forum where the tag is not assigned to - you can still see it and unassign or filter/unfilter them.

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.

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

4 participants