wxDai Claude Fable 5 commited on
Commit
cd12afb
·
1 Parent(s): a2ed77e

Slow-PE UX: drop client PE watchdog, hide fallback PE; mobile example bottom sheet

Browse files
Files changed (1) hide show
  1. static/index.html +4 -20
static/index.html CHANGED
@@ -170,6 +170,8 @@
170
  /* panel titles go icon-only so 摄像头/MP4 fits the narrow head */
171
  .vpanel-head .vp-title span[data-i18n] { display: none; }
172
  .cmd-input { font-size: 12px; max-height: 125px; }
 
 
173
  .team-strip { flex-wrap: wrap; padding: 0 12px 10px; }
174
  .team-strip .team-thumbs { width: 100%; display: grid; grid-template-columns: repeat(2, 1fr); }
175
  .team-strip .team-thumbs img:first-child { grid-column: 1 / -1; }
@@ -409,7 +411,6 @@ const I18N = {
409
  stage_ws: "WS 发送", stage_total: "服务端合计", stage_residence: "服务端驻留",
410
  stage_enc_q: "编码队列", stage_ws_buf: "发送缓冲", stage_recv_q: "接收队列",
411
  busy_released: "已释放", busy_disconnected: "已断开", busy_conn_err: "连接错误",
412
- pe_fallback: " 回退", pe_error: " 错误",
413
  reset_count_changed: "检测到人数变化,重新编辑",
414
  reset_person_returned: "重新检测到人,重新开始编辑",
415
  reset_kv: "已连续编辑较久,正在重新校准,请保持人脸居中 😊",
@@ -488,7 +489,6 @@ const I18N = {
488
  stage_ws: "WS send", stage_total: "Server total", stage_residence: "Server residence",
489
  stage_enc_q: "Encode queue", stage_ws_buf: "Send buffer", stage_recv_q: "Recv queue",
490
  busy_released: "Released", busy_disconnected: "Disconnected", busy_conn_err: "Connection error",
491
- pe_fallback: " fallback", pe_error: " error",
492
  reset_count_changed: "Person count changed, re-editing",
493
  reset_person_returned: "Person detected again, restarting the edit",
494
  reset_kv: "Editing for a while — recalibrating, please keep your face centered 😊",
@@ -745,7 +745,6 @@ let finalizeIsForResult = false;
745
  let resultEpoch = 0;
746
  let resultSyncActive = false;
747
  let resultSyncHandlers = null;
748
- let peWatchdog = null;
749
  let finalizeWatchdog = null;
750
  function stopRecordDrain() {
751
  if (finalizeWatchdog) { clearTimeout(finalizeWatchdog); finalizeWatchdog = null; }
@@ -1896,7 +1895,6 @@ async function start() {
1896
  return;
1897
  }
1898
  if (msg.type === "prompt_enhanced") {
1899
- if (peWatchdog) { clearTimeout(peWatchdog); peWatchdog = null; }
1900
  pePausedSend = false;
1901
  clearOutputQueue();
1902
  lastShownCaptureMs = Date.now();
@@ -1905,12 +1903,9 @@ async function start() {
1905
  try { camera.pause(); } catch (err) {}
1906
  startVideoPull();
1907
  }
1908
- const elapsed = Number(msg.elapsed_s || 0);
1909
- const fallback = msg.fallback ? t("pe_fallback") : "";
1910
- const error = msg.error ? t("pe_error") : "";
1911
  const enhanced = msg.enhanced_prompt || msg.raw_prompt || "";
1912
- showPeResult(msg.error ? "" : enhanced, msg.model);
1913
- if (pendingPeCacheKey && msg.enhanced_prompt && !msg.error) {
1914
  peCache = { key: pendingPeCacheKey, enhanced_prompt: msg.enhanced_prompt, raw_prompt: msg.raw_prompt || "", model: msg.model || "" };
1915
  }
1916
  return;
@@ -1984,16 +1979,6 @@ async function start() {
1984
  if (outputWaitIco) outputWaitIco.textContent = "✨";
1985
  if (outputWaitHint) outputWaitHint.textContent = t("pe_running");
1986
  waitHintReason = "pe_running"; waitHintAt = Date.now();
1987
- if (peWatchdog) clearTimeout(peWatchdog);
1988
- peWatchdog = setTimeout(() => {
1989
- peWatchdog = null;
1990
- if (!pePausedSend) return;
1991
- pePausedSend = false;
1992
- if (usingVideoFile) {
1993
- try { camera.pause(); } catch (err) {}
1994
- startVideoPull();
1995
- }
1996
- }, 30000);
1997
  return;
1998
  }
1999
  if (msg.type === "chunk_done") {
@@ -2121,7 +2106,6 @@ async function start() {
2121
  outputPlaybackIntervalMs = null;
2122
  clearOutputQueue();
2123
  stopRecordDrain();
2124
- if (peWatchdog) { clearTimeout(peWatchdog); peWatchdog = null; }
2125
  finalizeIsForResult = false;
2126
  resultEpoch += 1;
2127
  ws = null;
 
170
  /* panel titles go icon-only so 摄像头/MP4 fits the narrow head */
171
  .vpanel-head .vp-title span[data-i18n] { display: none; }
172
  .cmd-input { font-size: 12px; max-height: 125px; }
173
+ /* bottom sheet: the cmdbar is tall on mobile, absolute-above would cover the camera */
174
+ .cards-pop { position: fixed; left: 8px; right: 8px; bottom: 8px; }
175
  .team-strip { flex-wrap: wrap; padding: 0 12px 10px; }
176
  .team-strip .team-thumbs { width: 100%; display: grid; grid-template-columns: repeat(2, 1fr); }
177
  .team-strip .team-thumbs img:first-child { grid-column: 1 / -1; }
 
411
  stage_ws: "WS 发送", stage_total: "服务端合计", stage_residence: "服务端驻留",
412
  stage_enc_q: "编码队列", stage_ws_buf: "发送缓冲", stage_recv_q: "接收队列",
413
  busy_released: "已释放", busy_disconnected: "已断开", busy_conn_err: "连接错误",
 
414
  reset_count_changed: "检测到人数变化,重新编辑",
415
  reset_person_returned: "重新检测到人,重新开始编辑",
416
  reset_kv: "已连续编辑较久,正在重新校准,请保持人脸居中 😊",
 
489
  stage_ws: "WS send", stage_total: "Server total", stage_residence: "Server residence",
490
  stage_enc_q: "Encode queue", stage_ws_buf: "Send buffer", stage_recv_q: "Recv queue",
491
  busy_released: "Released", busy_disconnected: "Disconnected", busy_conn_err: "Connection error",
 
492
  reset_count_changed: "Person count changed, re-editing",
493
  reset_person_returned: "Person detected again, restarting the edit",
494
  reset_kv: "Editing for a while — recalibrating, please keep your face centered 😊",
 
745
  let resultEpoch = 0;
746
  let resultSyncActive = false;
747
  let resultSyncHandlers = null;
 
748
  let finalizeWatchdog = null;
749
  function stopRecordDrain() {
750
  if (finalizeWatchdog) { clearTimeout(finalizeWatchdog); finalizeWatchdog = null; }
 
1895
  return;
1896
  }
1897
  if (msg.type === "prompt_enhanced") {
 
1898
  pePausedSend = false;
1899
  clearOutputQueue();
1900
  lastShownCaptureMs = Date.now();
 
1903
  try { camera.pause(); } catch (err) {}
1904
  startVideoPull();
1905
  }
 
 
 
1906
  const enhanced = msg.enhanced_prompt || msg.raw_prompt || "";
1907
+ showPeResult((msg.error || msg.fallback) ? "" : enhanced, msg.model);
1908
+ if (pendingPeCacheKey && msg.enhanced_prompt && !msg.error && !msg.fallback) {
1909
  peCache = { key: pendingPeCacheKey, enhanced_prompt: msg.enhanced_prompt, raw_prompt: msg.raw_prompt || "", model: msg.model || "" };
1910
  }
1911
  return;
 
1979
  if (outputWaitIco) outputWaitIco.textContent = "✨";
1980
  if (outputWaitHint) outputWaitHint.textContent = t("pe_running");
1981
  waitHintReason = "pe_running"; waitHintAt = Date.now();
 
 
 
 
 
 
 
 
 
 
1982
  return;
1983
  }
1984
  if (msg.type === "chunk_done") {
 
2106
  outputPlaybackIntervalMs = null;
2107
  clearOutputQueue();
2108
  stopRecordDrain();
 
2109
  finalizeIsForResult = false;
2110
  resultEpoch += 1;
2111
  ws = null;