Changelog
All notable changes to the kampmann-calcgateway-frontend (calc-interface) package.
0.0.39
Fixed
- Selected accessory category was lost on restore — a
CategoryGroupof a calculable accessory can offer severalCategoriesthat the user switches between, but the persisted accessory state (RequestAccessory.inputCategories, and the reduced equivalent) was keyed byCategoryGroup.Keyalone. On init the stored values were therefore written into every category of the group, and the selection fell back to the first one.InputCategoryandReducedAccessoryInputCategorynow carry an optionalcategoryKey— theGroupKeyof the category the values came from.createAccessoryInputCategoriesstamps it,reduceCalcDatapasses it through, andAccessoryForm's init restores values into exactly that category and marks it selected. States saved withoutcategoryKeykeep the previous behaviour.- Note:
RequestAccessorydoubles as the calc gateway request body, socategoryKeytravels with the request. Strip it before sending if the backend rejects unknown fields.
- Note:
0.0.38
Changed
HTMLSelectstyling — the trigger truncates long option text instead of overflowing, and the currently selected option renders bold in the dropdown list.
Added
- Column selection in
ProductDataTable— newonColumnSelect,columnSelectLabel, andcolumnSelectButtonLabelprops render a select row with a per-column button, letting a consumer pick one column (e.g. one calculation stage) out of the table.ArchivedCalcStagePickerDialog(@repo/shared-pages) was refactored to use this instead of its own duplicated table/formatting logic.
Fixed
- Select row overlapped table content while scrolling — the new select
row had no sticky positioning, so it scrolled away with the rest of the
table instead of staying pinned like a header. Made it
sticky top-0. - Legacy sticky-first-row CSS conflicted with column-select consumers —
ProductDataTableonly skipped its legacytop-[60px]sticky-first-row class (meant for the product-performance page's own 60px topbar) whenonColumnSelectwas actually passed. When a column-select consumer has only one column to offer (e.g. a single calculation stage),onColumnSelectis correctly omitted — but the legacy class still applied, sticking the first row at a 60px offset that doesn't exist in that consumer's layout, so the row visibly overlapped the content above it. The legacy class is now also skipped whenevercolumnSelectLabel/columnSelectButtonLabelare set, which column-select consumers always pass regardless of column count.
0.0.37
Added
useWildcardRequesthook — builds and posts a product wildcard calculation request against/api/calcgateway/product-calculation/v1.0/products/calculate/wildcardand resolves to the response'sResponsesarray. It derives the wildcard body from an existingRequestObject(language, region, unit system, scope system) and accepts an optionalwildcardKeyslist. 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
useWildcardRequestlocally (dev only — not part of the published bundle).
Changed
RequestObjecttype exports widened — the package now re-exports every type frommodels/RequestObject(export type * from "./models/RequestObject") instead of onlyRequestAccessory, so consumers can type complete calc request bodies (#1536).CalculationResponse.OutputValuesis now nullable — the type was tightened to{...}[] | nullto match what the calc gateway actually returns for categories without output values. TypeScript consumers that readOutputValuesdirectly now have to narrow it.
Fixed
- Crash on categories without output values —
ProductDataTablecounted visible output values with an unguardedcategory.OutputValues.filter(...), which threw as soon as a category came back withOutputValues: null. The count now optional-chains and falls back to0. - 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 theVisiblefilter andOrdersorting that the table actually renders with. They are now produced by a singlegetFirstRowValueshelper 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.Unitfor their unit cell (it is empty, as it already was in the selected-cell code path). - Removed the duplicated
currentFirstRowValuesmemo — both call sites and theProductDataTableeffect now share the same helper.
- String values no longer borrow
0.0.36
Fixed
-
Unresolvable
@repo/unitsdependency — moved@repo/unitsfromdependenciestodevDependencies. 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 —
ProductDataTableskipped the title/header row of the firstOutputCategory(a leftovercategoryIndex > 0guard), 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
ReducedStatemodel and threaded it through the utility functions and state initialization, enabling a compact, serializable representation of the calc interface state (#57). - Accessory state —
ReducedCalcStatenow supports calculable and non-calculable accessory states. - Color comments / paint mode — color-based comment handling on the
CalculationTable:calculationTableColorCommentssupport in the model and anaddColorCommentsToStatehelper.- A
requestDataToCommentsutility integrated withinitState, plus request-data generation that uses the dynamic product ID. - A
PaintButtonand floating-button UI for entering/editing comments. - A
paintModeprop onProductDataTableand selected-cell syncing against calculation results (#1043, #1062).
KapiLinkcomponent — generates localized product links.- Unit system selector — added a unit-system selector in
AppwithReducedState-backed state handling. CalculationTabletab control — added aninitialTabprop and tab initialization logic that falls back tocalculationResults.AccessoryForm— added areducedCallbackand integrated the initial colors state.- Parameter-set overlap selection — on init, auto-select the
InputParameterSetwhose input values best overlap the persistedinitState; an explicit selection ininitStateis 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
initStatevalue 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 redundantonlyOneControlVoltagelogic (#1257). useDynamicInputParameterSethook 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
showAllCVSlidersconfig option to toggle the visibility of disabled CV sliders in single-CV mode (documented alongsideuseSingleCalcPoint). TESTSYSTEMUI control — addedTESTSYSTEMto theUIControlsenum.- Belgium & Luxembourg regions — added the
BEandLUregions. - Value highlighting — optional
IsHighlightedproperty on theCalculationResponsetypes, withProductDataTableconditionally applying highlight table styles; bundled the Circular (CircularXXWeb) font assets (#1432).
Changed
- Improved
CalculationTablestate handling for more reliable tab management. - Adjusted
PaintButtonclass 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
ProductDataTablefor consistent output (#1254). - Parameter-set scoring — refined scoring and selection: introduced
ParameterSetScore(trackingmissing/excessmismatches) andweighParameterSetScorefor weighted divergence, and updatedpickDefaultParameterSetIndexto prioritize the least-divergent set (#1388). KapiLinkexport — theKapiLinkcomponent and its types are now exported from the package.CalculationTablestyling — restored the Circular font definitions and.performanceTableBodystyles and refactoredProductDataTableformatting (#1432).
Fixed
- Scope category updates to the specific group key.
- Correct the category-group
Lengthproperty 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
ProductDataTableenhancement was added and then reverted (#1033).