feat(hub): settings toggles for funds and dashboard nav

Add show_nav_funds and show_nav_dashboard in hub_settings display prefs to hide top nav entries and redirect direct URL access.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-11 11:00:19 +08:00
parent 07e8604ea6
commit 007e089121
6 changed files with 89 additions and 14 deletions
+5 -2
View File
@@ -11,6 +11,8 @@ SETTINGS_PATH = DIR / "hub_settings.json"
DEFAULT_DISPLAY = {
"show_account_pnl": True,
"show_nav_funds": True,
"show_nav_dashboard": True,
}
DEFAULT_EXCHANGES = [
@@ -72,8 +74,9 @@ def env_force_disabled_ids() -> set[str]:
def normalize_display_prefs(raw: dict | None) -> dict:
out = dict(DEFAULT_DISPLAY)
if isinstance(raw, dict):
if "show_account_pnl" in raw:
out["show_account_pnl"] = bool(raw.get("show_account_pnl"))
for key in DEFAULT_DISPLAY:
if key in raw:
out[key] = bool(raw.get(key))
return out