Use shared item axis context in role routes

This commit is contained in:
2026-06-27 18:18:47 +02:00
parent 867916ee51
commit 6a65f7d35c
11 changed files with 100 additions and 52 deletions
+6 -4
View File
@@ -5,6 +5,11 @@ import re
from string import Formatter
from typing import Any, Callable
try:
from . import item_axis_policy
except ImportError: # Allows local smoke tests with top-level imports.
import item_axis_policy
HARDCORE_POSITION_FAMILY_CHOICES = [
"any",
@@ -847,10 +852,7 @@ def hardcore_source_position_family(subcategory: dict[str, Any], config: dict[st
def hardcore_position_keys(*parts: Any, axis_values: dict[str, Any] | None = None) -> list[str]:
text_parts = [str(part or "") for part in parts if str(part or "").strip()]
if isinstance(axis_values, dict):
text_parts.extend(str(value or "") for value in axis_values.values() if str(value or "").strip())
text = " ".join(text_parts).lower()
text = item_axis_policy.context_text(*parts, axis_values=axis_values)
if not text:
return []
keys: list[str] = []