linguabot commited on
Commit
2b01575
·
verified ·
1 Parent(s): d8c2add

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. client/src/pages/TutorialTasks.tsx +5 -21
client/src/pages/TutorialTasks.tsx CHANGED
@@ -179,24 +179,9 @@ const TutorialTasks: React.FC = () => {
179
  try { console.log('[Trace] unlockGridHeight', { id }); } catch {}
180
  };
181
 
182
- // Container height lock to stabilize Safari during submit/delete
183
- const lockContainerHeightById = (id: string) => {
184
- const el = submissionsContainerRefs.current[id];
185
- if (!el) return;
186
- const h = el.getBoundingClientRect().height || lastPreHeightRef.current[id] || 0;
187
- el.style.minHeight = `${h}px`;
188
- el.style.height = `${h}px`;
189
- el.style.overflow = 'hidden';
190
- try { console.log('[Trace] lockContainerHeight', { id, h }); } catch {}
191
- };
192
- const unlockContainerHeightById = (id: string) => {
193
- const el = submissionsContainerRefs.current[id];
194
- if (!el) return;
195
- el.style.overflow = '';
196
- el.style.height = '';
197
- el.style.minHeight = '';
198
- try { console.log('[Trace] unlockContainerHeight', { id }); } catch {}
199
- };
200
 
201
  // (removed) ResizeObserver scroll compensator
202
 
@@ -712,7 +697,6 @@ const TutorialTasks: React.FC = () => {
712
  lockListHeight();
713
  lockCardHeightById(taskId);
714
  lockGridHeightById(taskId);
715
- lockContainerHeightById(taskId);
716
  withPreservedCardOffset(taskId, () => {
717
  setMutatingTaskId(taskId);
718
  setExpandedSections(prev => ({
@@ -979,7 +963,7 @@ const TutorialTasks: React.FC = () => {
979
  if (isSafari) { unfreezeScroll(); }
980
  disableCompensationRef.current.delete(taskId);
981
  };
982
- if ((afterH || 0) > 0 && (preHeight || 0) > 0 && Math.abs(afterH - preHeight) <= 1) {
983
  doUnlock();
984
  } else {
985
  // Gate one more frame for Safari layout to settle
@@ -992,7 +976,7 @@ const TutorialTasks: React.FC = () => {
992
  const afterCardH2 = afterCard2 ? afterCard2.getBoundingClientRect().height : 0;
993
  const afterH2 = afterGridH2 > 0 ? afterGridH2 : (afterContH2 > 0 ? afterContH2 : afterCardH2);
994
  try { console.log('[Trace] Submit:unlockGate2', { taskId, preHeight, afterH2, afterGridH2, afterContH2, afterCardH2 }); } catch {}
995
- if ((afterH2 || 0) > 0 && (afterH || 0) > 0 && Math.abs(afterH2 - afterH) <= 1) {
996
  doUnlock();
997
  } else {
998
  // Fallback: still unlock to prevent permanent lock, but note trace
 
179
  try { console.log('[Trace] unlockGridHeight', { id }); } catch {}
180
  };
181
 
182
+ // No-op container height locks (reverted)
183
+ const lockContainerHeightById = (_id: string) => {};
184
+ const unlockContainerHeightById = (_id: string) => {};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
185
 
186
  // (removed) ResizeObserver scroll compensator
187
 
 
697
  lockListHeight();
698
  lockCardHeightById(taskId);
699
  lockGridHeightById(taskId);
 
700
  withPreservedCardOffset(taskId, () => {
701
  setMutatingTaskId(taskId);
702
  setExpandedSections(prev => ({
 
963
  if (isSafari) { unfreezeScroll(); }
964
  disableCompensationRef.current.delete(taskId);
965
  };
966
+ if ((afterH || 0) > 0 && (preHeight || 0) > 0 && Math.abs(afterH - preHeight) <= 1) {
967
  doUnlock();
968
  } else {
969
  // Gate one more frame for Safari layout to settle
 
976
  const afterCardH2 = afterCard2 ? afterCard2.getBoundingClientRect().height : 0;
977
  const afterH2 = afterGridH2 > 0 ? afterGridH2 : (afterContH2 > 0 ? afterContH2 : afterCardH2);
978
  try { console.log('[Trace] Submit:unlockGate2', { taskId, preHeight, afterH2, afterGridH2, afterContH2, afterCardH2 }); } catch {}
979
+ if ((afterH2 || 0) > 0 && (preHeight || 0) > 0 && Math.abs(afterH2 - preHeight) <= 1) {
980
  doUnlock();
981
  } else {
982
  // Fallback: still unlock to prevent permanent lock, but note trace