Răsfoiți Sursa

fix: deduplicate agent config buttons

zhenyu.hu 3 săptămâni în urmă
părinte
comite
3ee861721b

+ 0 - 2
src/agent_lab/presentation/static/app.js

@@ -40,12 +40,10 @@ document.querySelector("#open-prompt-config").addEventListener("click", () => {
 document.querySelector("#close-prompt-config").addEventListener("click", () => {
   promptDialog.close();
 });
-document.querySelector("#open-chat-config").addEventListener("click", openChatConfig);
 document.querySelector("#open-chat-config-panel").addEventListener("click", openChatConfig);
 document.querySelector("#close-chat-config").addEventListener("click", () => {
   chatConfigDialog.close();
 });
-document.querySelector("#open-event-config").addEventListener("click", openEventConfig);
 document.querySelector("#open-event-config-panel").addEventListener("click", openEventConfig);
 document.querySelector("#close-event-config").addEventListener("click", () => {
   eventConfigDialog.close();

+ 0 - 2
src/agent_lab/presentation/static/index.html

@@ -11,8 +11,6 @@
       <h1>Agent Lab</h1>
       <div class="top-actions">
         <button id="open-prompt-config" type="button">Prompt Config</button>
-        <button id="open-chat-config" type="button">Chat Config</button>
-        <button id="open-event-config" type="button">Event Config</button>
         <div id="connection-status" class="status">Idle</div>
       </div>
     </header>

+ 8 - 4
tests/test_websocket_api.py

@@ -505,10 +505,14 @@ def test_static_agent_config_controls_are_aligned_for_chat_and_event_agents():
 
     assert '<dialog id="chat-config-dialog"' in html
     assert '<dialog id="event-config-dialog"' in html
-    assert 'id="open-chat-config"' in html
-    assert 'id="open-event-config"' in html
-    assert 'id="open-chat-config-panel"' in html
-    assert 'id="open-event-config-panel"' in html
+    assert html.count('id="open-chat-config-panel"') == 1
+    assert html.count('id="open-event-config-panel"') == 1
+    assert 'id="open-chat-config"' not in html
+    assert 'id="open-event-config"' not in html
+    assert '#open-chat-config"' not in js
+    assert '#open-event-config"' not in js
+    assert '#open-chat-config-panel"' in js
+    assert '#open-event-config-panel"' in js
     assert 'id="close-chat-config"' in html
     assert 'id="close-event-config"' in html
     assert "chatConfigDialog.showModal()" in js