Skip to content

refactor(web): split app.js into per-view modules + shared UI helpers#73

Open
smochan wants to merge 3 commits into
mainfrom
feat/dashboard-split-appjs
Open

refactor(web): split app.js into per-view modules + shared UI helpers#73
smochan wants to merge 3 commits into
mainfrom
feat/dashboard-split-appjs

Conversation

@smochan

@smochan smochan commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Summary

Track A2, stacked on #69. Pure extraction, zero behavior change:

  • app.js: 919 → 240 lines — keeps only data fetch, render dispatcher, sidebar/theme shell
  • 6 new view modules (views/overview|hld|flows|matrix|sankey|treemap.js) exposed via window.CGViews.*
  • ui/helpers.js: shared esc/format/tooltip/toast/mermaid-theme/kind helpers via window.CGUI.* with per-view destructuring (matches the repo's no-bundler script-tag architecture)
  • index.html loads helpers → views → app.js in dependency order; no-CDN guard test extended to the new files

Implemented by a Sonnet subagent against a Fable spec; reviewed (namespace wiring, window.state exposure, node --check on every file, payload smoke test) by the orchestrating session.

Test plan

  • Full suite 708 passed; ruff + mypy clean
  • node --check on all new/changed JS
  • Dashboard payload smoke test on a fresh tiny repo

🤖 Generated with Claude Code


Recreated from #70 (auto-closed when its stacked base branch was deleted during the merge train).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

codegraph PR review

Diff vs main · severity ≤ high

codegraph review (target: main)

Diff: +20 / -22 / ~0 nodes, +120 / -305 edges

Findings (4)

severity rule kind qualname file:line score message
critical removed-referenced graph codegraph.web.static.app.esc codegraph/web/static/app.js:864 50 Removed symbol still referenced by callers
critical removed-referenced graph codegraph.web.static.app.mermaidThemeVars codegraph/web/static/app.js:65 50 Removed symbol still referenced by callers
critical removed-referenced graph codegraph.web.static.app.pyvisHref codegraph/web/static/app.js:799 50 Removed symbol still referenced by callers
low new-dead-code graph codegraph.web.static.views.flows._selectFlow codegraph/web/static/views/flows.js:54 10 Potentially unreachable new code

Triggered by codegraph CI · last run

@github-actions

Copy link
Copy Markdown

codegraph PR review

Diff vs main · severity ≤ high

codegraph review (target: main)

Diff: +20 / -22 / ~0 nodes, +120 / -305 edges

Findings (4)

severity rule kind qualname file:line score message
critical removed-referenced graph codegraph.web.static.app.esc codegraph/web/static/app.js:864 50 Removed symbol still referenced by callers
critical removed-referenced graph codegraph.web.static.app.mermaidThemeVars codegraph/web/static/app.js:65 50 Removed symbol still referenced by callers
critical removed-referenced graph codegraph.web.static.app.pyvisHref codegraph/web/static/app.js:799 50 Removed symbol still referenced by callers
low new-dead-code graph codegraph.web.static.views.flows._selectFlow codegraph/web/static/views/flows.js:54 10 Potentially unreachable new code

Triggered by codegraph CI · last run

@github-actions

Copy link
Copy Markdown

codegraph PR review

Diff vs main · severity ≤ high

codegraph review (target: main)

Diff: +36 / -22 / ~0 nodes, +307 / -305 edges

Findings (1)

severity rule kind qualname file:line score message
high new-untested-hotspot graph codegraph.web.static.ui.helpers.CGUI.formatQn codegraph/web/static/ui/helpers.js:22 0 New function with 5 callers and no test coverage

Triggered by codegraph CI · last run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant