Remove temp toggle, frontend now always celsius - #690
Merged
Conversation
haralde
force-pushed
the
remove-temp-toggle-v2
branch
from
May 11, 2026 13:49
708a048 to
3eac08d
Compare
haralde
marked this pull request as ready for review
May 12, 2026 06:14
There was a problem hiding this comment.
Pull request overview
Removes the Kelvin/Celsius unit toggle and standardizes temperature handling to always use Celsius across the frontend and core API model, with backend adapters converting to Kelvin internally where required (per #635).
Changes:
- Removed the frontend temperature-unit settings context/toggle and the
ConvertibleTextFieldabstraction. - Switched frontend temperature values and defaults to Celsius (no longer adding/subtracting 273 on the client side).
- Updated backend
Conditionsdefault temperature to 25°C and adjusted model adapters/tests to match the new Celsius contract.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| frontend/tests/functions/Formatting.test.tsx | Updates expected tabulated temperatures to Celsius values. |
| frontend/tests/components/ConvertibleTextField.test.tsx | Removes tests for deleted ConvertibleTextField. |
| frontend/src/hooks/useSimulationQueriesResult.ts | Stops converting experiment temperature to Kelvin before starting simulations. |
| frontend/src/hooks/useConditionsStore.ts | Changes default temperature from 300 to 25 (Celsius). |
| frontend/src/functions/Formatting.tsx | Stops converting experiment temperatures to Kelvin when tabulating results. |
| frontend/src/contexts/SettingsContext.ts | Removes temperature unit context and toggle logic. |
| frontend/src/components/TopBar.tsx | Removes temperature toggle UI and related icon/import usage. |
| frontend/src/components/Simulation/ModelInputs.tsx | Replaces ConvertibleTextField with TextField for parameters; updates temperature unit label to °C. |
| frontend/src/components/ConvertibleTextField.tsx | Removes the unit-converting numeric input component. |
| frontend/src/App.tsx | Removes SettingsProvider from the provider composition. |
| backend/tests/test_models_endpoints.py | Updates expected default condition temperature to 25°C. |
| backend/src/acidwatch_api/models/solubilityccs.py | Converts Celsius to Kelvin internally before calling solubilityccs. |
| backend/src/acidwatch_api/models/phpitz.py | Removes Kelvin→Celsius conversion; now passes Celsius through. |
| backend/src/acidwatch_api/models/gibbs_minimization_model.py | Converts Celsius to Kelvin internally for neqsim. |
| backend/src/acidwatch_api/models/datamodel.py | Documents Celsius contract and changes default temperature to 25°C. |
| backend/src/acidwatch_api/models/arcs.py | Converts Celsius to Kelvin internally before calling ARCS. |
| backend/src/acidwatch_api/models/arcs_exp.py | Converts Celsius to Kelvin internally before calling ARCS experimental. |
Comments suppressed due to low confidence (1)
frontend/src/components/Simulation/ModelInputs.tsx:213
- The Temperature condition field now uses unit "°C", but the
onChangehandler only updates state whenvalueAsNumberis finite. This makes it effectively impossible to type negative Celsius temperatures normally (first keystroke-yieldsNaN, so the controlled input reverts). To support negative temperatures and normal numeric editing, handle intermediate string states (e.g. empty string / "-" / trailing decimal) and commit the parsed number on blur, or manage the value as a string internally.
<TextField
type="number"
id="temperature"
label="Temperature"
unit="°C"
step="any"
value={conditions.temperature}
onChange={(e: ChangeEvent<HTMLInputElement>) => {
if (Number.isFinite(e.target.valueAsNumber)) {
setCondition("temperature", e.target.valueAsNumber);
}
}}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
haralde
force-pushed
the
remove-temp-toggle-v2
branch
from
May 13, 2026 12:23
4ef27d6 to
3f5fcd0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Temperature is now always C in frontend. Fixes #635
Adapters that require K needs to handle this internally in adapter before posting a model run