Skip to main content
Version: 0.0.37

Changelog

All notable changes to the kampmann-calcgateway-frontend (calc-interface) package.

0.0.37​

Added​

  • useWildcardRequest hook — builds and posts a product wildcard calculation request against /api/calcgateway/product-calculation/v1.0/products/calculate/wildcard and resolves to the response's Responses array. It derives the wildcard body from an existing RequestObject (language, region, unit system, scope system) and accepts an optional wildcardKeys list. This is the calc-interface side of the PST unit-sizing / unit-optimization workflow in @repo/shared-pages (#1536).
  • Wildcard test menu in the development playground app for exercising useWildcardRequest locally (dev only — not part of the published bundle).

Changed​

  • RequestObject type exports widened — the package now re-exports every type from models/RequestObject (export type * from "./models/RequestObject") instead of only RequestAccessory, so consumers can type complete calc request bodies (#1536).
  • CalculationResponse.OutputValues is now nullable — the type was tightened to {...}[] | null to match what the calc gateway actually returns for categories without output values. TypeScript consumers that read OutputValues directly now have to narrow it.

Fixed​

  • Crash on categories without output values — ProductDataTable counted visible output values with an unguarded category.OutputValues.filter(...), which threw as soon as a category came back with OutputValues: null. The count now optional-chains and falls back to 0.
  • First table row / column identity — the "first row values" used for column tracking and paint-mode cell keys were derived from OutputCategories[0].OutputValues[0], ignoring the Visible filter and Order sorting that the table actually renders with. They are now produced by a single getFirstRowValues helper that mirrors the rendered row, so removed-column detection and selected-cell syncing stay correct when the first category or value is hidden or not first by order.
    • String values no longer borrow Float.Unit for their unit cell (it is empty, as it already was in the selected-cell code path).
    • Removed the duplicated currentFirstRowValues memo — both call sites and the ProductDataTable effect now share the same helper.

0.0.36​

Fixed​

  • Unresolvable @repo/units dependency — moved @repo/units from dependencies to devDependencies. It is bundled into the output by Vite, so consumers no longer fail trying to resolve the private, unpublished package.

  • First output category no longer hidden — ProductDataTable skipped the title/header row of the first OutputCategory (a leftover categoryIndex > 0 guard), making the first category appear filtered out even though its data rows rendered. The first category now renders its header on the same terms as all other categories.

0.0.35​

Added​

  • Reduced calc state — introduced the ReducedState model and threaded it through the utility functions and state initialization, enabling a compact, serializable representation of the calc interface state (#57).
  • Accessory state — ReducedCalcState now supports calculable and non-calculable accessory states.
  • Color comments / paint mode — color-based comment handling on the CalculationTable:
    • calculationTableColorComments support in the model and an addColorCommentsToState helper.
    • A requestDataToComments utility integrated with initState, plus request-data generation that uses the dynamic product ID.
    • A PaintButton and floating-button UI for entering/editing comments.
    • A paintMode prop on ProductDataTable and selected-cell syncing against calculation results (#1043, #1062).
  • KapiLink component — generates localized product links.
  • Unit system selector — added a unit-system selector in App with ReducedState-backed state handling.
  • CalculationTable tab control — added an initialTab prop and tab initialization logic that falls back to calculationResults.
  • AccessoryForm — added a reducedCallback and integrated the initial colors state.
  • Parameter-set overlap selection — on init, auto-select the InputParameterSet whose input values best overlap the persisted initState; an explicit selection in initState is respected and only the absence of one triggers the heuristic. Added as pure, unit-tested helpers with a Vitest setup for the package.
  • Init warnings — surface warnings when an initState value is missing from the parameter set or was overridden by a dependency (#1294).
  • Single calc point — collapse multi-point control-voltage inputs to a single representative value via applySingleCalcPoint, replacing the redundant onlyOneControlVoltage logic (#1257).
  • useDynamicInputParameterSet hook for dynamic input parameter sets (#1123).
  • Button icons and refined button label markup (#1147).
  • Single-CV mode expansion — pending CV state management for single calc point mode across components, single-CV mode enabled for categories with specific numeric-suffix keys, and a showAllCVSliders config option to toggle the visibility of disabled CV sliders in single-CV mode (documented alongside useSingleCalcPoint).
  • TESTSYSTEM UI control — added TESTSYSTEM to the UIControls enum.
  • Belgium & Luxembourg regions — added the BE and LU regions.
  • Value highlighting — optional IsHighlighted property on the CalculationResponse types, with ProductDataTable conditionally applying highlight table styles; bundled the Circular (CircularXXWeb) font assets (#1432).

Changed​

  • Improved CalculationTable state handling for more reliable tab management.
  • Adjusted PaintButton class names and button styles for visual consistency and better UX.
  • Refactored state initialization: callback wrapping and optimized reduced-state updates.
  • Optimized string-value handling in ProductDataTable for consistent output (#1254).
  • Parameter-set scoring — refined scoring and selection: introduced ParameterSetScore (tracking missing/excess mismatches) and weighParameterSetScore for weighted divergence, and updated pickDefaultParameterSetIndex to prioritize the least-divergent set (#1388).
  • KapiLink export — the KapiLink component and its types are now exported from the package.
  • CalculationTable styling — restored the Circular font definitions and .performanceTableBody styles and refactored ProductDataTable formatting (#1432).

Fixed​

  • Scope category updates to the specific group key.
  • Correct the category-group Length property and update the API proxy target.
  • Use the adjacent config when configuring the accessory modal.
  • Correct the language check in displayDecimal.
  • Variant table aggregation (#1096).

Build​

  • Switch the package to a workspace:* dependency and refactor calc-related typings for the monorepo.
  • Upgrade Vite to 7.3.2 and mathjs to 15.2.0 (#906).

Reverted​

  • A unit-conversion feature and its accompanying tests were added and then reverted under this version (no net change).
  • A ProductDataTable enhancement was added and then reverted (#1033).