Problem
Technical badges currently display variable names only (e.g., has_spell, is_main_quest) without showing the actual values or comparison operators.
This makes it harder to understand what the condition actually checks at a glance.
Scope
Parse and display variable conditions with values:
- Truthiness checks:
if has_spell: → shows as truthy
- Negation:
if not has_drink: → shows as falsy
- String comparisons:
if alignment == "good": → alignment = "good"
- Boolean comparisons:
if has_drink == True: → has_drink = True
- Numeric comparisons (already handled as stats):
if gold > 100: → gold > 100
Implementation
-
Data model update:
type VariableCondition = {
value: string | boolean;
operator: "==" | "!=" | "truthy" | "falsy";
};
variables?: Record<string, VariableCondition>;
-
Parser updates (apps/backend/src/services/rpy-parser.service.ts):
- Detect bare identifiers →
truthy
- Detect
not var_name → falsy
- Detect string comparisons → extract operator and value
- Detect explicit boolean comparisons →
== True, != False, etc.
-
UI updates:
- TechnicalPopover: display variable conditions with operator + value
- LabelPropertiesPanel: same display as popover
- Symbol mapping:
== → =, != → ≠
Backward compatibility
Normalize legacy string[] format to new VariableCondition format with default truthy operator.
Priority
Medium - improves visibility but current functionality works.
Problem
Technical badges currently display variable names only (e.g.,
has_spell,is_main_quest) without showing the actual values or comparison operators.This makes it harder to understand what the condition actually checks at a glance.
Scope
Parse and display variable conditions with values:
if has_spell:→ shows as truthyif not has_drink:→ shows as falsyif alignment == "good":→alignment = "good"if has_drink == True:→has_drink = Trueif gold > 100:→gold > 100Implementation
Data model update:
Parser updates (apps/backend/src/services/rpy-parser.service.ts):
truthynot var_name→falsy== True,!= False, etc.UI updates:
==→=,!=→≠Backward compatibility
Normalize legacy
string[]format to newVariableConditionformat with defaulttruthyoperator.Priority
Medium - improves visibility but current functionality works.