fix(dashboard): keep shell during menu transitions
Replace document navigation with native Streamlit state transitions, preserve dashboard contracts, and add regression plus authenticated browser evidence for Issue #9.
This commit is contained in:
+14
-6
@@ -12,7 +12,15 @@ if __package__ in (None, ""):
|
||||
|
||||
st.set_page_config(page_title="Jarca Ledger", page_icon="💰", layout="wide")
|
||||
|
||||
from dashboard.common import clear_cache, get_db_path, get_transfer_review_items, inject_app_css, render_sidebar_nav # noqa: F401
|
||||
from dashboard.common import (
|
||||
clear_cache,
|
||||
get_db_path,
|
||||
get_transfer_review_items, # noqa: F401
|
||||
inject_app_css,
|
||||
render_dashboard_body,
|
||||
render_sidebar_nav,
|
||||
validate_dashboard_page,
|
||||
) # noqa: F401
|
||||
from dashboard.authentication import require_dashboard_authentication
|
||||
from dashboard.page_views.accounts import page_accounts
|
||||
from dashboard.page_views.assets import page_assets
|
||||
@@ -32,15 +40,15 @@ def main() -> None:
|
||||
db_path = get_db_path()
|
||||
inject_app_css()
|
||||
pages = ["월정산", "요약", "자산/마감", "거래내역", "확인필요 큐", "미분류", "분류 규칙", "카테고리", "계좌", "Import"]
|
||||
query_page = st.query_params.get("page", "요약")
|
||||
page = query_page if query_page in pages else "요약"
|
||||
st.session_state["page"] = page
|
||||
query_page = st.query_params.get("page")
|
||||
page = validate_dashboard_page(query_page, pages)
|
||||
st.session_state["dashboard_page"] = page
|
||||
|
||||
with st.sidebar:
|
||||
st.markdown("## 💰 Jarca Ledger")
|
||||
st.caption("가계부 · 분류 · Import 운영 콘솔")
|
||||
st.markdown('<div class="jarca-nav-title">메뉴</div>', unsafe_allow_html=True)
|
||||
render_sidebar_nav(pages, page)
|
||||
page = render_sidebar_nav(pages, page)
|
||||
if st.button("새로고침", key="refresh_button", use_container_width=True):
|
||||
clear_cache()
|
||||
st.rerun()
|
||||
@@ -56,7 +64,7 @@ def main() -> None:
|
||||
"계좌": page_accounts,
|
||||
"Import": page_imports,
|
||||
}
|
||||
dispatch[page](db_path)
|
||||
render_dashboard_body(page, lambda: dispatch[page](db_path))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user