Ablative config
This commit is contained in:
@@ -22,10 +22,13 @@ export default function Solver() {
|
||||
getUnit,
|
||||
setUnit,
|
||||
sciNotation,
|
||||
areaRatioBranch,
|
||||
toggleSciNotation,
|
||||
toggleAreaRatioBranch,
|
||||
addVariable,
|
||||
addVariables,
|
||||
removeVariable,
|
||||
reorderVariable,
|
||||
setValue,
|
||||
addPreset,
|
||||
applyPropellant,
|
||||
@@ -48,10 +51,20 @@ export default function Solver() {
|
||||
|
||||
function handleDragEnd(event) {
|
||||
const { over, active } = event
|
||||
if (over?.id === 'workspace') {
|
||||
if (!over) {
|
||||
setActiveVarId(null)
|
||||
return
|
||||
}
|
||||
|
||||
// Palette → workspace drop
|
||||
if (over.id === 'workspace') {
|
||||
const { varId } = active.data.current ?? {}
|
||||
if (varId) addVariable(varId)
|
||||
}
|
||||
// Workspace → workspace reorder
|
||||
else if (workspaceVarIds.includes(active.id) && workspaceVarIds.includes(over.id)) {
|
||||
reorderVariable(active.id, over.id)
|
||||
}
|
||||
setActiveVarId(null)
|
||||
}
|
||||
|
||||
@@ -128,6 +141,8 @@ export default function Solver() {
|
||||
getUnit={getUnit}
|
||||
setUnit={setUnit}
|
||||
sciNotation={sciNotation}
|
||||
areaRatioBranch={areaRatioBranch}
|
||||
onToggleAreaRatioBranch={toggleAreaRatioBranch}
|
||||
/>
|
||||
<ResultsPanel
|
||||
workspaceVarIds={workspaceVarIds}
|
||||
@@ -147,7 +162,6 @@ export default function Solver() {
|
||||
<PropellantModal
|
||||
onClose={() => setShowPropellants(false)}
|
||||
onApply={applyPropellant}
|
||||
existingVarIds={workspaceVarIds}
|
||||
/>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user