Skip to content

Commit 3231e7a

Browse files
rdhyeeclaude
andauthored
Implement per-section sidebars matching Figma wireframe (#109)
Each section (How to Use, About, Architecture, Research) now shows only its own sidebar items instead of a single combined sidebar. Updates navigation tests to verify section isolation. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 797fc0b commit 3231e7a

2 files changed

Lines changed: 59 additions & 46 deletions

File tree

_quarto.yml

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,11 @@ website:
5858
- icon: slack
5959
href: https://isamples.slack.com/
6060
sidebar:
61-
style: "docked"
62-
search: true
63-
contents:
64-
- href: index.qmd
65-
text: Home
66-
- href: tutorials/progressive_globe.qmd
67-
text: Interactive Explorer
68-
- section: "How to Use"
69-
contents:
61+
- id: how-to-use
62+
title: "How to Use"
63+
style: "docked"
64+
search: true
65+
contents:
7066
- href: how-to-use.qmd
7167
text: Overview
7268
- text: "Deep-Dive Analysis"
@@ -77,8 +73,11 @@ website:
7773
href: tutorials/isamples_explorer.qmd
7874
- text: "Technical: Narrow vs Wide"
7975
href: tutorials/narrow_vs_wide_performance.qmd
80-
- section: "About"
81-
contents:
76+
- id: about
77+
title: "About"
78+
style: "docked"
79+
search: true
80+
contents:
8281
- href: about.qmd
8382
text: Objectives
8483
- text: "PIs and Contributors"
@@ -87,18 +86,24 @@ website:
8786
href: "about.qmd#photo-gallery"
8887
- text: "Background & History"
8988
href: "about.qmd#background-history"
90-
- section: "Architecture & Vocabularies"
91-
contents:
92-
- href: design/index.qmd
93-
text: Overview
94-
- href: design/requirements.md
95-
text: Requirements
96-
- text: Schema
97-
href: "https://isamplesorg.github.io/metadata/"
98-
- href: models/index.qmd
99-
text: Vocabularies
100-
- section: "Research & Resources"
101-
contents:
89+
- id: architecture
90+
title: "Architecture & Vocabularies"
91+
style: "docked"
92+
search: true
93+
contents:
94+
- href: design/index.qmd
95+
text: Overview
96+
- href: design/requirements.md
97+
text: Requirements
98+
- text: Schema
99+
href: "https://isamplesorg.github.io/metadata/"
100+
- href: models/index.qmd
101+
text: Vocabularies
102+
- id: research
103+
title: "Research & Resources"
104+
style: "docked"
105+
search: true
106+
contents:
102107
- text: Publications & Conferences
103108
href: pubs.qmd
104109
- text: Zenodo Community

tests/test_navigation.py

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,45 @@
88
from conftest import SITE_URL
99

1010

11-
class TestSidebarSections:
12-
"""Sidebar should show the wireframe's section names."""
11+
class TestPerSectionSidebars:
12+
"""Each section should show ONLY its own sidebar items (per-section sidebars)."""
1313

14-
def test_sidebar_shows_architecture_and_vocabularies(self, page):
15-
page.goto(f"{SITE_URL}/about.html", wait_until="domcontentloaded")
14+
def test_how_to_use_sidebar_only_shows_own_items(self, page):
15+
page.goto(f"{SITE_URL}/how-to-use.html", wait_until="domcontentloaded")
1616
sidebar = page.locator(".sidebar-navigation")
17-
assert sidebar.get_by_text("Architecture & Vocabularies").count() > 0
17+
assert sidebar.get_by_text("Overview", exact=True).count() > 0
18+
# Should NOT show items from other sections
19+
assert sidebar.get_by_text("Objectives", exact=True).count() == 0
20+
assert sidebar.get_by_text("Vocabularies", exact=True).count() == 0
1821

19-
def test_sidebar_does_not_show_old_information_architecture(self, page):
22+
def test_about_sidebar_only_shows_own_items(self, page):
2023
page.goto(f"{SITE_URL}/about.html", wait_until="domcontentloaded")
2124
sidebar = page.locator(".sidebar-navigation")
22-
assert sidebar.get_by_text("Information Architecture").count() == 0
25+
assert sidebar.get_by_text("Objectives", exact=True).count() > 0
26+
# Should NOT show items from other sections
27+
assert sidebar.get_by_text("Deep-Dive Analysis").count() == 0
28+
assert sidebar.get_by_text("Vocabularies", exact=True).count() == 0
2329

24-
def test_sidebar_shows_research_and_resources(self, page):
25-
page.goto(f"{SITE_URL}/about.html", wait_until="domcontentloaded")
30+
def test_architecture_sidebar_only_shows_own_items(self, page):
31+
page.goto(f"{SITE_URL}/design/index.html", wait_until="domcontentloaded")
2632
sidebar = page.locator(".sidebar-navigation")
27-
assert sidebar.get_by_text("Research & Resources").count() > 0
33+
assert sidebar.get_by_text("Vocabularies", exact=True).count() > 0
34+
# Should NOT show items from other sections
35+
assert sidebar.get_by_text("Objectives", exact=True).count() == 0
36+
assert sidebar.get_by_text("Deep-Dive Analysis").count() == 0
2837

29-
def test_sidebar_does_not_show_separate_published_research(self, page):
30-
page.goto(f"{SITE_URL}/about.html", wait_until="domcontentloaded")
38+
def test_research_sidebar_only_shows_own_items(self, page):
39+
page.goto(f"{SITE_URL}/pubs.html", wait_until="domcontentloaded")
3140
sidebar = page.locator(".sidebar-navigation")
32-
assert sidebar.get_by_text("Published Research", exact=True).count() == 0
41+
assert sidebar.get_by_text("Publications & Conferences").count() > 0
42+
# Should NOT show items from other sections
43+
assert sidebar.get_by_text("Objectives", exact=True).count() == 0
44+
assert sidebar.get_by_text("Deep-Dive Analysis").count() == 0
3345

34-
def test_sidebar_does_not_show_separate_resources(self, page):
35-
page.goto(f"{SITE_URL}/about.html", wait_until="domcontentloaded")
46+
def test_sidebar_does_not_show_old_information_architecture(self, page):
47+
page.goto(f"{SITE_URL}/design/index.html", wait_until="domcontentloaded")
3648
sidebar = page.locator(".sidebar-navigation")
37-
# "Resources" alone shouldn't appear as a section header
38-
# (it's OK inside "Research & Resources")
39-
sections = sidebar.locator(".sidebar-section .sidebar-section-header")
40-
texts = [s.text_content().strip() for s in sections.all()]
41-
assert "Resources" not in texts
49+
assert sidebar.get_by_text("Information Architecture").count() == 0
4250

4351

4452
class TestSidebarHowToUse:
@@ -122,17 +130,17 @@ class TestSidebarResearchResources:
122130
"""Research & Resources should have 3 items matching wireframe."""
123131

124132
def test_has_publications_and_conferences(self, page):
125-
page.goto(f"{SITE_URL}/about.html", wait_until="domcontentloaded")
133+
page.goto(f"{SITE_URL}/pubs.html", wait_until="domcontentloaded")
126134
sidebar = page.locator(".sidebar-navigation")
127135
assert sidebar.get_by_text("Publications & Conferences").count() > 0
128136

129137
def test_has_zenodo_community(self, page):
130-
page.goto(f"{SITE_URL}/about.html", wait_until="domcontentloaded")
138+
page.goto(f"{SITE_URL}/pubs.html", wait_until="domcontentloaded")
131139
sidebar = page.locator(".sidebar-navigation")
132140
assert sidebar.get_by_text("Zenodo Community").count() > 0
133141

134142
def test_has_github_repositories(self, page):
135-
page.goto(f"{SITE_URL}/about.html", wait_until="domcontentloaded")
143+
page.goto(f"{SITE_URL}/pubs.html", wait_until="domcontentloaded")
136144
sidebar = page.locator(".sidebar-navigation")
137145
assert sidebar.get_by_text("Github Repositories").count() > 0
138146

0 commit comments

Comments
 (0)