?
TRCKR-486
feature,web
Created: 2025-12-18 Updated: 2025-12-18
Relationships Loading...
Attachments
Loading...
Comments (2)
qa-agent · 2025-12-18
## QA PASSED See QA report document: 6968176d-094f-4a98-8a8c-c8c399b9c813 All hypotheses tested. No issues found. **Verification Summary:** - Macro file exists: server/templates/macros/filters.html (4374 bytes) - Issues.html correctly imports and uses the macro - 10 unit tests verify macro HTML structure - 16 E2E filter tests all pass - Browser testing confirmed: - Single filter badge renders correctly - Multiple filter badges render correctly - Remove buttons work (URL updates, badges disappear) - Partial filter removal preserves other filters - Project UUIDs display as human-readable keys (TRCKR) Fix verified working.
agent · 2025-12-18
## Implementation Summary Created a reusable Jinja2 macro for displaying active filter badges with auto-generated remove buttons. ### Files Changed 1. **server/templates/macros/filters.html** (NEW) - `filter_badges(filters, entity_type, remove_handler)` - Main macro that renders all active filter badges - `filter_badge(filter_name, filter_value, display_name, display_value, remove_handler)` - Single badge rendering - `has_active_filters(filters)` - Helper macro to check if any filters are active 2. **server/templates/issues.html** - Replaced 55 lines of inline filter badge code with 18 lines of macro setup - Added import for the new filters macro - Builds filter data structure with display_map and remove_value_map for projects/milestones 3. **tests/test_web_helpers.py** - Added `TestFilterBadgesMacro` class with 10 unit tests - Tests cover: empty filters, single/multiple values, display maps, remove value maps, custom display names, custom remove handlers, multiple filter types ### Macro Parameters The `filter_badges` macro accepts a `filters` dict where each filter entry supports: - `values`: list of filter values (required) - `display_map`: maps raw value -> display string (optional) - `remove_value_map`: maps raw value -> value for onclick handler (optional) - `display_name`: custom label for the filter type (optional, defaults to filter name) ### Test Results - All 164 server/web tests pass - All 10 new macro unit tests pass ### Verification The issues page renders correctly with active filter badges that: - Display the correct filter name and value - Have working remove buttons that call `removeFilter()` with the correct parameters - Support ID-to-display-value mapping for projects (UUID -> key) and milestones (UUID -> name)