Summary
Several places in the web workspace use magic numbers or inline fallback values instead of named constants. This makes it easy for defaults to diverge across components.
Examples identified
numberOfJurors defaults to 0 in Jurors.tsx but to 3 in other places.
disputeKitId falls back to numeric literal 1 / DisputeKits.Classic in multiple locations (SubmitDisputeButton.tsx, SubmitBatchDisputesButton.tsx, Landing/index.tsx, etc.).
Goal
- Introduce a single source-of-truth constants file (or extend an existing one) in the
web workspace to hold all default/fallback values (e.g. DEFAULT_NB_JURORS = 3, DEFAULT_DISPUTE_KIT_ID = DisputeKits.Classic, etc.).
- Replace all inline literals/fallbacks across the workspace with references to these constants.
References
/cc @tractorss
Summary
Several places in the
webworkspace use magic numbers or inline fallback values instead of named constants. This makes it easy for defaults to diverge across components.Examples identified
numberOfJurorsdefaults to0inJurors.tsxbut to3in other places.disputeKitIdfalls back to numeric literal1/DisputeKits.Classicin multiple locations (SubmitDisputeButton.tsx,SubmitBatchDisputesButton.tsx,Landing/index.tsx, etc.).Goal
webworkspace to hold all default/fallback values (e.g.DEFAULT_NB_JURORS = 3,DEFAULT_DISPUTE_KIT_ID = DisputeKits.Classic, etc.).References
/cc @tractorss