feat: persist collapsible dashboard panels
This commit is contained in:
1 parent
8a406b6254
commit
6bfc97dcdf
2 files changed
+75
-28
No files matched your search
@@ -0,0 +1,22 @@
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
DASHBOARD = Path("frontend/index.html")
|
||||
|
||||
|
||||
def test_dashboard_panels_are_independently_collapsible():
|
||||
html = DASHBOARD.read_text()
|
||||
|
||||
for panel_key in ("context", "ai-stream", "issues", "pull-requests", "widgets", "layout", "markdown"):
|
||||
assert f'<details class="panel' in html
|
||||
assert f'data-panel-key="{panel_key}"' in html
|
||||
|
||||
|
||||
def test_panel_open_state_is_restored_and_saved_in_local_storage():
|
||||
html = DASHBOARD.read_text()
|
||||
|
||||
assert 'const PANEL_STATE_KEY = "stackchain.panel-state.v1"' in html
|
||||
assert "localStorage.getItem(PANEL_STATE_KEY)" in html
|
||||
assert "panel.open = savedState[panel.dataset.panelKey]" in html
|
||||
assert "localStorage.setItem(PANEL_STATE_KEY" in html
|
||||
assert "panel.addEventListener('toggle'" in html
|
||||
Reference in new issue
Block a user