NeonClary commited on
Commit
5d098fa
Β·
1 Parent(s): 936b89e

Keep height:100vh scroll containment at all breakpoints to fix HF iframe

Browse files
frontend/src/App.js CHANGED
@@ -51,6 +51,28 @@ export default function App() {
51
  document.documentElement.setAttribute('data-theme', theme);
52
  }, [theme]);
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  useEffect(() => {
55
  fetchModels()
56
  .then(data => {
 
51
  document.documentElement.setAttribute('data-theme', theme);
52
  }, [theme]);
53
 
54
+ // #region agent log
55
+ useEffect(() => {
56
+ const timer = setTimeout(() => {
57
+ const app = document.querySelector('.app');
58
+ const main = document.querySelector('.app-main');
59
+ const content = document.querySelector('.content');
60
+ const accordion = document.querySelector('.accordion');
61
+ const accBody = document.querySelector('.accordion-body.open');
62
+ const lastTextarea = document.querySelectorAll('.persona-field textarea.tall');
63
+ const log = (msg, data) => fetch('http://127.0.0.1:7242/ingest/55bc8edc-2006-4ebe-8076-1d725683b980',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({location:'App.js:scroll-debug2',message:msg,data,timestamp:Date.now(),hypothesisId:'H11-H14',runId:'run5'})}).catch(()=>{});
64
+ log('viewport', { w: window.innerWidth, h: window.innerHeight });
65
+ if (app) { const cs = getComputedStyle(app); log('app', { offsetH: app.offsetHeight, scrollH: app.scrollHeight, height: cs.height, minH: cs.minHeight, overflow: cs.overflow }); }
66
+ if (main) { const cs = getComputedStyle(main); log('app-main', { offsetH: main.offsetHeight, scrollH: main.scrollHeight, minH: cs.minHeight, overflow: cs.overflow, flexDir: cs.flexDirection }); }
67
+ if (content) { const cs = getComputedStyle(content); log('content', { offsetH: content.offsetHeight, clientH: content.clientHeight, scrollH: content.scrollHeight, minH: cs.minHeight, overflowY: cs.overflowY, canScroll: content.scrollHeight > content.clientHeight }); }
68
+ if (accordion) { const cs = getComputedStyle(accordion); log('accordion', { offsetH: accordion.offsetHeight, scrollH: accordion.scrollHeight, overflow: cs.overflow }); }
69
+ if (accBody) { const cs = getComputedStyle(accBody); log('accBody', { offsetH: accBody.offsetHeight, scrollH: accBody.scrollHeight, maxH: cs.maxHeight, overflow: cs.overflow }); }
70
+ if (lastTextarea.length > 0) { const last = lastTextarea[lastTextarea.length - 1]; const rect = last.getBoundingClientRect(); log('lastTextarea', { y: rect.top, bottom: rect.bottom, h: rect.height }); }
71
+ }, 2000);
72
+ return () => clearTimeout(timer);
73
+ }, [accordionOpen]);
74
+ // #endregion
75
+
76
  useEffect(() => {
77
  fetchModels()
78
  .then(data => {
frontend/src/styles/layout.css CHANGED
@@ -94,29 +94,22 @@
94
 
95
  /* ── Tablet: stack sidebar above content ──────────────────────── */
96
  @media (max-width: 900px) {
97
- .app {
98
- height: auto;
99
- min-height: 100vh;
100
- overflow: auto;
101
- }
102
  .app-header {
103
  padding: 10px 16px;
104
  }
105
  .app-main {
106
  flex-direction: column;
107
- overflow: visible;
108
  }
109
  .sidebar {
110
  width: 100%;
111
  min-width: auto;
112
  max-height: 200px;
 
113
  border-right: none;
114
  border-bottom: 1px solid var(--border-primary);
115
  }
116
  .content {
117
  padding: 16px;
118
- min-height: 0;
119
- flex: 1;
120
  }
121
  }
122
 
 
94
 
95
  /* ── Tablet: stack sidebar above content ──────────────────────── */
96
  @media (max-width: 900px) {
 
 
 
 
 
97
  .app-header {
98
  padding: 10px 16px;
99
  }
100
  .app-main {
101
  flex-direction: column;
 
102
  }
103
  .sidebar {
104
  width: 100%;
105
  min-width: auto;
106
  max-height: 200px;
107
+ flex-shrink: 0;
108
  border-right: none;
109
  border-bottom: 1px solid var(--border-primary);
110
  }
111
  .content {
112
  padding: 16px;
 
 
113
  }
114
  }
115