fix: resolve DuplicateIdError by including search_term in drug-fragment badge IDs (Task 7.1)

Badge IDs changed from f"{directorate}|{frag}" to f"{directorate}|{search_term}|{frag}"
to handle fragments appearing under multiple indications within the same directorate.
Callback parsing updated to use rsplit("|", 1)[-1] for the 3-part key.
This commit is contained in:
Andrew Charlwood
2026-02-06 15:19:18 +00:00
parent 54b4a0f743
commit 7be136ac87
3 changed files with 64 additions and 5 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ def _make_directorate_card(directorate: str, indications: dict[str, list[str]])
children=[
dmc.Badge(
frag,
id={"type": "drug-fragment", "index": f"{directorate}|{frag}"},
id={"type": "drug-fragment", "index": f"{directorate}|{search_term}|{frag}"},
variant="light",
size="sm",
className="drawer-drug-badge",