Skip to content
Merged
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
12 changes: 12 additions & 0 deletions client/src/components/InspectDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,9 @@ export function InspectDrawer({
await model.fetchIfDirtyAndDraw("CBs");
await clearPose();
// Persist the merged model (merge=true -> pose_merged + auto-Hit).
// Deliberately does NOT advance: merging the ligand is mid-workflow —
// you then edit/refine the protein WITH the ligand present (so it senses
// the ligand's steric context). Advancing is the SAVE action's job.
await commitLiveModel(ev, true);
} catch {
/* surfaced via the merging flag clearing; non-fatal */
Expand All @@ -1177,6 +1180,11 @@ export function InspectDrawer({
setMerging(true);
try {
await commitLiveModel(ev, false);
// Save is the "done with this event" action — commit the (merged +
// edited/refined) model, then step to the next event without an extra
// click. Via the ref since goAdjacent is defined below this handler;
// advances from THIS event and no-ops at the end of the list.
goAdjacentRef.current(1);
} catch {
/* non-fatal */
} finally {
Expand Down Expand Up @@ -1277,6 +1285,10 @@ export function InspectDrawer({
},
[eventOrder, selected, loadEvent]
);
// Live mirror so handlers defined ABOVE (saveModel) can advance after they
// finish, without a forward reference to goAdjacent in their dep arrays.
const goAdjacentRef = useRef(goAdjacent);
goAdjacentRef.current = goAdjacent;

return (
<Box
Expand Down
Loading