Part of #118 (dedx_extra.c migration) · Phase B.
Problem
dedx_get_material_name() returns raw ALL-CAPS identifiers with no spacing (e.g. WATER, CARBONDIOXIDE, TISSUE_EQUIVALENTGAS_METHANEBASED). Human-readable display names — with critical disambiguation such as Water (liquid) vs Water Vapor — currently live in two hand-maintained copies that will inevitably drift:
- C:
dedx_get_material_friendly_name() in wasm/dedx_extra.c (151 overrides, currently static and not even exported). Its own comment says "Intended for future inclusion in libdedx as a public API function."
- TypeScript:
MATERIAL_NAME_OVERRIDES in src/lib/config/material-names.ts (151 entries).
Proposed change
Promote the override table into libdedx as a public function:
/** Human-readable display name for a material, with disambiguation
* (e.g. "Water (liquid)" vs "Water Vapor"). Falls back to the raw
* dedx_get_material_name() for unmapped ids. */
const char *dedx_get_material_display_name(int material);
Make this C table the single source of truth and remove the duplicate from dedx_web (either expose it through the WASM build, or generate the TS table from it at build time with a drift-guard check).
Open decision
Does C return fully-formatted names for all materials, or C-overrides + a documented title-case fallback that the binding still applies for un-overridden elemental names? (See §6 of the migration plan.)
Acceptance criteria
Filed via Claude Code as part of the dedx_extra.c → libdedx migration plan.
Part of #118 (dedx_extra.c migration) · Phase B.
Problem
dedx_get_material_name()returns raw ALL-CAPS identifiers with no spacing (e.g.WATER,CARBONDIOXIDE,TISSUE_EQUIVALENTGAS_METHANEBASED). Human-readable display names — with critical disambiguation such as Water (liquid) vs Water Vapor — currently live in two hand-maintained copies that will inevitably drift:dedx_get_material_friendly_name()inwasm/dedx_extra.c(151 overrides, currentlystaticand not even exported). Its own comment says "Intended for future inclusion in libdedx as a public API function."MATERIAL_NAME_OVERRIDESinsrc/lib/config/material-names.ts(151 entries).Proposed change
Promote the override table into libdedx as a public function:
Make this C table the single source of truth and remove the duplicate from dedx_web (either expose it through the WASM build, or generate the TS table from it at build time with a drift-guard check).
Open decision
Does C return fully-formatted names for all materials, or C-overrides + a documented title-case fallback that the binding still applies for un-overridden elemental names? (See §6 of the migration plan.)
Acceptance criteria
dedx_get_material_display_name()declared ininclude/dedx.h, defined with the override table.dedx_get_material_name().Filed via Claude Code as part of the
dedx_extra.c→ libdedx migration plan.