Skip to content

Commit 48b5788

Browse files
committed
feat(devtools): add navigation and display for heading structure and links preview in SEO tab
This commit enhances the SEO tab by introducing new navigation buttons for 'Heading Structure' and 'Links Preview', allowing users to easily switch between these views. It also updates the display logic to show the corresponding sections when selected, improving the overall user experience and accessibility of SEO insights. The SEO overview section has been adjusted to maintain a cohesive structure.
1 parent ae90128 commit 48b5788

2 files changed

Lines changed: 22 additions & 22 deletions

File tree

packages/devtools/src/tabs/seo-tab/index.tsx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@ export const SeoTab = () => {
2525
>
2626
SEO overview
2727
</button>
28+
<button
29+
type="button"
30+
class={`${styles().seoSubNavLabel} ${activeView() === 'heading-structure' ? styles().seoSubNavLabelActive : ''}`}
31+
onClick={() => setActiveView('heading-structure')}
32+
>
33+
Heading Structure
34+
</button>
35+
<button
36+
type="button"
37+
class={`${styles().seoSubNavLabel} ${activeView() === 'links-preview' ? styles().seoSubNavLabelActive : ''}`}
38+
onClick={() => setActiveView('links-preview')}
39+
>
40+
Links Preview
41+
</button>
2842
<button
2943
type="button"
3044
class={`${styles().seoSubNavLabel} ${activeView() === 'social-previews' ? styles().seoSubNavLabelActive : ''}`}
@@ -46,25 +60,17 @@ export const SeoTab = () => {
4660
>
4761
JSON-LD Preview
4862
</button>
49-
<button
50-
type="button"
51-
class={`${styles().seoSubNavLabel} ${activeView() === 'heading-structure' ? styles().seoSubNavLabelActive : ''}`}
52-
onClick={() => setActiveView('heading-structure')}
53-
>
54-
Heading Structure
55-
</button>
56-
<button
57-
type="button"
58-
class={`${styles().seoSubNavLabel} ${activeView() === 'links-preview' ? styles().seoSubNavLabelActive : ''}`}
59-
onClick={() => setActiveView('links-preview')}
60-
>
61-
Links Preview
62-
</button>
6363
</nav>
6464

6565
<Show when={activeView() === 'overview'}>
6666
<SeoOverviewSection goTo={(view) => setActiveView(view)} />
6767
</Show>
68+
<Show when={activeView() === 'heading-structure'}>
69+
<HeadingStructurePreviewSection />
70+
</Show>
71+
<Show when={activeView() === 'links-preview'}>
72+
<LinksPreviewSection />
73+
</Show>
6874
<Show when={activeView() === 'social-previews'}>
6975
<SocialPreviewsSection />
7076
</Show>
@@ -74,12 +80,6 @@ export const SeoTab = () => {
7480
<Show when={activeView() === 'json-ld-preview'}>
7581
<JsonLdPreviewSection />
7682
</Show>
77-
<Show when={activeView() === 'heading-structure'}>
78-
<HeadingStructurePreviewSection />
79-
</Show>
80-
<Show when={activeView() === 'links-preview'}>
81-
<LinksPreviewSection />
82-
</Show>
8383
</MainPanel>
8484
)
8585
}

packages/devtools/src/tabs/seo-tab/seo-overview.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,11 @@ export function SeoOverviewSection(props: { goTo: (view: SeoDetailView) => void
139139
const links = getLinksPreviewSummary()
140140

141141
const rows: Array<OverviewRow> = [
142+
{ id: 'heading-structure', title: 'Heading structure', summary: headings },
143+
{ id: 'links-preview', title: 'Links', summary: links },
142144
{ id: 'social-previews', title: 'Social previews', summary: social },
143145
{ id: 'serp-preview', title: 'SERP preview', summary: serp },
144146
{ id: 'json-ld-preview', title: 'JSON-LD', summary: jsonLd },
145-
{ id: 'heading-structure', title: 'Heading structure', summary: headings },
146-
{ id: 'links-preview', title: 'Links', summary: links },
147147
]
148148

149149
const canonicalSummary: SeoSectionSummary = {

0 commit comments

Comments
 (0)