From 266d149b332bd54e0ce04e2ef1d8ccc63a1c8113 Mon Sep 17 00:00:00 2001 From: philipp Date: Tue, 12 May 2026 22:52:50 +0200 Subject: [PATCH] Show full imported asset catalog Proof: npm test passed 166/166; npm run operator-dashboard:build passed; focused dashboard static tests cover removing the 20-row asset registry cap and requesting 250 catalog rows. Assumptions: Current 1Click import has 163 supported tokens, so a 250-row dashboard catalog cap exposes the full current catalog while keeping the bootstrap bounded. Still fake: no live funds movement; imported assets remain catalog-visible only unless explicitly inventory/trading enabled. --- src/apps/operator-dashboard.mjs | 2 +- src/lib/postgres.mjs | 2 +- src/operator-dashboard/static/pages/StrategyPage.jsx | 2 +- test/operator-dashboard-app-static.test.mjs | 5 +++++ test/operator-dashboard-ui-static.test.mjs | 5 +++++ 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/apps/operator-dashboard.mjs b/src/apps/operator-dashboard.mjs index e207c0c..d539a85 100644 --- a/src/apps/operator-dashboard.mjs +++ b/src/apps/operator-dashboard.mjs @@ -521,7 +521,7 @@ async function loadBootstrapPayload({ auth, page, pageSize }) { [], sourceErrors, ), - safeSourceLoad('asset_catalog', () => loadAssetCatalogSummary(pool, { limit: 80 }), null, sourceErrors), + safeSourceLoad('asset_catalog', () => loadAssetCatalogSummary(pool, { limit: 250 }), null, sourceErrors), safeSourceLoad('pair_config', () => loadPairConfigSummary(pool), null, sourceErrors), loadServiceSnapshots(), safeSourceLoad('near_intents_status', () => loadNearIntentsStatus(runtimeConfig), null, sourceErrors), diff --git a/src/lib/postgres.mjs b/src/lib/postgres.mjs index 19bc3c4..f05cd56 100644 --- a/src/lib/postgres.mjs +++ b/src/lib/postgres.mjs @@ -632,7 +632,7 @@ export function createTradingConfigStore({ }; } -export async function loadAssetCatalogSummary(pool, { limit = 50 } = {}) { +export async function loadAssetCatalogSummary(pool, { limit = 250 } = {}) { await ensureTradingConfigSchema(pool); const [snapshot, countResult] = await Promise.all([ loadTradingConfig(pool), diff --git a/src/operator-dashboard/static/pages/StrategyPage.jsx b/src/operator-dashboard/static/pages/StrategyPage.jsx index acffe48..89b52e3 100644 --- a/src/operator-dashboard/static/pages/StrategyPage.jsx +++ b/src/operator-dashboard/static/pages/StrategyPage.jsx @@ -333,7 +333,7 @@ function AssetCatalogSection({ assetCatalog, onControl }) { - {items.length ? items.slice(0, 20).map((asset) => ( + {items.length ? items.map((asset) => (
{asset.label || asset.symbol}
diff --git a/test/operator-dashboard-app-static.test.mjs b/test/operator-dashboard-app-static.test.mjs index 5b5014b..c1c9196 100644 --- a/test/operator-dashboard-app-static.test.mjs +++ b/test/operator-dashboard-app-static.test.mjs @@ -14,3 +14,8 @@ test('operator dashboard control proxy catches upstream failures before sending assert.match(source, /buildDashboardControlErrorResponse/); assert.match(source, /failure.statusCode/); }); + +test('operator dashboard requests enough asset catalog rows for the current 1Click import', () => { + assert.match(source, /loadAssetCatalogSummary\(pool,\s*\{\s*limit:\s*250\s*\}\)/); + assert.doesNotMatch(source, /loadAssetCatalogSummary\(pool,\s*\{\s*limit:\s*80\s*\}\)/); +}); diff --git a/test/operator-dashboard-ui-static.test.mjs b/test/operator-dashboard-ui-static.test.mjs index 3e67aad..2c68671 100644 --- a/test/operator-dashboard-ui-static.test.mjs +++ b/test/operator-dashboard-ui-static.test.mjs @@ -58,6 +58,11 @@ test('dashboard UI exposes official NEAR upstream status separately from local f assert.match(serviceCardSource, /decisive_reason/); }); +test('asset registry table renders the loaded catalog without a hidden 20 row cap', () => { + assert.match(strategySource, /items\.map\(\(asset\)/); + assert.doesNotMatch(strategySource, /items\.slice\(0,\s*20\)\.map/); +}); + test('system page exposes deduped environmental conditions history', () => { assert.match(systemSource, /Environmental conditions/);