Skip to content

primitives mappings and selections

Douwe de Vries edited this page Jul 2, 2026 · 1 revision

Mappings and selections

Active contributors: Douwe de Vries

Purpose

Mappings and selections define which rows line up and which values are compared. They appear in comparison requests, pair-order files, snapshots, frontend state, and result exports.

Key abstractions

Name File Description
MappingSelectionState frontend/src/types/ui.ts Frontend selected row keys and comparison columns.
PairOrderSelection src/backend/requests.rs, frontend/src/types/api.ts Persisted selected column order.
ColumnMapping src/data/types.rs File A/File B mapping plus mapping type.
MappingDto frontend/src/types/api.ts Frontend mapping transfer shape.
MappingType src/data/types.rs Exact, manual, or fuzzy mapping provenance.

How it works

The frontend builds manual mappings from parallel comparison-column arrays in frontend/src/components/MappingConfig.tsx. The backend validates that all selected labels exist, that comparison counts match, and that explicit mappings cover each selected comparison column exactly once.

Integration points

Auto-pair uses backend suggestions from src/comparison/mapping.rs and frontend confidence filtering in frontend/src/features/mapping/autoPair.ts. Persistence uses src/backend/pair_order.rs and src/backend/persistence/v1/mod.rs.

Key source files

File Purpose
frontend/src/types/ui.ts Frontend selection state.
frontend/src/types/api.ts Mapping and pair-order DTOs.
src/backend/requests.rs Request and persisted selection DTOs.
src/data/types.rs Backend mapping types.
src/backend/validation.rs Selection and mapping validation.

See mapping and auto-pair for the user workflow.

Clone this wiki locally