Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dashboard/backend/tests/test_admin_analytics_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ def test_profile_menu_admin_entry_opens_the_admin_page():
def test_app_lifecycle_and_cache_versions_are_wired():
# Lockstep owner for the console's bumped tags and the /admin page's pins:
# every bump edits this test in the same change (Global Constraints).
assert 'styles.css?v=145' in APP_HTML
assert 'app.js?v=138' in APP_HTML
assert 'styles.css?v=146' in APP_HTML
assert 'app.js?v=140' in APP_HTML
assert 'js/admin-tabs.js?v=12' in APP_HTML
for tag in (
'href="admin.css?v=4"',
Expand Down
2 changes: 1 addition & 1 deletion dashboard/backend/tests/test_analytics_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def _function_body(source: str, signature: str) -> str:


def test_analytics_script_loads_between_app_and_page_scripts():
app_at = APP_HTML.index('<script src="app.js?v=138" defer></script>')
app_at = APP_HTML.index('<script src="app.js?v=140" defer></script>')
analytics_at = APP_HTML.index(
'<script src="js/analytics.js?v=1" defer></script>'
)
Expand Down
4 changes: 2 additions & 2 deletions dashboard/backend/tests/test_backtest_comparison_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ def test_exact_raw_ties_mark_every_tied_series_best():

def test_comparison_script_and_semantic_table_ship_before_app():
helper = '<script src="js/backtest-comparison.js?v=1" defer></script>'
app = '<script src="app.js?v=138" defer></script>'
assert 'href="styles.css?v=145"' in APP_HTML
app = '<script src="app.js?v=140" defer></script>'
assert 'href="styles.css?v=146"' in APP_HTML
assert APP_HTML.index(helper) < APP_HTML.index(app)
for element_id in (
"performanceLegend",
Expand Down
4 changes: 2 additions & 2 deletions dashboard/backend/tests/test_frontend_fast_boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ def test_cache_busters_bumped():
# the next bump, so the exact one looks like the broken guard and gets
# "fixed" by loosening it. That collision has already cost this repo one
# round of follow-ups (#347/#348).
assert "app.js?v=138" in APP_HTML
assert "app.js?v=140" in APP_HTML
assert "js/agent-editor.js?v=31" in APP_HTML
assert "styles.css?v=145" in APP_HTML
assert "styles.css?v=146" in APP_HTML
assert "js/leaderboard.js?v=33" in APP_HTML
assert "home-page.js?v=50" in APP_HTML
assert "js/credit-format.js?v=1" in APP_HTML
Expand Down
4 changes: 2 additions & 2 deletions dashboard/frontend/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
because every API call is a CORS request. -->
<link rel="preconnect" href="https://agentictrading.onrender.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="styles.css?v=145">
<link rel="stylesheet" href="styles.css?v=146">
<!-- defer: ~200KB that was render-blocking. Deferred scripts execute in
document order (this one first, the body-end ones after), all before
DOMContentLoaded, so Chart is defined before any chart renders. -->
Expand Down Expand Up @@ -2393,7 +2393,7 @@ <h2 id="creditsRefundTitle">Refund Credits purchase</h2>
<script src="market-events/MarketEventFeed.js" defer></script>
<script src="js/portfolio.js?v=18" defer></script>
<script src="js/backtest-comparison.js?v=1" defer></script>
<script src="app.js?v=138" defer></script>
<script src="app.js?v=140" defer></script>
<script src="js/analytics.js?v=1" defer></script>
<script src="js/agent-editor.js?v=31" defer></script>
<script src="js/credit-format.js?v=1" defer></script>
Expand Down
28 changes: 22 additions & 6 deletions dashboard/frontend/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -12983,7 +12983,13 @@ let researchWorkbenchTemplateId = null;
let researchWorkbenchReturnView = null;
let researchPollTimer = null;
let researchSubmitInFlight = false;
document.addEventListener('DOMContentLoaded', () => {
document.getElementById('researchBackBtn')?.addEventListener('click', hideResearchWorkbench);
});

// Back is bound once at init, not per-open: the manifest-failure path returns
// before openResearchWorkbench would reach its binding, and a dead Back on a
// failed-to-load workbench is a trapped user.
function stopResearchPolling() {
if (researchPollTimer) {
clearInterval(researchPollTimer);
Expand Down Expand Up @@ -13027,11 +13033,9 @@ async function renderResearchShelf() {
grid.innerHTML = '';
if (emptyEl) {
emptyEl.hidden = false;
emptyEl.innerHTML = 'No research agents yet. Add one from <button type="button" class="link-btn" data-goto-community>Community</button>.';
emptyEl.innerHTML = 'No research agents yet. Add one from '
+ communityShelfButtonHtml('all') + '.';
}
grid.querySelectorAll('[data-goto-community]').forEach((btn) => {
btn.addEventListener('click', () => navigateToPage('community'));
});
return;
}
if (emptyEl) emptyEl.hidden = true;
Expand All @@ -13048,13 +13052,26 @@ async function renderResearchShelf() {
<svg class="ui-icon research-fact-icon" aria-hidden="true"><use href="#icon-clock"></use></svg> ~${runtimeMin} min ·
<svg class="ui-icon research-fact-icon" aria-hidden="true"><use href="#icon-file-text"></use></svg> ${escapeHtml(((agent.research || {}).output_formats || []).join(' / '))}
</p>
<button type="button" class="auth-btn auth-btn-primary research-open-btn">Open workbench</button>
<div class="research-agent-card-actions">
<button type="button" class="auth-btn auth-btn-primary research-open-btn">Open workbench</button>
<button type="button" class="research-remove-btn" data-remove-template-id="${escapeHtml(agent.template_id)}" data-agent-name="${escapeHtml(agent.name)}">Remove</button>
</div>
</article>`;
}).join('');
grid.querySelectorAll('.research-agent-card').forEach((card) => {
card.querySelector('.research-open-btn')?.addEventListener('click', () => {
openResearchWorkbench(card.dataset.templateId);
});
card.querySelector('.research-remove-btn')?.addEventListener('click', async (event) => {
const templateId = event.currentTarget.dataset.removeTemplateId;
if (!window.confirm(`Remove "${event.currentTarget.dataset.agentName}" from My Agents?\n\nYou can re-add it from Community at any time.`)) return;
try {
await API.request(`${RESEARCH_API}/agents/${encodeURIComponent(templateId)}/add`, { method: 'DELETE' });
await renderResearchShelf();
} catch (error) {
alert(error.message || 'Remove failed.');
}
});
});
}

Expand Down Expand Up @@ -13197,7 +13214,6 @@ async function openResearchWorkbench(templateId) {
submitResearchRun();
});
}
document.getElementById('researchBackBtn').onclick = hideResearchWorkbench;
await loadResearchRuns(templateId);
}

Expand Down
5 changes: 5 additions & 0 deletions dashboard/frontend/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -13880,3 +13880,8 @@ table.sr-only {
@media(max-width:900px){.research-columns{grid-template-columns:1fr}}
.marketplace-card--research{border-color:rgba(103,232,249,.25)}
.research-fact-icon{width:14px;height:14px;vertical-align:-2px;margin-right:2px}
.research-back-btn{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;margin-bottom:16px;border-radius:8px;border:1px solid rgba(148,163,184,.28);background:transparent;color:var(--text-muted,#94a3b8);font:inherit;font-size:13px;cursor:pointer}
.research-back-btn:hover{color:var(--accent,#67e8f9);border-color:rgba(103,232,249,.4)}
.research-agent-card-actions{display:flex;gap:8px;align-items:center}
.research-remove-btn{padding:7px 12px;border-radius:8px;border:1px solid rgba(240,128,128,.35);background:transparent;color:#f08080;font:inherit;font-size:12.5px;cursor:pointer}
.research-remove-btn:hover{border-color:#f08080;background:rgba(240,128,128,.08)}
Loading