dehezhang2 commited on
Commit
8bb56a1
·
verified ·
1 Parent(s): 95c84a4

deploy rater (Docker/FastAPI): registration + completeness gate + /api/submit → dataset

Browse files
Files changed (1) hide show
  1. static/index.html +42 -28
static/index.html CHANGED
@@ -103,7 +103,16 @@
103
  .sidebar-rail:hover { color: var(--fg); border-color: var(--border-strong); }
104
  body:not(.sidebar-expanded) .sidebar-rail { display: block; }
105
 
106
- section.detail { flex: 1; overflow-y: auto; padding: 18px 24px 80px; min-width: 0; }
 
 
 
 
 
 
 
 
 
107
 
108
  /* ---------- instructions panel ---------- */
109
  .instructions { background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
@@ -140,30 +149,30 @@
140
  border: 1px solid var(--border); display: block; }
141
 
142
  /* ---------- two-pane case layout ---------- */
143
- .case-pane-wrap { display: grid; gap: 18px; align-items: start;
144
- grid-template-columns: minmax(380px, 480px) minmax(0, 1fr); }
 
 
145
  @media (max-width: 900px) {
146
  .case-pane-wrap { grid-template-columns: 1fr; }
147
  }
148
- /* Left pane: flex column. Video + controls keep their natural height;
149
- the prompt-box at the bottom flex-grows to fill the remaining vertical
150
- space (no more empty area below the controls). Pane is sticky and
151
- capped at viewport height. */
152
- .left-pane { position: sticky; top: 0; align-self: start;
153
- display: flex; flex-direction: column; gap: 8px;
154
  padding-top: 4px; padding-bottom: 8px;
155
- height: calc(100vh - 130px); max-height: calc(100vh - 130px);
156
- min-height: 0; }
157
  .left-pane > .video-panel, .left-pane > .video-controls,
158
  .left-pane > .case-meta { flex: 0 0 auto; }
159
  .left-pane > .prompt-box { flex: 1 1 auto; min-height: 5em;
160
  max-height: none; overflow-y: auto; }
161
- /* Right pane: responsive grid of question cards. ~210 px minimum per card
162
- → 3-4 cards per row on typical desktop widths. Dim headers span all
163
- columns. */
164
- .right-pane { min-width: 0; display: grid; gap: 10px;
165
- grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
166
- align-content: start; }
 
167
  .right-pane > .dim-header { grid-column: 1 / -1; }
168
 
169
  /* ---------- video tabs + single active video ---------- */
@@ -177,8 +186,11 @@
177
  border-color: var(--accent); font-weight: 700; }
178
  .video-tile { display: flex; flex-direction: column; gap: 6px; }
179
  .video-tile.hidden { display: none; }
 
 
180
  .video-frame { position: relative; background: #000; border: 1px solid var(--border);
181
- border-radius: 6px; overflow: hidden; aspect-ratio: 16 / 9; }
 
182
  .video-frame video { width: 100%; height: 100%; display: block; background: #000; }
183
  .video-frame .empty-state { position: absolute; inset: 0; display: flex;
184
  flex-direction: column; align-items: center; justify-content: center;
@@ -1711,8 +1723,9 @@ function renderDetail() {
1711
  wrap.appendChild(renderRightPane(c));
1712
  detail.appendChild(wrap);
1713
  bindAutoCollapseInstructions();
1714
- detail.__resetAutoCollapse?.();
1715
- detail.scrollTop = 0;
 
1716
 
1717
  // Update sidebar active row + footer
1718
  document.querySelectorAll(".case-row").forEach((row, i) => {
@@ -1915,23 +1928,24 @@ function observeStickyTop(node) {
1915
  }
1916
 
1917
  // Once per case visit: auto-collapse the instructions panel as soon as the
1918
- // user scrolls past it. Keeps the rubric out of the way once they start
1919
- // scrolling through rating rows. The user can manually re-expand the panel
1920
- // at any time — we only auto-close, never auto-open.
1921
  function bindAutoCollapseInstructions() {
1922
  const detail = document.getElementById("detail");
1923
- if (!detail || detail.__autoCollapseBound) return;
1924
- detail.__autoCollapseBound = true;
 
1925
  let closed = false;
1926
- detail.addEventListener("scroll", () => {
1927
  if (closed) return;
1928
- if (detail.scrollTop > 80) {
1929
  const ins = detail.querySelector("details.instructions[open]");
1930
  if (ins) { ins.removeAttribute("open"); closed = true; }
1931
  }
1932
  }, { passive: true });
1933
  // Reset the once-per-case flag whenever a new case is rendered.
1934
- detail.__resetAutoCollapse = () => { closed = false; };
1935
  }
1936
 
1937
  function renderInstructions(forceOpen) {
 
103
  .sidebar-rail:hover { color: var(--fg); border-color: var(--border-strong); }
104
  body:not(.sidebar-expanded) .sidebar-rail { display: block; }
105
 
106
+ /* section.detail becomes a non-scrolling flex column: instructions panel at
107
+ the top (also non-scrolling), then the two-pane wrap that fills the rest.
108
+ Inside the wrap the LEFT pane is fixed-position-like (it doesn't move,
109
+ since the parent has no scroll), and only the RIGHT pane has its own
110
+ overflow-y: auto. Net effect: scrolling rating cards on the right while
111
+ prompt + video + instructions remain pinned. */
112
+ section.detail { flex: 1; overflow: hidden; padding: 14px 24px 80px;
113
+ min-width: 0; min-height: 0;
114
+ display: flex; flex-direction: column; gap: 10px; }
115
+ section.detail > .instructions { flex: 0 0 auto; margin-bottom: 0; }
116
 
117
  /* ---------- instructions panel ---------- */
118
  .instructions { background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
 
149
  border: 1px solid var(--border); display: block; }
150
 
151
  /* ---------- two-pane case layout ---------- */
152
+ .case-pane-wrap { flex: 1 1 auto; min-height: 0;
153
+ display: grid; gap: 18px;
154
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); /* 50 / 50 */
155
+ align-items: stretch; }
156
  @media (max-width: 900px) {
157
  .case-pane-wrap { grid-template-columns: 1fr; }
158
  }
159
+ /* Left pane fills its grid cell vertically. Doesn't scroll the page; if
160
+ its own content exceeds the cell height, the prompt-box scrolls
161
+ internally. */
162
+ .left-pane { display: flex; flex-direction: column; gap: 8px;
 
 
163
  padding-top: 4px; padding-bottom: 8px;
164
+ min-height: 0; max-height: 100%; }
 
165
  .left-pane > .video-panel, .left-pane > .video-controls,
166
  .left-pane > .case-meta { flex: 0 0 auto; }
167
  .left-pane > .prompt-box { flex: 1 1 auto; min-height: 5em;
168
  max-height: none; overflow-y: auto; }
169
+ /* Right pane is the only scroll surface on this page. Grid of question
170
+ cards, ~210 px min → 3-4 per row at typical desktop widths. Dim
171
+ headers span all columns. */
172
+ .right-pane { min-width: 0; min-height: 0; max-height: 100%;
173
+ overflow-y: auto; padding-right: 4px;
174
+ display: grid; gap: 10px; align-content: start;
175
+ grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
176
  .right-pane > .dim-header { grid-column: 1 / -1; }
177
 
178
  /* ---------- video tabs + single active video ---------- */
 
186
  border-color: var(--accent); font-weight: 700; }
187
  .video-tile { display: flex; flex-direction: column; gap: 6px; }
188
  .video-tile.hidden { display: none; }
189
+ /* aspect-ratio gives a 16:9 box; max-height caps it on tall/wide left panes
190
+ so the prompt still has plenty of room below. */
191
  .video-frame { position: relative; background: #000; border: 1px solid var(--border);
192
+ border-radius: 6px; overflow: hidden; aspect-ratio: 16 / 9;
193
+ max-height: 42vh; }
194
  .video-frame video { width: 100%; height: 100%; display: block; background: #000; }
195
  .video-frame .empty-state { position: absolute; inset: 0; display: flex;
196
  flex-direction: column; align-items: center; justify-content: center;
 
1723
  wrap.appendChild(renderRightPane(c));
1724
  detail.appendChild(wrap);
1725
  bindAutoCollapseInstructions();
1726
+ const right = detail.querySelector(".right-pane");
1727
+ right?.__resetAutoCollapse?.();
1728
+ if (right) right.scrollTop = 0;
1729
 
1730
  // Update sidebar active row + footer
1731
  document.querySelectorAll(".case-row").forEach((row, i) => {
 
1928
  }
1929
 
1930
  // Once per case visit: auto-collapse the instructions panel as soon as the
1931
+ // user scrolls past the top of the right pane. Keeps the rubric out of the
1932
+ // way once they start scoring. We listen on the right pane because
1933
+ // section.detail is no longer the scroll container (only .right-pane is).
1934
  function bindAutoCollapseInstructions() {
1935
  const detail = document.getElementById("detail");
1936
+ const right = detail?.querySelector(".right-pane");
1937
+ if (!right || right.__autoCollapseBound) return;
1938
+ right.__autoCollapseBound = true;
1939
  let closed = false;
1940
+ right.addEventListener("scroll", () => {
1941
  if (closed) return;
1942
+ if (right.scrollTop > 80) {
1943
  const ins = detail.querySelector("details.instructions[open]");
1944
  if (ins) { ins.removeAttribute("open"); closed = true; }
1945
  }
1946
  }, { passive: true });
1947
  // Reset the once-per-case flag whenever a new case is rendered.
1948
+ right.__resetAutoCollapse = () => { closed = false; right.scrollTop = 0; };
1949
  }
1950
 
1951
  function renderInstructions(forceOpen) {