@nuxtseo/pro-indexing 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -44,7 +44,7 @@ export default defineNuxtConfig({
44
44
  ```
45
45
 
46
46
  - Import components from `#components`. The layer's auto-imports are off.
47
- - Import the pure modules by path: `@nuxtseo/pro-indexing/shared/source`, `shared/portfolio`, `shared/portfolio-overview`, `shared/changes`, `shared/routes`, `shared/copy`, `shared/config`.
47
+ - Import the pure modules by path: `@nuxtseo/pro-indexing/shared/source`, `shared/portfolio`, `shared/portfolio-overview`, `shared/changes`, `shared/routes`, `shared/copy`, `shared/config`, `shared/urls-query`.
48
48
 
49
49
  ### IndexingSource
50
50
 
@@ -78,6 +78,7 @@ interface IndexingSource {
78
78
  changesRollup?: () => IndexingRead<IndexingChangesRollup>
79
79
  indexNow?: true
80
80
  watchedUrls?: true
81
+ cohortFilter?: true // the urls read honours params.cohort
81
82
  }
82
83
  ```
83
84
 
@@ -93,12 +94,13 @@ export default defineNuxtPlugin((nuxtApp) => {
93
94
  | Indexing capability | Section it turns on |
94
95
  | --- | --- |
95
96
  | `diagnose` | URLs table: the remediation for the filtered issue |
96
- | `inspect` | URLs table: "Re-check with Google" on each row |
97
+ | `inspect` | URLs table: "Re-check with Google" on each row. Its tooltip reports the daily checks left from the last call's `rateLimit` |
97
98
  | `canonicalMismatches` | URLs table: consolidation targets on the `canonical_mismatch` facet |
98
99
  | `cohorts` | `IndexingCohortList` |
99
100
  | `sitemapProblems` | Portfolio Overview: the Sitemap problems tile |
100
101
  | `changesRollup` | `IndexingPortfolioChanges` |
101
102
  | `indexNow`, `watchedUrls` | `IndexingCapabilityGate` around the site's own panel |
103
+ | `cohortFilter` | Index cohort rows link with `?cohort=` (`indexCohortFilterValue`), and the URLs table passes `cohort` in its `urls` params. Without it, a section row links by path prefix |
102
104
 
103
105
  `hasIndexingCapability(source, name)` and `indexingCapabilities(source)` answer the same question in code, for example to hide a tab.
104
106
 
@@ -134,10 +136,10 @@ const entries = computed<IndexingPortfolioEntry[]>(() => sites.value.map(site =>
134
136
 
135
137
  <IndexingCohortList :site="site" />
136
138
 
137
- <IndexingUrlsTable :site="site" :initial-issue="route.query.issue" />
139
+ <IndexingUrlsTable :site="site" />
138
140
  ```
139
141
 
140
- The site builds `model` with `buildIndexingOverviewModel(input, diagnose)` from the SDK. `IndexingUrlsTable` reads `diagnostics` and `urls`, and draws its table in the layer's default shell. A site with its own table shell passes it as the `shell` prop; it receives the same props, events, and slots (`IndexingUrlsTableShellProps` in the component).
142
+ The site builds `model` with `buildIndexingOverviewModel(input, diagnose)` from the SDK. `lead` takes any `{ _tag: 'lead', title, detail, actionLabel? }`: the SDK's cohort lead (`selectIndexCohortLead`) or regression lead (`selectIndexingRegressionLead`). The panel draws the title as the headline. With `lead-detail` it draws the detail, such as "That is 42% not indexed, against 10%", on the line below it. The waiting state words itself by `model.state`, and the `#waiting-actions="{ model }"` slot draws the site's own controls, such as a connect button or a Review sitemap link. A lead with no `actionLabel` reads `copy.diagnosis.leadAction` on its button. `IndexingCoverageTrend` draws its chart in the browser only; the server renders the heading, the legend and a block of the chart's height, so a page needs no `ClientOnly` around it. `IndexingUrlsTable` reads `diagnostics` and `urls`, and draws its table in the layer's default shell. The route query is its filter state: it reads `issue`, `facet`, `status`, `search`, `cohort` and `page`, writes them on each change, and follows them, so Back and Forward re-filter the rows. `parseIndexingUrlsQuery` (`shared/urls-query`) parses the same query, for a page that seeds the first read or keys the table. A site with its own table shell passes it as the `shell` prop; it receives the same props, events, and slots (`IndexingUrlsTableShellProps` in the component).
141
143
 
142
144
  ### Route map
143
145
 
@@ -169,7 +171,17 @@ nuxtseo.com sets its map in `apps/pro/app/pro-indexing.ts` and its source in `la
169
171
 
170
172
  ### Copy
171
173
 
172
- Every string has a default in `PRO_INDEXING_COPY` (`shared/copy.ts`), and COPY.md owns each one. Reword any key under `proIndexing.copy`; unset keys keep the defaults. Placeholders in braces are filled by the component.
174
+ Every string has a default in `PRO_INDEXING_COPY` (`shared/copy.ts`), and COPY.md owns each one. Reword any key under `proIndexing.copy`; unset keys keep the defaults. Placeholders in braces are filled by the component. The groups follow the sections: `common`, `overview`, `siteIssues`, `issues`, `changes`, `diagnosis`, `coverageTrend`, `cohorts`, `urls` (the URLs table, with Google's state labels), and `urlsShell` (the default table shell). `diagnosis.scope` is empty by default; a site that writes it, for example `'{indexed} URLs with recorded indexed results.'`, gets a scope line after the lead detail.
175
+
176
+ ### Indexed tile tone
177
+
178
+ The Portfolio Overview colours the Indexed share by health band: below 80% reads as a warning, below 50% as an error. Set `proIndexing.indexedShareTone` to change it:
179
+
180
+ ```ts
181
+ proIndexing: defineProIndexingConfig({
182
+ indexedShareTone: { _tag: 'neutral' }, // or { _tag: 'health', warningBelow: 70, errorBelow: 40 }
183
+ })
184
+ ```
173
185
 
174
186
  ### Adopting on gscdump.com
175
187
 
package/app/app.config.ts CHANGED
@@ -1,11 +1,14 @@
1
+ import type { IndexedShareTone } from '../shared/config'
1
2
  import type { ProIndexingCopyOverrides } from '../shared/copy'
2
3
  import type { ProIndexingRouteMap } from '../shared/routes'
3
4
 
4
5
  // The site's seams for the indexing sections. The layer maps no route, so each
5
6
  // link that needs a route hides until the site maps one (README, Route map).
7
+ // An unset `indexedShareTone` reads as the default health bands.
6
8
  export default {
7
9
  proIndexing: {
8
10
  routes: {} as ProIndexingRouteMap,
9
11
  copy: {} as ProIndexingCopyOverrides,
12
+ indexedShareTone: undefined as IndexedShareTone | undefined,
10
13
  },
11
14
  }
@@ -1,10 +1,13 @@
1
1
  <script lang="ts" setup>
2
+ import type { IndexCohortCell } from '@gscdump/sdk/indexing'
2
3
  import type { IndexingSite } from '../../shared/source'
3
- import { sampledIndexStateMessage } from '@gscdump/sdk/indexing'
4
+ import { indexCohortFilterValue, sampledIndexStateMessage } from '@gscdump/sdk/indexing'
4
5
  import { formatGroupedNumber } from '@nuxtseo/design-system/app/composables/formatting'
6
+ import { fillCopy } from '@nuxtseo/pro-shell/shared/copy'
5
7
  import { computed } from 'vue'
6
8
  import { NuxtLink, UiIcon } from '#components'
7
9
  import { useIndexingSource } from '../composables/useIndexingSource'
10
+ import { useProIndexingCopy } from '../composables/useProIndexingCopy'
8
11
  import { useProIndexingRoute } from '../composables/useProIndexingRoute'
9
12
  // Which PART of the site does Google treat worse than the rest — the question
10
13
  // GSC's own taxonomy ("37 crawled but not indexed") cannot answer because it
@@ -22,6 +25,8 @@ const { site } = defineProps<{
22
25
 
23
26
  const source = useIndexingSource()
24
27
  const route = useProIndexingRoute()
28
+ const copy = useProIndexingCopy().cohorts
29
+ const n = formatGroupedNumber
25
30
  const read = source?.cohorts?.(() => site) ?? null
26
31
  const state = computed(() => read?.data.value ?? null)
27
32
 
@@ -37,25 +42,21 @@ const verdict = computed(() => {
37
42
  if (state._tag === 'no-evidence') {
38
43
  if (state.reason === 'sampled-index-state' && state.sample)
39
44
  return sampledIndexStateMessage(state.sample.enumerated, state.sample.reported)
40
- return state.reason === 'no-completed-crawl'
41
- ? 'No completed crawl yet, so pages cannot be grouped.'
42
- : 'No inspected URL matched a crawled page.'
45
+ return state.reason === 'no-completed-crawl' ? copy.noCompletedCrawl : copy.noMatch
43
46
  }
44
47
  if (state._tag === 'uniform') {
45
- const spread = `${formatGroupedNumber(state.baseline.notIndexed)} of ${formatGroupedNumber(state.baseline.total)} pages are not indexed`
48
+ const spread = fillCopy(copy.spread, { notIndexed: n(state.baseline.notIndexed), total: n(state.baseline.total) })
46
49
  // `tested: 0` means no group was large enough to compare — a coverage fact,
47
50
  // not a clean bill. Reporting it as "nothing indexes worse" would assert a
48
51
  // comparison that never ran.
49
- return state.tested === 0
50
- ? `${spread}, and no group of pages is large enough to compare.`
51
- : `No part of this site indexes worse than the rest. ${spread}, spread evenly.`
52
+ return fillCopy(state.tested === 0 ? copy.untested : copy.uniform, { spread })
52
53
  }
53
54
  // The hero already states the worst cohort as the page's primary diagnosis.
54
55
  // Restating it here would tell the same story twice on one screen, so this
55
56
  // line frames what the list IS. HOW it was ranked is method, and method rides
56
57
  // the dimmed coverage line below rather than the verdict.
57
58
  const count = state.cells.length
58
- return `${count === 1 ? 'One part' : `${count} parts`} of this site index worse than the rest.`
59
+ return count === 1 ? copy.outliersOne : fillCopy(copy.outliersMany, { count })
59
60
  })
60
61
 
61
62
  /**
@@ -70,22 +71,25 @@ const coverageNote = computed(() => {
70
71
  const groups = state._tag === 'uniform' || state._tag === 'outliers' ? state.tested : 0
71
72
  const parts = [
72
73
  groups > 0
73
- ? `${formatGroupedNumber(analysed)} crawled pages compared across ${formatGroupedNumber(groups)} groups`
74
- : `${formatGroupedNumber(analysed)} crawled pages compared`,
74
+ ? fillCopy(copy.comparedGroups, { count: n(analysed), groups: n(groups) })
75
+ : fillCopy(copy.compared, { count: n(analysed) }),
75
76
  ]
76
77
  if (notCrawled > 0)
77
- parts.push(`${formatGroupedNumber(notCrawled)} not-indexed URLs are outside this crawl`)
78
+ parts.push(fillCopy(copy.notCrawled, { count: n(notCrawled) }))
78
79
  if (excludedFragments > 0)
79
- parts.push(`${formatGroupedNumber(excludedFragments)} fragment URLs excluded`)
80
+ parts.push(fillCopy(copy.fragments, { count: n(excludedFragments) }))
80
81
  return parts.join(' · ')
81
82
  })
82
83
 
83
- function cohortRoute(pathPrefix: string | null): string | undefined {
84
+ // With the `cohortFilter` capability a row links to its exact cohort. Without
85
+ // it, a section row links by its path prefix and a lifecycle row by status.
86
+ function cohortRoute(cell: IndexCohortCell): string | undefined {
84
87
  if (!site)
85
88
  return undefined
86
- return route.site('siteIndexingUrls', site.ref, pathPrefix
87
- ? { status: 'not_indexed', search: pathPrefix }
88
- : { status: 'not_indexed' }) ?? undefined
89
+ const query = source?.cohortFilter
90
+ ? { status: 'not_indexed', cohort: indexCohortFilterValue(cell) }
91
+ : cell.pathPrefix ? { status: 'not_indexed', search: cell.pathPrefix } : { status: 'not_indexed' }
92
+ return route.site('siteIndexingUrls', site.ref, query) ?? undefined
89
93
  }
90
94
  </script>
91
95
 
@@ -99,15 +103,15 @@ function cohortRoute(pathPrefix: string | null): string | undefined {
99
103
  <NuxtLink
100
104
  v-for="cell in cells"
101
105
  :key="`${cell.dimension}:${cell.key}`"
102
- :to="cohortRoute(cell.pathPrefix)"
106
+ :to="cohortRoute(cell)"
103
107
  class="flex min-h-11 items-center gap-3 rounded-md px-1 py-2 hover:bg-accented focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"
104
108
  >
105
109
  <span class="min-w-0 flex-1">
106
110
  <span class="block truncate text-sm text-default">{{ cell.label }}</span>
107
111
  <span class="block text-mini text-muted">
108
- {{ formatGroupedNumber(cell.notIndexed) }} of {{ formatGroupedNumber(cell.total) }} pages · {{ percent(cell.complementRate) }} across the rest
112
+ {{ fillCopy(copy.cellDetail, { notIndexed: n(cell.notIndexed), total: n(cell.total), rest: percent(cell.complementRate) }) }}
109
113
  <template v-if="cell.overlapNotIndexed > 0">
110
- · {{ formatGroupedNumber(cell.overlapNotIndexed) }} also counted above
114
+ · {{ fillCopy(copy.cellOverlap, { count: n(cell.overlapNotIndexed) }) }}
111
115
  </template>
112
116
  </span>
113
117
  </span>
@@ -1,9 +1,14 @@
1
1
  <script lang="ts" setup>
2
2
  import type { IndexingCoverageTrendViewState } from '../../shared/coverage-trend'
3
3
  import { formatGroupedNumber } from '@nuxtseo/design-system/app/composables/formatting'
4
+ import { fillCopy } from '@nuxtseo/pro-shell/shared/copy'
4
5
  import { computed } from 'vue'
5
- import { UiButton, UiEmptyState, UiLineChart, UiSkeleton } from '#components'
6
+ import { ClientOnly, UiButton, UiEmptyState, UiLineChart, UiSkeleton } from '#components'
6
7
  import { formatIndexingCoverageDate } from '../../shared/coverage-trend'
8
+ import { useProIndexingCopy } from '../composables/useProIndexingCopy'
9
+
10
+ // The chart draws in the browser only. The server renders the heading and the
11
+ // legend, and a block of the chart's height, so a page needs no wrapper.
7
12
 
8
13
  const {
9
14
  state,
@@ -17,6 +22,9 @@ const emit = defineEmits<{
17
22
  retry: []
18
23
  }>()
19
24
 
25
+ const copy = useProIndexingCopy().coverageTrend
26
+ const CHART_HEIGHT = 180
27
+
20
28
  const readyTrend = computed(() =>
21
29
  state._tag === 'loaded' && state.trend._tag === 'ready'
22
30
  ? state.trend
@@ -33,7 +41,7 @@ const chartPoints = computed<Array<Record<string, unknown>>>(() =>
33
41
  const series = [
34
42
  {
35
43
  key: 'indexed',
36
- label: 'Indexed',
44
+ label: copy.indexed,
37
45
  color: 'var(--ui-color-primary-500)',
38
46
  area: false,
39
47
  },
@@ -50,13 +58,13 @@ function formatCount(value: number): string {
50
58
  <div class="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
51
59
  <div class="min-w-0">
52
60
  <h3 class="text-sm font-strong text-highlighted">
53
- Indexed URLs over time
61
+ {{ copy.title }}
54
62
  </h3>
55
63
  <!-- The legend below prints the indexed count, so restating them in
56
64
  prose said the same thing twice. What is left is the part the
57
65
  numbers cannot say: what they are counted over, and as of when. -->
58
66
  <p class="mt-1 text-mini text-dimmed">
59
- Inspected sample, not whole-site coverage · {{ formatIndexingCoverageDate(readyTrend.latest.date) }}
67
+ {{ fillCopy(copy.scope, { date: formatIndexingCoverageDate(readyTrend.latest.date) }) }}
60
68
  </p>
61
69
  </div>
62
70
  <UiButton
@@ -65,7 +73,7 @@ function formatCount(value: number): string {
65
73
  trailing-icon="next"
66
74
  class="min-h-11 shrink-0 self-start"
67
75
  >
68
- View inspected URLs
76
+ {{ copy.viewUrls }}
69
77
  </UiButton>
70
78
  </div>
71
79
 
@@ -73,7 +81,7 @@ function formatCount(value: number): string {
73
81
  <div class="flex items-center gap-2">
74
82
  <dt class="flex items-center gap-2 text-muted">
75
83
  <span class="h-0.5 w-4 bg-primary-500" aria-hidden="true" />
76
- Indexed
84
+ {{ copy.indexed }}
77
85
  </dt>
78
86
  <dd class="numerals-display text-highlighted">
79
87
  {{ formatGroupedNumber(readyTrend.latest.indexed) }}
@@ -81,53 +89,56 @@ function formatCount(value: number): string {
81
89
  </div>
82
90
  </dl>
83
91
 
84
- <UiLineChart
85
- :data="chartPoints"
86
- x-key="date"
87
- :series="series"
88
- :height="180"
89
- :x-format="formatIndexingCoverageDate"
90
- :y-format="formatCount"
91
- class="mt-2"
92
- />
92
+ <ClientOnly>
93
+ <UiLineChart
94
+ :data="chartPoints"
95
+ x-key="date"
96
+ :series="series"
97
+ :height="CHART_HEIGHT"
98
+ :x-format="formatIndexingCoverageDate"
99
+ :y-format="formatCount"
100
+ class="mt-2"
101
+ />
102
+ <template #fallback>
103
+ <div class="mt-2" :style="{ height: `${CHART_HEIGHT}px` }" aria-hidden="true" />
104
+ </template>
105
+ </ClientOnly>
93
106
  </template>
94
107
 
95
108
  <template v-else-if="state._tag === 'loading'">
96
109
  <h3 class="text-sm font-strong text-highlighted">
97
- Indexed URLs over time
110
+ {{ copy.title }}
98
111
  </h3>
99
- <div class="mt-3" aria-label="Loading indexing coverage trend" aria-busy="true">
112
+ <div class="mt-3" :aria-label="copy.loadingLabel" aria-busy="true">
100
113
  <UiSkeleton class="!h-[180px] w-full" />
101
114
  </div>
102
115
  </template>
103
116
 
104
117
  <template v-else-if="state._tag === 'error'">
105
118
  <h3 class="text-sm font-strong text-highlighted">
106
- Indexed URLs over time
119
+ {{ copy.title }}
107
120
  </h3>
108
121
  <UiEmptyState
109
122
  compact
110
123
  icon="caution"
111
- title="Coverage trend unavailable"
112
- description="Retry to load the saved coverage snapshots."
124
+ :title="copy.errorTitle"
125
+ :description="copy.errorBody"
113
126
  >
114
127
  <UiButton purpose="secondary" class="!min-h-11" @click="emit('retry')">
115
- Retry coverage trend
128
+ {{ copy.retry }}
116
129
  </UiButton>
117
130
  </UiEmptyState>
118
131
  </template>
119
132
 
120
133
  <template v-else-if="insufficientTrend">
121
134
  <h3 class="text-sm font-strong text-highlighted">
122
- Indexed URLs over time
135
+ {{ copy.title }}
123
136
  </h3>
124
137
  <UiEmptyState
125
138
  compact
126
139
  icon="compare"
127
- title="Two snapshots needed"
128
- :description="insufficientTrend.validPoints === 1
129
- ? 'The first valid inspection snapshot is ready. The next snapshot will show the trajectory.'
130
- : 'Coverage history starts after the first two valid inspection snapshots.'"
140
+ :title="copy.insufficientTitle"
141
+ :description="insufficientTrend.validPoints === 1 ? copy.insufficientOne : copy.insufficientNone"
131
142
  />
132
143
  </template>
133
144
  </div>
@@ -1,6 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import type { RouteLocationRaw } from 'vue-router'
3
3
  import { NuxtLink, UiIcon, UiMetricLabel, UiSeverityDot, UiSparkline, UiTooltip } from '#components'
4
+ import { useProIndexingCopy } from '../composables/useProIndexingCopy'
4
5
 
5
6
  type StepStatus = 'success' | 'error' | 'warning' | 'neutral'
6
7
 
@@ -23,6 +24,8 @@ const { steps, variant = 'hero' } = defineProps<{
23
24
  variant?: 'hero' | 'inline'
24
25
  }>()
25
26
 
27
+ const pipelineLabel = useProIndexingCopy().urls.pipelineLabel
28
+
26
29
  /** Status-tinted icon container classes (matches UiNavIcon pattern) */
27
30
  const statusContainerColors: Record<StepStatus, string> = {
28
31
  success: 'bg-success/10 border-success/15',
@@ -48,7 +51,7 @@ const statusSparklineColors: Record<StepStatus, string> = {
48
51
 
49
52
  <template>
50
53
  <!-- ═══ HERO variant: 4-col grid with sparklines ═══ -->
51
- <div v-if="variant === 'hero'" class="grid grid-cols-2 gap-4 sm:gap-0 sm:grid-cols-4 divide-default sm:divide-x" role="list" aria-label="Crawl pipeline">
54
+ <div v-if="variant === 'hero'" class="grid grid-cols-2 gap-4 sm:gap-0 sm:grid-cols-4 divide-default sm:divide-x" role="list" :aria-label="pipelineLabel">
52
55
  <component
53
56
  :is="step.to ? NuxtLink : 'div'"
54
57
  v-for="(step, i) in steps"
@@ -107,7 +110,7 @@ const statusSparklineColors: Record<StepStatus, string> = {
107
110
  </div>
108
111
 
109
112
  <!-- ═══ INLINE variant: compact horizontal flow ═══ -->
110
- <div v-else class="inline-pipeline" role="list" aria-label="Crawl pipeline">
113
+ <div v-else class="inline-pipeline" role="list" :aria-label="pipelineLabel">
111
114
  <template v-for="(step, i) in steps" :key="step.label">
112
115
  <component
113
116
  :is="step.to ? NuxtLink : 'div'"
@@ -1,15 +1,26 @@
1
1
  <script setup lang="ts">
2
- import type { IndexCohortLead, IndexingOverviewModel } from '@gscdump/sdk/indexing'
2
+ import type { IndexingOverviewModel, IndexingOverviewWaiting } from '@gscdump/sdk/indexing'
3
3
  import type { IndexingSiteDiagnosis } from '../../shared/source'
4
4
  import { formatGroupedNumber } from '@nuxtseo/design-system/app/composables/formatting'
5
+ import { fillCopy } from '@nuxtseo/pro-shell/shared/copy'
5
6
  import { computed } from 'vue'
6
7
  import { UiButton, UiCard, UiSkeleton, UiStatusBadge } from '#components'
8
+ import { useProIndexingCopy } from '../composables/useProIndexingCopy'
7
9
 
8
10
  export type IndexingDiagnosisPanelState
9
11
  = | { _tag: 'loading' }
10
12
  | { _tag: 'ready', model: IndexingOverviewModel<IndexingSiteDiagnosis> }
11
13
 
12
- const { state, lead } = defineProps<{
14
+ /**
15
+ * A located claim that replaces the reason-led headline. The SDK's cohort lead
16
+ * (`selectIndexCohortLead`) and regression lead (`selectIndexingRegressionLead`)
17
+ * both fit. Without `actionLabel`, the button reads `copy.diagnosis.leadAction`.
18
+ */
19
+ export type IndexingDiagnosisLead
20
+ = | { _tag: 'lead', title: string, detail: string, actionLabel?: string }
21
+ | { _tag: 'none' }
22
+
23
+ const { state, lead, leadDetail = false } = defineProps<{
13
24
  state: IndexingDiagnosisPanelState
14
25
  actionTo: string
15
26
  sitemapTo: string
@@ -21,11 +32,20 @@ const { state, lead } = defineProps<{
21
32
  * not to keep them" only names it. Absent when no cohort separates, and the
22
33
  * reason-led headline is then still the most specific true statement.
23
34
  */
24
- lead?: IndexCohortLead
35
+ lead?: IndexingDiagnosisLead
25
36
  /** Where the lead's action goes. Required whenever `lead` is a `lead`. */
26
37
  leadTo?: string
38
+ /** Draw the lead's detail line, such as "That is 42% not indexed, against 10%", under the headline. */
39
+ leadDetail?: boolean
40
+ }>()
41
+
42
+ defineSlots<{
43
+ /** The waiting state's actions, such as a connect button or a Sitemap link. */
44
+ 'waiting-actions'?: (props: { model: IndexingOverviewWaiting }) => unknown
27
45
  }>()
28
46
 
47
+ const copy = useProIndexingCopy()
48
+
29
49
  const cohortLead = computed(() => lead?._tag === 'lead' ? lead : null)
30
50
 
31
51
  const model = computed(() => state._tag === 'ready' ? state.model : null)
@@ -34,10 +54,21 @@ const status = computed(() => {
34
54
  if (model.value?._tag !== 'diagnosis')
35
55
  return null
36
56
  return model.value.diagnosis.severity === 'severe'
37
- ? { tone: 'error' as const, label: 'Action needed' }
57
+ ? { tone: 'error' as const, label: copy.diagnosis.statusSevere }
38
58
  : model.value.diagnosis.severity === 'watch' || model.value.diagnosis.reason !== 'none'
39
- ? { tone: 'warning' as const, label: 'Review' }
40
- : { tone: 'success' as const, label: 'Healthy' }
59
+ ? { tone: 'warning' as const, label: copy.diagnosis.statusReview }
60
+ : { tone: 'success' as const, label: copy.diagnosis.statusHealthy }
61
+ })
62
+
63
+ // One supporting line under the headline: the lead's comparison, then the
64
+ // optional scope line a site writes under `copy.diagnosis.scope`.
65
+ const supportLine = computed(() => {
66
+ if (model.value?._tag !== 'diagnosis')
67
+ return ''
68
+ const scope = copy.diagnosis.scope
69
+ ? fillCopy(copy.diagnosis.scope, { indexed: model.value.scope.indexedLabel })
70
+ : ''
71
+ return [leadDetail ? cohortLead.value?.detail : null, scope].filter(Boolean).join(' · ')
41
72
  })
42
73
  </script>
43
74
 
@@ -63,17 +94,20 @@ const status = computed(() => {
63
94
  <div v-if="model._tag === 'waiting'" class="flex min-h-56 flex-col justify-center gap-4">
64
95
  <UiStatusBadge
65
96
  status="neutral"
66
- :label="model.progress
67
- ? model.progress.inspected > 0 ? 'Inspection in progress' : 'Waiting for Google'
68
- : 'Setup needed'"
97
+ :label="model.state === 'not_connected'
98
+ ? copy.diagnosis.setupNeeded
99
+ : model.progress && model.progress.inspected > 0 ? copy.diagnosis.inspecting : copy.diagnosis.waitingForGoogle"
69
100
  />
70
101
  <div>
71
102
  <h2 class="max-w-2xl text-2xl font-strong text-default">
72
- <template v-if="model.progress">
73
- {{ formatGroupedNumber(model.progress.inspected) }} of {{ formatGroupedNumber(model.progress.total) }} sitemap URLs inspected
103
+ <template v-if="model.state === 'not_connected'">
104
+ {{ copy.diagnosis.connectTitle }}
105
+ </template>
106
+ <template v-else-if="model.progress">
107
+ {{ fillCopy(copy.diagnosis.progressTitle, { inspected: formatGroupedNumber(model.progress.inspected), total: formatGroupedNumber(model.progress.total) }) }}
74
108
  </template>
75
109
  <template v-else>
76
- Connect Search Console to collect indexing evidence
110
+ {{ copy.diagnosis.waitingTitle }}
77
111
  </template>
78
112
  </h2>
79
113
  <p class="mt-2 max-w-2xl text-sm text-muted">
@@ -84,7 +118,7 @@ const status = computed(() => {
84
118
  <div
85
119
  class="h-2 overflow-hidden rounded-full bg-accented"
86
120
  role="progressbar"
87
- aria-label="Sitemap inspection progress"
121
+ :aria-label="copy.diagnosis.progressLabel"
88
122
  :aria-valuenow="model.progress.inspected"
89
123
  aria-valuemin="0"
90
124
  :aria-valuemax="model.progress.total"
@@ -95,28 +129,31 @@ const status = computed(() => {
95
129
  />
96
130
  </div>
97
131
  </div>
132
+ <div v-if="$slots['waiting-actions']" class="flex flex-wrap gap-2">
133
+ <slot name="waiting-actions" :model="model" />
134
+ </div>
98
135
  </div>
99
136
 
100
137
  <div v-else-if="model._tag === 'trust_failure'" class="flex min-h-56 flex-col justify-center gap-4">
101
- <UiStatusBadge status="error" label="Cannot confirm indexing" />
138
+ <UiStatusBadge status="error" :label="copy.diagnosis.trustFailureBadge" />
102
139
  <div>
103
140
  <h2 class="max-w-2xl text-2xl font-strong text-default">
104
- Fix the sitemap signal before trusting coverage
141
+ {{ copy.diagnosis.trustFailureTitle }}
105
142
  </h2>
106
143
  <p class="mt-2 max-w-2xl text-sm text-muted">
107
144
  {{ model.reason }}
108
145
  </p>
109
146
  </div>
110
147
  <UiButton :to="sitemapTo" purpose="cta" trailing-icon="next" class="min-h-11 self-start">
111
- Review sitemap
148
+ {{ copy.diagnosis.reviewSitemap }}
112
149
  </UiButton>
113
150
  </div>
114
151
 
115
152
  <div v-else-if="model._tag === 'verify_scope'" class="flex min-h-56 flex-col justify-center gap-4">
116
- <UiStatusBadge status="warning" label="Verify scope" />
153
+ <UiStatusBadge status="warning" :label="copy.diagnosis.verifyScopeBadge" />
117
154
  <div>
118
155
  <h2 class="max-w-2xl text-2xl font-strong text-default">
119
- Indexing scope may have collapsed
156
+ {{ copy.diagnosis.verifyScopeTitle }}
120
157
  </h2>
121
158
  <!-- The button already says to verify the inventory; the sentence that
122
159
  used to repeat it here was the action twice. -->
@@ -125,22 +162,22 @@ const status = computed(() => {
125
162
  </p>
126
163
  </div>
127
164
  <UiButton :to="sitemapTo" purpose="cta" trailing-icon="next" class="min-h-11 self-start">
128
- Verify sitemap inventory
165
+ {{ copy.diagnosis.verifySitemap }}
129
166
  </UiButton>
130
167
  </div>
131
168
 
132
169
  <div v-else-if="model._tag === 'partial_scope'" class="flex min-h-56 flex-col justify-center gap-4">
133
- <UiStatusBadge status="neutral" label="Inspection in progress" />
170
+ <UiStatusBadge status="neutral" :label="copy.diagnosis.inspecting" />
134
171
  <div>
135
172
  <h2 class="max-w-2xl text-2xl font-strong text-default">
136
- The inspected sample looks indexed
173
+ {{ copy.diagnosis.partialScopeTitle }}
137
174
  </h2>
138
175
  <p class="mt-2 max-w-2xl text-sm text-muted">
139
176
  {{ model.reason }}
140
177
  </p>
141
178
  </div>
142
179
  <UiButton :to="actionTo" purpose="secondary" trailing-icon="next" class="min-h-11 self-start">
143
- View inspected URLs
180
+ {{ copy.diagnosis.viewInspectedUrls }}
144
181
  </UiButton>
145
182
  </div>
146
183
 
@@ -154,6 +191,9 @@ const status = computed(() => {
154
191
  <h2 class="mt-3 max-w-2xl text-2xl font-strong text-default">
155
192
  {{ cohortLead ? cohortLead.title : model.diagnosis.summary }}
156
193
  </h2>
194
+ <p v-if="supportLine" class="mt-2 max-w-2xl text-sm text-muted">
195
+ {{ supportLine }}
196
+ </p>
157
197
  <p v-if="model.trustNote" class="mt-2 max-w-2xl text-sm text-warning">
158
198
  {{ model.trustNote }}
159
199
  </p>
@@ -165,10 +205,10 @@ const status = computed(() => {
165
205
  >
166
206
  <div class="min-w-0">
167
207
  <p class="text-label">
168
- Next step
208
+ {{ copy.diagnosis.nextStep }}
169
209
  </p>
170
210
  <h3 class="mt-1 text-base font-semibold text-default">
171
- {{ model.primaryAction ? model.primaryAction.label : 'Review this section' }}
211
+ {{ model.primaryAction ? model.primaryAction.label : copy.diagnosis.reviewSection }}
172
212
  </h3>
173
213
  </div>
174
214
  <UiButton
@@ -177,7 +217,7 @@ const status = computed(() => {
177
217
  trailing-icon="next"
178
218
  class="min-h-11 shrink-0 self-start"
179
219
  >
180
- {{ cohortLead.actionLabel }}
220
+ {{ cohortLead.actionLabel ?? copy.diagnosis.leadAction }}
181
221
  </UiButton>
182
222
  </div>
183
223
 
@@ -187,7 +227,7 @@ const status = computed(() => {
187
227
  >
188
228
  <div class="min-w-0">
189
229
  <p class="text-label">
190
- Next step
230
+ {{ copy.diagnosis.nextStep }}
191
231
  </p>
192
232
  <h3 class="mt-1 text-base font-semibold text-default">
193
233
  {{ model.primaryAction.label }}
@@ -213,12 +253,12 @@ const status = computed(() => {
213
253
  trailing-icon="next"
214
254
  class="min-h-11 self-start"
215
255
  >
216
- View inspected URLs
256
+ {{ copy.diagnosis.viewInspectedUrls }}
217
257
  </UiButton>
218
258
 
219
259
  <!-- Freshness is metadata about the verdict, not part of it. -->
220
260
  <p v-if="freshness" class="text-mini text-dimmed">
221
- Diagnosis {{ freshness }}
261
+ {{ fillCopy(copy.diagnosis.freshness, { freshness }) }}
222
262
  </p>
223
263
  </div>
224
264
  </template>
@@ -212,7 +212,7 @@ function retryFailed() {
212
212
  :tick-line="false"
213
213
  :domain-line="false"
214
214
  :tick-values="yTickValues"
215
- :tick-format="(value: number) => formatNumber(Math.abs(value))"
215
+ :tick-format="(value: number) => formatNumber(value)"
216
216
  tick-text-font-size="11px"
217
217
  tick-text-color="var(--ui-text-dimmed)"
218
218
  />
@@ -6,9 +6,11 @@ import { indexingWindowNote } from '@gscdump/sdk/indexing'
6
6
  import { DISPLAY_LOCALE, formatNumber } from '@nuxtseo/design-system/app/composables/formatting'
7
7
  import { computed } from 'vue'
8
8
  import { UiAlert, UiButton, UiEmptyState, UiStat, UiStats, UiTopEntityStackChart } from '#components'
9
+ import { indexedShareTextClass } from '../../shared/config'
9
10
  import { portfolioFetchState } from '../../shared/portfolio'
10
11
  import { buildPortfolioOverview } from '../../shared/portfolio-overview'
11
12
  import { useIndexingSource } from '../composables/useIndexingSource'
13
+ import { useProIndexingIndexedShareTone } from '../composables/useProIndexingConfig'
12
14
  import { useProIndexingCopy } from '../composables/useProIndexingCopy'
13
15
 
14
16
  // Portfolio Overview: the tiles and the not-indexed stack over one Portfolio
@@ -35,13 +37,7 @@ const model = computed(() => buildPortfolioOverview(entries, window))
35
37
  const hasGsc = computed(() => entries.some(entry => entry.site.dataId !== null))
36
38
  const windowNote = computed(() => indexingWindowNote(window, entries.map(entry => entry.trend)))
37
39
 
38
- type RateHealth = 'ok' | 'warning' | 'error'
39
- function rateHealth(percent: number): RateHealth {
40
- if (percent >= 80)
41
- return 'ok'
42
- return percent >= 50 ? 'warning' : 'error'
43
- }
44
- const rateTextClass: Record<RateHealth, string> = { ok: 'text-default', warning: 'text-warning', error: 'text-error' }
40
+ const indexedShareTone = useProIndexingIndexedShareTone()
45
41
 
46
42
  // The rollup counts only this scope's linked Sites. A failed read is unknown, never zero.
47
43
  const sitemapError = computed(() => sitemapRead?.error.value ?? null)
@@ -80,7 +76,7 @@ const stats = computed<UiStatProps[]>(() => {
80
76
  icon: 'check-circle',
81
77
  tooltip: copy.overview.indexedTooltip,
82
78
  value: indexed ? `${indexed.percent.toFixed(0)}%` : null,
83
- valueClass: indexed ? rateTextClass[rateHealth(indexed.percent)] : undefined,
79
+ valueClass: indexed ? indexedShareTextClass(indexed.percent, indexedShareTone) : undefined,
84
80
  trend: indexedChange,
85
81
  trendSuffix: copy.overview.trendSuffix,
86
82
  sparkline: statSparkline(trend.map(point => ({ x: point.date, value: point.indexedPercent }))),