Dashboard Phase 1 refresh#31
Conversation
|
Follow-up for issue #30 latest comment is implemented on Changed files:
Acceptance results:
Notes:
|
|
i18n follow-up completed on Changed files:
Validation:
|
|
合并说明(Phase 1 收尾) 线上(deepgraph.joulebeat.com,branch a80eaac)实测核验通过:
非本 PR 范畴(已另开后端单子跟进):页面在真实访问下会卡死,根因是后端两处连接/线程泄漏(/api/events SSE 占线程 + 读接口不结束事务导致 idle in transaction),与本前端 PR 无关。 审美级重设计见 #19(Phase 2)。 |
There was a problem hiding this comment.
Pull request overview
This PR refreshes the DeepGraph dashboard “Phase 1” frontend experience on the existing Flask + native JS stack by introducing native i18n, simplifying primary navigation, and improving perceived performance via progressive/idle loading—while adding regression tests to enforce terminology cleanup and i18n parity.
Changes:
- Added native JS i18n (
en/zh) with language persistence anddata-i18napplication across the dashboard UI. - Reorganized navigation to six primary tabs with an Advanced collapsible section, and adjusted Overview to defer heavier panels/graphs.
- Implemented progressive loading + idle prefetch for inactive tabs, plus new tests to lock in Phase 1 behavior and remove legacy labels/dead code.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| web/templates/index.html | Adds data-i18n markup, language toggle, and Advanced collapsible sections for nav + Overview. |
| web/static/js/app.js | Implements i18n helper usage, progressive loading/idle prefetch, and terminology updates throughout UI rendering. |
| web/static/js/i18n.js | New i18n dictionary + runtime language selection, persistence, and DOM application. |
| web/static/js/agenda.js | Switches user-facing strings to i18n keys via tr(). |
| web/static/js/manuscript_routing.js | Switches user-facing strings/alerts to i18n keys via tr(). |
| web/static/css/style.css | Styles language toggle + Advanced nav/panels. |
| web/app.py | Removes duplicate/overwritten _planned_tracks implementation (dead-code cleanup). |
| tests/test_web_app.py | Adds Phase 1 dashboard regression tests (routes, tab layout, i18n parity, legacy-label removal, progressive init). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| function friendlyAutomationStage(status, stage) { | ||
| const key = String(stage || status || '').toLowerCase(); | ||
| if (key.includes('verification')) return 'Checking novelty'; | ||
| if (key.includes('research')) return 'Running EvoScientist research'; | ||
| if (key.includes('review') || key.includes('forge') || key.includes('formal')) return 'Generating experiment plan'; | ||
| if (key.includes('gpu')) return 'Running on GPU'; | ||
| if (key.includes('validation') || key.includes('experiment')) return 'Running experiment'; | ||
| if (key.includes('writing') || key.includes('submission') || key.includes('bundle')) return 'Writing paper'; | ||
| if (key.includes('blocked')) return 'Blocked'; | ||
| if (key.includes('failed')) return 'Failed'; | ||
| if (key.includes('complete')) return 'Complete'; | ||
| return stage || status || 'Queued'; | ||
| if (key.includes('verification')) return tr('status.stage.checkingNovelty'); | ||
| if (key.includes('research')) return tr('status.stage.runningResearch'); | ||
| if (key.includes('review') || key.includes('formal')) return tr('status.stage.generatingPlan'); |
| async function loadTaxonomyDropdown() { | ||
| if (taxonomyFlat.length > 0) return; // already loaded | ||
| taxonomyLoaded = true; | ||
| try { | ||
| taxonomyFlat = await api('/api/taxonomy'); | ||
| const sel = el('evidenceNodeSelect'); | ||
| sel.innerHTML = '<option value="">-- Select a leaf node --</option>'; | ||
| sel.innerHTML = `<option value="">${esc(tr('evidence.option'))}</option>`; |
| <div class="processing-list" id="processingList"> | ||
| <p class="empty-msg" data-i18n="overview.idle"></p> | ||
| </div> |
| </div> | ||
| <div class="paper-flow-list" id="generatedPapersList"> | ||
| <p class="empty-msg">No manuscript runs have been generated yet.</p> | ||
| <p class="empty-msg" data-i18n="empty.generated"></p> | ||
| </div> |
| \end{document}</textarea> | ||
| </details> | ||
| <pre id="mrResultView" style="padding:0;font-size:0.74rem;color:var(--text-dim);max-height:360px;overflow:auto;white-space:pre-wrap;">No result yet.</pre> | ||
| <pre id="mrResultView" style="padding:0;font-size:0.74rem;color:var(--text-dim);max-height:360px;overflow:auto;white-space:pre-wrap;" data-i18n="manuscript.noResult"></pre> |
Changed files
web/templates/index.htmlweb/static/js/app.jsweb/static/js/i18n.jsweb/static/css/style.cssweb/app.pytests/test_web_app.pySummary
en/zhdictionaries,navigator.languagedefaulting,localStoragelanguage persistence, anddata-i18nstatic text application._planned_tracksimplementation and the obsolete ChineserenderExperimentGroupsfunction.Acceptance commands and results
.venv/bin/python -m pytest tests/test_web_app.py -q->12 passed in 3.63s.venv/bin/python -c "import web.app; print('import ok')"->import okDEEPGRAPH_DB_PATH=/tmp/deepgraph-dashboard-refresh-test.db FLASK_APP=web.app .venv/bin/flask run --host 127.0.0.1 --port 5099; then:curl -s -o /tmp/deepgraph-root.out -w "%{http_code}" http://127.0.0.1:5099/->200curl -s -o /tmp/deepgraph-stats.out -w "%{http_code}" http://127.0.0.1:5099/api/stats->200rg -n "Paper DB|Pipeline Papers|Paper Ideas|Method x Dataset|Method × Dataset|Taxonomy Map|Opportunity Map|Deep Insight|Deep Insights|IDEA #|RUN #|Main run|Research Paper Generation|Generated Papers|Complete Papers|\bforge\b" web/templates/index.html web/static/js/app.js web/static/js/agenda.js web/static/js/manuscript_routing.js-> no matches.venv/bin/python -m py_compile web/app.py-> passedgit diff --check-> passedRedeploy steps
git fetch && git checkout feat/dashboard-refresh.envand database untouched; existing configuration and data are preserved.sudo systemctl restart deepgraph-webhttps://deepgraph.sora2.todayhas a faster first paint, language switching works, and terminology is clean.Known non-goals