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:
@@ -221,3 +221,41 @@ Set-Cookie: __Host-jarca_dashboard_auth=; Max-Age=0; Secure; HttpOnly; SameSite=
|
||||
- 실패 계약: wrong credential, invalid configuration, cross-origin, malformed cookie tests
|
||||
- 경계 계약: expiry, rotation, oversized token, same-host different-port origin tests
|
||||
- 구현·스키마·예시 정합성: `tests/test_dashboard_auth_server.py`, `tests/test_dashboard_authentication_app.py`, `tests/test_dashboard_persistent_authentication.py`, source/document redaction search
|
||||
|
||||
## Dashboard 메뉴 전환 계약 — REQ-002
|
||||
|
||||
### dashboard-menu-transition
|
||||
|
||||
- 책임: authenticated Dashboard에서 공통 shell/background를 유지하고 선택된 page body만 교체한다.
|
||||
- 종류·프로토콜: Streamlit rerun, `st.radio` callback, query parameter
|
||||
- 호출 대상·operation: `dashboard.app.main()` → `render_sidebar_nav()` → `render_dashboard_body()`
|
||||
- 버전: 1.0
|
||||
- 호출 주체: authenticated browser
|
||||
- 인증 방식: 기존 `gate` 계약 선행; 메뉴는 인증을 우회하지 않음
|
||||
- 필요 권한: valid Dashboard auth cookie
|
||||
|
||||
#### 상태와 입력
|
||||
|
||||
정확한 menu options/order는 `월정산`, `요약`, `자산/마감`, `거래내역`, `확인필요 큐`, `미분류`, `분류 규칙`, `카테고리`, `계좌`, `Import`이다. selected value는 `st.session_state["dashboard_page"]`에 둔다. 직접 query의 `page`가 known option이면 해당 page를, absent/unknown이면 `요약`을 사용한다.
|
||||
|
||||
#### 출력·불변조건
|
||||
|
||||
- callback은 `st.query_params["page"]`만 갱신하고 `month`, `account_id`, `filter` 등 sibling key를 보존한다.
|
||||
- menu click은 document/path navigation이 아니며 stable `st.empty` body container 안에서 target renderer를 실행한다.
|
||||
- 공통 sidebar, refresh control, CSS/background는 유지하고 body만 target content로 대체한다.
|
||||
- 느린 target에는 `<target> 불러오는 중…`을 표시한 뒤 renderer 완료 시 placeholder를 제거한다.
|
||||
- renderer 예외는 body 안의 `페이지를 불러오지 못했습니다. 다시 시도해 주세요.`와 retry control로 대체하며 예외 상세를 노출하지 않는다.
|
||||
- serialized callback이 여러 번 실행되면 마지막 selection이 query와 body의 최종 상태가 된다.
|
||||
|
||||
#### 오류
|
||||
|
||||
| 코드 | 분류 | 발생 조건 | 재시도 가능 여부 | 호출자 대응 | 실패 시 상태 변경 |
|
||||
|---|---|---|---|---|---|
|
||||
| `page_fallback` | request | missing/unknown `page` | 가능 | `요약` 표시 | sibling query 유지 |
|
||||
| `renderer_unavailable` | rendering | target renderer exception | 가능 | generic error의 retry 클릭 | previous body 제거, auth/shell 유지 |
|
||||
|
||||
#### 검증 경계
|
||||
|
||||
AppTest는 callback, query mapping, synthetic renderer output과 error/loading event를 검증하지만 실제 browser의 document navigation 부재, paint timing, focus/scroll, network request 또는 perceived shell continuity를 증명하지 않는다. 따라서 `REQ-002.03-AC01`은 authenticated real-browser evidence가 필수이며 AppTest는 companion evidence일 뿐이다. history/back-forward와 path URL은 계약에서 제외한다.
|
||||
|
||||
상세 acceptance target은 `docs/requirements/req-002_dashboard-menu-transition.md`의 `REQ-002.01-AC01`부터 `REQ-002.09-AC01`까지를 따른다.
|
||||
|
||||
Reference in New Issue
Block a user