akhaliq HF Staff commited on
Commit
b85818d
·
1 Parent(s): 6f592e9

Embed brand logo image, fix blocking client connection and style header buttons

Browse files
Files changed (3) hide show
  1. static/app.js +10 -9
  2. static/index.html +1 -5
  3. static/style.css +8 -0
static/app.js CHANGED
@@ -77,14 +77,15 @@ async function initializeApp() {
77
  dom.apiKeyInput.value = STATE.apiKey;
78
  }
79
 
80
- // 2. Connect Gradio Client
81
- try {
82
- STATE.gradioClient = await Client.connect(window.location.origin);
83
- console.log("Successfully connected to Gradio.Server backend.");
84
- } catch (e) {
85
- console.error("Gradio Client Connection Failed:", e);
86
- appendSystemLog("Gradio Server connection is restricted.", true);
87
- }
 
88
 
89
  // 3. Register Sidebar Drawer Slide Events (Drawer + Overlay)
90
  dom.btnToggleRight.addEventListener("click", () => toggleSettingsDrawer(true));
@@ -410,7 +411,7 @@ async function triggerPromptSubmission(inputElement) {
410
  // 3. Connect API Call
411
  try {
412
  if (!STATE.gradioClient) {
413
- throw new Error("Gradio server is not connected.");
414
  }
415
 
416
  const responseId = appendAssistantPlaceholderBubble();
 
77
  dom.apiKeyInput.value = STATE.apiKey;
78
  }
79
 
80
+ // 2. Connect Gradio Client in background (Non-blocking)
81
+ Client.connect(window.location.origin)
82
+ .then(client => {
83
+ STATE.gradioClient = client;
84
+ console.log("Successfully connected to Gradio.Server backend.");
85
+ })
86
+ .catch(e => {
87
+ console.error("Gradio Client Connection Failed:", e);
88
+ });
89
 
90
  // 3. Register Sidebar Drawer Slide Events (Drawer + Overlay)
91
  dom.btnToggleRight.addEventListener("click", () => toggleSettingsDrawer(true));
 
411
  // 3. Connect API Call
412
  try {
413
  if (!STATE.gradioClient) {
414
+ throw new Error("Gradio server is initializing. Please wait a few seconds and try sending again.");
415
  }
416
 
417
  const responseId = appendAssistantPlaceholderBubble();
static/index.html CHANGED
@@ -24,11 +24,7 @@
24
  <!-- Top Navigation Bar -->
25
  <header class="workspace-header">
26
  <div class="header-brand">
27
- <svg viewBox="0 0 100 100" width="24" height="24" fill="currentColor">
28
- <circle cx="50" cy="50" r="46" fill="#111827"/>
29
- <path d="M35 30 C35 30, 48 40, 48 55 C48 70, 35 70, 35 70" stroke="#ffffff" stroke-width="8" stroke-linecap="round" fill="none"/>
30
- <circle cx="62" cy="50" r="7" fill="#ffffff"/>
31
- </svg>
32
  <span class="brand-name">Step-3.7-Flash</span>
33
  </div>
34
 
 
24
  <!-- Top Navigation Bar -->
25
  <header class="workspace-header">
26
  <div class="header-brand">
27
+ <img src="https://cdn-avatars.huggingface.co/v1/production/uploads/644f7e6233ac8f46fa0b9e26/CmF2ocXhkr2UtHXgmwq7-.png" alt="Step-3.7-Flash Logo" class="brand-logo-img">
 
 
 
 
28
  <span class="brand-name">Step-3.7-Flash</span>
29
  </div>
30
 
static/style.css CHANGED
@@ -112,6 +112,14 @@ body {
112
  gap: 10px;
113
  }
114
 
 
 
 
 
 
 
 
 
115
  .brand-name {
116
  font-family: var(--font-heading);
117
  font-size: 15px;
 
112
  gap: 10px;
113
  }
114
 
115
+ .brand-logo-img {
116
+ width: 24px;
117
+ height: 24px;
118
+ object-fit: contain;
119
+ border-radius: 50%;
120
+ flex-shrink: 0;
121
+ }
122
+
123
  .brand-name {
124
  font-family: var(--font-heading);
125
  font-size: 15px;