refactor: establish shared frontend shell

This commit is contained in:
leefer
2026-07-29 21:38:38 +08:00
parent e177f21d1c
commit 8d617cfa17
8 changed files with 380 additions and 173 deletions
+4 -4
View File
@@ -254,8 +254,8 @@
"code_hotspots": [
{
"path": "static/app.js",
"bytes": 447568,
"lines": 9403
"bytes": 441609,
"lines": 9262
},
{
"path": "static/styles.css",
@@ -274,8 +274,8 @@
},
{
"path": "static/index.html",
"bytes": 133691,
"lines": 1873
"bytes": 133815,
"lines": 1875
},
{
"path": "database.py",
@@ -0,0 +1,42 @@
# Stage 15: Shared Frontend Shell and Page Registry
## Runtime Page Registry
`static/pages.config.js` is the build-free runtime representation of
`config/pages.config.json`. It registers every primary workspace plus the internal strategy
tracking workspace. Automated parity checks prevent titles, feature ownership, access labels,
groups, default-page selection, and layout metadata from drifting between the two registries.
Legacy route aliases are resolved by the registry instead of page business code. The registry
describes navigation and presentation metadata only; backend authorization remains
authoritative.
## Shared Shell
`static/shared/shell.js` now owns:
- sidebar initialization, persistence, collapse state, and responsive control labels;
- primary and mobile navigation binding and active-state synchronization;
- workspace mounting, entry animation, URL state, and scroll reset;
- header command-menu lifecycle;
- market-summary expansion;
- status-bar page titles and data dates;
- the single-open-dialog lifecycle used by global application dialogs.
`static/app.js` retains feature-specific enter and leave behavior, such as stopping Wentian
animations or loading auction data. It asks the shell to mount a registered page and no longer
mutates global page geometry directly.
## Compatibility
- Existing DOM IDs, CSS classes, query parameters, page animations, and mobile navigation are
unchanged.
- `screenerTrackingView` continues to highlight the Intelligent Screener navigation item.
- Existing function entry points remain as thin compatibility facades where feature code still
calls status, dialog, or command-menu services.
## Residual Risk
Feature renderers and feature event binding still share `static/app.js`. Their state ownership
is now explicit and their shell dependencies are removed, so later page-module extraction can
be performed one feature at a time instead of as a single rewrite.