# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [5.0.2] - 2026-08-13

### Fixed

- Displayed `Submitting...` instead of `Loading survey...` while a response is being submitted.

### Security

- Replaced the vulnerable `extract-zip` development dependency through the patched Puppeteer browser manager.

## [5.0.1] - 2026-08-12

### Fixed

- Rendered survey labels as paragraphs so embedded pages keep control of their heading hierarchy.
- Kept untouched required Survey Fields silent while respondents type, with invalid email feedback shown after a 1.5-second pause.

## [5.0.0] - 2026-08-11

### Changed

- Survey bootstrap now sends the same current Session Data as response submission, defaulting to an empty object.
- Public survey configuration no longer receives or validates the private Session Data schema; `SESSION_DATA_REQUIRED` and `SESSION_DATA_SCHEMA_MISMATCH` now block rendering with the backend message.
- Reassigning Session Data resets and refetches the survey so a corrected integration can recover.

### Breaking Changes

- When a survey defines a Session Data schema, integrations must provide every field with the exact key and type before the survey renders.

## [4.0.1] - 2026-07-22

### Changed

- Standardized error states as dark-red text on faint-red cards with consistent spacing and typography.

## [4.0.0] - 2026-07-21

### Changed

- Load and unknown-step errors now render their message and, when applicable, the troubleshooting link without an embedded recovery action.
- Simplified timeout errors and the unknown-step message.

### Breaking Changes

- Removed the built-in `Try again` control, retry routing, and the public `retry-button` CSS part from component errors.

## [3.0.4] - 2026-07-10

### Fixed

- Preserved the public API's permanent-disabled message on survey load.

### Changed

- Removed ES5/`nomodule` output, enforced unit-test coverage floors, and documented the evergreen-browser requirement.
- Removed browser-storage progress persistence; every survey load now starts a fresh response.

## [3.0.3] - 2026-07-10

### Changed

- Replaced detailed Session Data validation failures with a consistent integration message while retaining diagnostic details in `sfError`.
- Added the current hostname to unauthorized-origin errors and improved the external troubleshooting link styling.
- Centered the free-tier attribution footer and separated the muted "Powered by" label from the SenseFolks link.

## [3.0.1] - 2026-07-03

### Fixed

- Moved MaxDiff and Pairwise initialization out of render paths to avoid render-time state updates in Stencil.

## [3.0.0] - 2026-07-02

### Changed

- Renamed the public `embedContext` property to `sessionData` across the component API, submitted response payloads, types, and documentation.
- Added schema-aware Session Data validation for host-provided values.

### Breaking Changes

- Integrations must pass host-provided response context through `sessionData`; `embedContext` is no longer supported.

## [2.0.0] - 2026-06-19

### Added

- Hardened npm package metadata and release workflow for trusted publishing.
- Added timeout/status-aware fetch handling, encoded survey keys, stale request protection, stricter UUID/config validation, and duplicate-submit guards.
- Documented privacy, storage, network, and hCaptcha CSP requirements.
- **Funneled survey mode** — guided Kano → MaxDiff → Pairwise prioritization sequence
- **Kano step** — respondents rate each feature on functional and dysfunctional scales; must-be, one-dimensional, and attractive features advance automatically
- **MaxDiff step** — balanced incomplete block design trials; utility scores computed client-side; top-N features advance to pairwise
- **Pairwise step** — head-to-head matchups with Bradley-Terry MLE scoring for a definitive final ranking
- **Per-respondent real-time filtering** — each respondent's own Kano results determine which features they see in MaxDiff and Pairwise
- **Transition screens** — interstitial screens between steps showing how many features advanced and what comes next
- **Events**: `sfReady`, `sfStepChange`, `sfSubmit`, `sfError`
- **CSS parts**: `kano-question`, `kano-functional`, `kano-dysfunctional`, `kano-option`, `maxdiff-trial`, `maxdiff-option`, `best-selector`, `worst-selector`, `pairwise-matchup`, `pairwise-option-left`, `pairwise-option-right`, `step-transition`, `step-indicator`, `progress-indicator`, `sr-region`
- **Reduced-motion support** for all step animations
- **Config fields**: `itemsPerTrial` (3–5, default 4), `topNThreshold` (min 2, < item count)
- **Item count validation**: 4–7 items

### Breaking Changes

- Ranking mode (drag-and-drop) has been removed — feature priority is always funneled
- `surveyMode` config field removed — no longer needed
- Minimum item count increased from 2 to 4
- Response data model changed to `FunneledFeaturePriorityResponse` (computed scores only, no raw trial/matchup data)

## [1.0.0] - 2026-01-15

### Added

- Initial release of sf-featurepriority web component
- Drag-and-drop feature ranking
- Keyboard-accessible reordering
- Respondent details collection
- Screen reader support with ARIA live regions
- Keyboard navigation with grab/drop functionality
- High contrast mode support
- Reduced motion support
- ES5 builds for legacy browser support
- CDN distribution via unpkg and jsDelivr
- TypeScript type definitions
- CSS Parts for custom styling
