Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/static/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7361,10 +7361,12 @@ async function startSelectedWorkflow() {
headers: { "Content-Type": "application/json" },
body: JSON.stringify({simulation_id: state.selectedSimulationId, vehicle_key: activeVehicleKey()}),
});
state.status = await api("/api/status");
state.selectedJobId = job.id;
document.getElementById("job-log").textContent = "";
document.getElementById("job-log").scrollTop = 0;
document.getElementById("run-log-menu").open = true;
state.simModalOpen = true;
state.status = await api("/api/status");
renderStandard();
} catch (error) {
document.getElementById("run-log-menu").open = true;
Expand Down
16 changes: 16 additions & 0 deletions tests/app_editor_clarity.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,22 @@ for (const [value, scale, display, edited, expected] of [
api=async()=>({log:'updated output'});
elements['job-log'].scrollHeight=1000; elements['job-log'].scrollTop=100;
await loadJobLog();assert.equal(elements['job-log'].scrollTop,100,'reading position survives refresh');
selectedWorkflow=()=>({id:'lap-qss',actions:[]});
canRunStandardWorkflow=()=>true;
saveSimulationEdits=async()=>{};
activeVehicleKey=()=>'vehicle';
state.dirtySimConfig=false;
state.status={jobs:[{id:'old',label:'Old run',status:'succeeded',argv:[]}]};
state.selectedJobId='old';
const newJob={id:'new-run',label:'QSS lap',status:'running',argv:[]};
api=async path=>path==='/api/status' ? {jobs:[newJob,...state.status.jobs]} : newJob;
Object.defineProperty(elements['run-log-menu'],'open',{
get:()=>true,set:()=>renderRunLog(),configurable:true,
});
renderStandard=()=>renderRunLog();
await startSelectedWorkflow();
assert.equal(state.selectedJobId,'new-run','opening the log follows the new job');
assert.equal(elements['job-log'].scrollTop,0,'new run resets the old reading position');
const saves=[];
state.simulationWorkspace={simulations:[{id:'sim',name:'Original'}]};
simulationRequest=async(action,values)=>saves.push({action,...values});
Expand Down
Loading