Skip to content

refactor(web): consolidate default/fallback values into named constants #2358

Description

@coderabbitai

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions