@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.
@@ -1,9 +1,11 @@
1
1
  <script setup lang="ts" generic="T extends object">
2
2
  import type { UiTableColumn, UiTableRowId, UiTableSize } from '@nuxtseo/design-system/app/shared/table'
3
3
  import { useHumanFriendlyNumber } from '@nuxtseo/design-system/app/composables/formatting'
4
+ import { fillCopy } from '@nuxtseo/pro-shell/shared/copy'
4
5
  import { refDebounced } from '@vueuse/core'
5
6
  import { computed, ref, watch } from 'vue'
6
7
  import { UiAlert, UiButton, UiEmptyState, UiFilterMenu, UiInput, UiSkeleton, UiTable, UiTablePagination } from '#components'
8
+ import { useProIndexingCopy } from '../composables/useProIndexingCopy'
7
9
 
8
10
  // The default table shell of `IndexingUrlsTable`: search, the status filter,
9
11
  // loading, error, empty, the table, and the pager. A site with its own shell
@@ -20,11 +22,11 @@ export interface IndexingUrlsTableFilter {
20
22
 
21
23
  const {
22
24
  filters = [],
23
- searchPlaceholder = 'Search…',
25
+ searchPlaceholder,
24
26
  emptyIcon = 'file-search',
25
- emptyTitle = 'No results',
27
+ emptyTitle,
26
28
  emptyDefaultDescription = '',
27
- itemLabel = 'rows',
29
+ itemLabel,
28
30
  pageSize = 25,
29
31
  hasExternalFilter = false,
30
32
  hasCachedData,
@@ -73,6 +75,10 @@ const emit = defineEmits<{
73
75
  'retry': []
74
76
  }>()
75
77
 
78
+ const copy = useProIndexingCopy().urlsShell
79
+ const placeholder = computed(() => searchPlaceholder ?? copy.searchPlaceholder)
80
+ const items = computed(() => itemLabel ?? copy.itemLabel)
81
+
76
82
  const localQ = ref(q)
77
83
  const debouncedQ = refDebounced(localQ, 300)
78
84
  const localPage = computed({
@@ -86,9 +92,9 @@ const refreshError = computed(() => error && cachedEvidence.value ? error : null
86
92
  const hasActiveFilter = computed(() => Boolean(q || (filter && filter !== 'default') || hasExternalFilter))
87
93
  const emptyDescription = computed(() => {
88
94
  if (q)
89
- return `No ${itemLabel} match "${q}"`
95
+ return fillCopy(copy.emptySearch, { items: items.value, q })
90
96
  if ((filter && filter !== 'default') || hasExternalFilter)
91
- return `No ${itemLabel} match the selected filter`
97
+ return fillCopy(copy.emptyFilter, { items: items.value })
92
98
  return emptyDefaultDescription
93
99
  })
94
100
 
@@ -132,8 +138,8 @@ function clearAllFilters() {
132
138
  <div class="flex-1 sm:flex-none sm:w-64">
133
139
  <UiInput
134
140
  v-model="localQ"
135
- :placeholder="searchPlaceholder"
136
- :aria-label="searchPlaceholder"
141
+ :placeholder="placeholder"
142
+ :aria-label="placeholder"
137
143
  icon="search"
138
144
  autocomplete="off"
139
145
  size="sm"
@@ -147,7 +153,7 @@ function clearAllFilters() {
147
153
  icon="close"
148
154
  size="xs"
149
155
  class="min-h-11 min-w-11 sm:min-h-0 sm:min-w-0"
150
- aria-label="Clear search"
156
+ :aria-label="copy.clearSearch"
151
157
  @click="commitQ('')"
152
158
  />
153
159
  </template>
@@ -171,10 +177,10 @@ function clearAllFilters() {
171
177
 
172
178
  <slot name="notices" />
173
179
 
174
- <UiAlert v-if="refreshError" status="warning" title="Latest refresh failed" description="Showing the last successful report.">
180
+ <UiAlert v-if="refreshError" status="warning" :title="copy.refreshFailedTitle" :description="copy.refreshFailedBody">
175
181
  <template #action>
176
182
  <UiButton purpose="secondary" size="xs" class="min-h-11 sm:min-h-0" @click="emit('retry')">
177
- Retry
183
+ {{ copy.retry }}
178
184
  </UiButton>
179
185
  </template>
180
186
  </UiAlert>
@@ -191,17 +197,17 @@ function clearAllFilters() {
191
197
  </div>
192
198
  </div>
193
199
 
194
- <UiAlert v-else-if="blockingError" status="error" icon="caution" :title="blockingError.message || 'The URLs could not be loaded'">
200
+ <UiAlert v-else-if="blockingError" status="error" icon="caution" :title="blockingError.message || copy.loadFailed">
195
201
  <template #action>
196
202
  <UiButton purpose="secondary" size="xs" class="min-h-11 sm:min-h-0" @click="emit('retry')">
197
- Retry
203
+ {{ copy.retry }}
198
204
  </UiButton>
199
205
  </template>
200
206
  </UiAlert>
201
207
 
202
- <UiEmptyState v-else-if="!rows.length" compact heading-tag="h3" :icon="emptyIcon" :title="emptyTitle" :description="emptyDescription">
208
+ <UiEmptyState v-else-if="!rows.length" compact heading-tag="h3" :icon="emptyIcon" :title="emptyTitle ?? copy.emptyTitle" :description="emptyDescription">
203
209
  <UiButton v-if="hasActiveFilter" size="sm" purpose="secondary" @click="clearAllFilters">
204
- Clear filters
210
+ {{ copy.clearFilters }}
205
211
  </UiButton>
206
212
  </UiEmptyState>
207
213
 
@@ -225,7 +231,7 @@ function clearAllFilters() {
225
231
  </UiTable>
226
232
 
227
233
  <UiTablePagination v-if="total > pageSize" v-model:page="localPage" :page-size="pageSize" :total="total">
228
- <span class="font-medium text-default">{{ useHumanFriendlyNumber(total) }}</span> {{ itemLabel }} total
234
+ <span class="font-medium text-default">{{ useHumanFriendlyNumber(total) }}</span> {{ fillCopy(copy.total, { items }) }}
229
235
  </UiTablePagination>
230
236
  </div>
231
237
  </template>
@@ -0,0 +1,10 @@
1
+ import type { IndexedShareTone, ProIndexingAppConfig } from '../../shared/config'
2
+ import { tryUseNuxtApp, useAppConfig } from 'nuxt/app'
3
+ import { DEFAULT_INDEXED_SHARE_TONE } from '../../shared/config'
4
+
5
+ /** The Indexed tile's tone from app.config `proIndexing.indexedShareTone`. Call it in setup. */
6
+ export function useProIndexingIndexedShareTone(): IndexedShareTone {
7
+ const appConfig = tryUseNuxtApp() ? useAppConfig() : null
8
+ const tone = (appConfig?.proIndexing as ProIndexingAppConfig | undefined)?.indexedShareTone
9
+ return tone?._tag === 'neutral' || tone?._tag === 'health' ? tone : DEFAULT_INDEXED_SHARE_TONE
10
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuxtseo/pro-indexing",
3
3
  "type": "module",
4
- "version": "0.1.4",
4
+ "version": "0.1.5",
5
5
  "description": "Nuxt SEO Pro indexing layer: the dashboard indexing sections (Portfolio overview, issues and changes, the per-Site diagnosis panel, coverage trend, Index cohorts, and the indexing URLs table) over one IndexingSource adapter and a route map. Extends @nuxtseo/pro-shell.",
6
6
  "license": "MIT",
7
7
  "homepage": "https://nuxtseo.com",
@@ -37,8 +37,8 @@
37
37
  "@gscdump/contracts": "^7.13.0",
38
38
  "@gscdump/sdk": "^7.13.0",
39
39
  "@nuxt/ui": "^4.11.1",
40
- "@nuxtseo/design-system": "^0.1.4",
41
- "@nuxtseo/pro-shell": "^0.1.4",
40
+ "@nuxtseo/design-system": "^0.1.5",
41
+ "@nuxtseo/pro-shell": "^0.1.5",
42
42
  "@vueuse/core": "^14.0.0 || ^15.0.0",
43
43
  "nuxt": "^4.6.0",
44
44
  "typescript": ">=5.8.0 <7",
@@ -52,8 +52,8 @@
52
52
  "@gscdump/contracts": "7.13.0",
53
53
  "@gscdump/sdk": "7.13.0",
54
54
  "@nuxt/ui": "^4.11.1",
55
- "@nuxtseo/design-system": "0.1.4",
56
- "@nuxtseo/pro-shell": "0.1.4",
55
+ "@nuxtseo/design-system": "0.1.5",
56
+ "@nuxtseo/pro-shell": "0.1.5",
57
57
  "@vueuse/core": "^14.4.0",
58
58
  "nuxt": "4.6.1",
59
59
  "site-typecheck": "0.0.0",
package/shared/config.ts CHANGED
@@ -1,16 +1,36 @@
1
- // `proIndexing` in app.config: the route map and copy overrides. Write
2
- // app.config as a plain object and wrap this key in `defineProIndexingConfig`
3
- // to type-check it.
1
+ // `proIndexing` in app.config: the route map, copy overrides, and the Indexed
2
+ // tile's tone. Write app.config as a plain object and wrap this key in
3
+ // `defineProIndexingConfig` to type-check it.
4
4
 
5
5
  import type { ProIndexingCopyOverrides } from './copy'
6
6
  import type { ProIndexingRouteMap } from './routes'
7
7
 
8
+ /**
9
+ * How the Portfolio Overview's Indexed tile colours its share. `health` draws
10
+ * a share below `warningBelow` as a warning and below `errorBelow` as an
11
+ * error. `neutral` draws every share in the default text colour.
12
+ */
13
+ export type IndexedShareTone
14
+ = | { readonly _tag: 'health', readonly warningBelow: number, readonly errorBelow: number }
15
+ | { readonly _tag: 'neutral' }
16
+
17
+ export const DEFAULT_INDEXED_SHARE_TONE: IndexedShareTone = { _tag: 'health', warningBelow: 80, errorBelow: 50 }
18
+
8
19
  export interface ProIndexingAppConfig {
9
20
  readonly routes?: ProIndexingRouteMap
10
21
  readonly copy?: ProIndexingCopyOverrides
22
+ /** Defaults to `DEFAULT_INDEXED_SHARE_TONE`. */
23
+ readonly indexedShareTone?: IndexedShareTone
11
24
  }
12
25
 
13
26
  /** Identity function that type-checks `proIndexing` in a plain-object app.config. */
14
27
  export function defineProIndexingConfig(config: ProIndexingAppConfig): ProIndexingAppConfig {
15
28
  return config
16
29
  }
30
+
31
+ /** The text class for an indexed share, in percent, under a tone. */
32
+ export function indexedShareTextClass(percent: number, tone: IndexedShareTone = DEFAULT_INDEXED_SHARE_TONE): string {
33
+ if (tone._tag === 'neutral' || percent >= tone.warningBelow)
34
+ return 'text-default'
35
+ return percent >= tone.errorBelow ? 'text-warning' : 'text-error'
36
+ }
package/shared/copy.ts CHANGED
@@ -3,75 +3,7 @@
3
3
  // app.config `proIndexing.copy`. Unset keys keep these defaults. Placeholders
4
4
  // in braces, such as `{site}`, are filled by the component.
5
5
 
6
- export interface ProIndexingCopy {
7
- readonly common: {
8
- readonly failedTitle: string
9
- readonly failedOne: string
10
- readonly failedMany: string
11
- readonly excludesOne: string
12
- readonly excludesMany: string
13
- readonly retry: string
14
- readonly collectingTitle: string
15
- readonly collectingBody: string
16
- readonly fixIssues: string
17
- readonly fixIssuesLabel: string
18
- }
19
- readonly overview: {
20
- readonly indexedTitle: string
21
- readonly indexedTooltip: string
22
- readonly notIndexedTitle: string
23
- readonly notIndexedTooltip: string
24
- readonly crawlErrorsTitle: string
25
- readonly crawlErrorsTooltip: string
26
- readonly sitemapProblemsTitle: string
27
- readonly sitemapProblemsTooltip: string
28
- readonly sitemapProblemsFailedTooltip: string
29
- readonly sitemapProblemsFailed: string
30
- readonly stackTitle: string
31
- readonly trendSuffix: string
32
- }
33
- readonly siteIssues: {
34
- readonly tableLabel: string
35
- readonly issue: string
36
- readonly count: string
37
- readonly action: string
38
- readonly failedBody: string
39
- readonly openReport: string
40
- readonly emptyNoObservation: string
41
- readonly emptyAllIndexed: string
42
- readonly emptyUnattributedOne: string
43
- readonly emptyUnattributedMany: string
44
- }
45
- readonly issues: {
46
- readonly stackTitle: string
47
- readonly tableLabel: string
48
- readonly issue: string
49
- readonly urls: string
50
- readonly sites: string
51
- readonly mostAffected: string
52
- readonly emptyTitle: string
53
- readonly emptyBody: string
54
- }
55
- readonly changes: {
56
- readonly window: string
57
- readonly opened: string
58
- readonly cleared: string
59
- readonly legendLabel: string
60
- readonly chartLabel: string
61
- readonly chartCaption: string
62
- readonly day: string
63
- readonly tableLabel: string
64
- readonly site: string
65
- readonly notIndexed: string
66
- readonly change: string
67
- readonly since: string
68
- readonly sampledCounts: string
69
- readonly emptyTitle: string
70
- readonly emptyBody: string
71
- }
72
- }
73
-
74
- export const PRO_INDEXING_COPY: ProIndexingCopy = {
6
+ const DEFAULTS = {
75
7
  common: {
76
8
  failedTitle: 'Indexing data failed to load',
77
9
  failedOne: '{site} could not be loaded. Try the indexing request again.',
@@ -105,7 +37,7 @@ export const PRO_INDEXING_COPY: ProIndexingCopy = {
105
37
  action: 'Action',
106
38
  failedBody: 'Google indexing data could not be loaded for {site}.',
107
39
  openReport: 'Open indexing report',
108
- emptyNoObservation: 'Google hasn\'t reported coverage for this site yet. Breakdown appears after the first Search Console sync.',
40
+ emptyNoObservation: 'Google hasn\'t reported coverage for this Site yet. Breakdown appears after the first Search Console sync.',
109
41
  emptyAllIndexed: 'Every submitted URL is indexed, so there is nothing to break down.',
110
42
  emptyUnattributedOne: 'Google hasn\'t attributed a reason to the {count} URL it has not indexed.',
111
43
  emptyUnattributedMany: 'Google hasn\'t attributed a reason to the {count} URLs it has not indexed.',
@@ -137,8 +69,213 @@ export const PRO_INDEXING_COPY: ProIndexingCopy = {
137
69
  emptyTitle: 'No indexing changes recorded',
138
70
  emptyBody: 'Search Console reported no change in not indexed URLs, and no recorded or cleared issues, for these Sites in the last {days} days.',
139
71
  },
72
+ diagnosis: {
73
+ statusSevere: 'Action needed',
74
+ statusReview: 'Review',
75
+ statusHealthy: 'Healthy',
76
+ inspecting: 'Inspection in progress',
77
+ waitingForGoogle: 'Waiting for Google',
78
+ setupNeeded: 'Setup needed',
79
+ progressTitle: '{inspected} of {total} sitemap URLs inspected',
80
+ connectTitle: 'Connect Search Console to collect indexing evidence',
81
+ waitingTitle: 'Waiting for indexing data',
82
+ progressLabel: 'Sitemap inspection progress',
83
+ trustFailureBadge: 'Cannot confirm indexing',
84
+ trustFailureTitle: 'Fix the sitemap signal before trusting coverage',
85
+ reviewSitemap: 'Review sitemap',
86
+ verifyScopeBadge: 'Verify scope',
87
+ verifyScopeTitle: 'Indexing scope may have collapsed',
88
+ verifySitemap: 'Verify sitemap inventory',
89
+ partialScopeTitle: 'The inspected sample looks indexed',
90
+ viewInspectedUrls: 'View inspected URLs',
91
+ nextStep: 'Next step',
92
+ reviewSection: 'Review this section',
93
+ leadAction: 'Review these URLs',
94
+ scope: '',
95
+ freshness: 'Diagnosis {freshness}',
96
+ },
97
+ coverageTrend: {
98
+ title: 'Indexed URLs over time',
99
+ scope: 'Inspected sample, not whole-site coverage · {date}',
100
+ viewUrls: 'View inspected URLs',
101
+ indexed: 'Indexed',
102
+ loadingLabel: 'Loading indexing coverage trend',
103
+ errorTitle: 'Coverage trend unavailable',
104
+ errorBody: 'Retry to load the saved coverage snapshots.',
105
+ retry: 'Retry coverage trend',
106
+ insufficientTitle: 'Two snapshots needed',
107
+ insufficientOne: 'The first valid inspection snapshot is ready. The next snapshot will show the trajectory.',
108
+ insufficientNone: 'Coverage history starts after the first two valid inspection snapshots.',
109
+ },
110
+ cohorts: {
111
+ noCompletedCrawl: 'No completed crawl yet, so pages cannot be grouped.',
112
+ noMatch: 'No inspected URL matched a crawled page.',
113
+ spread: '{notIndexed} of {total} pages are not indexed',
114
+ untested: '{spread}, and no group of pages is large enough to compare.',
115
+ uniform: 'No part of this Site indexes worse than the rest. {spread}, spread evenly.',
116
+ outliersOne: 'One part of this Site indexes worse than the rest.',
117
+ outliersMany: '{count} parts of this Site index worse than the rest.',
118
+ comparedGroups: '{count} crawled pages compared across {groups} groups',
119
+ compared: '{count} crawled pages compared',
120
+ notCrawled: '{count} not-indexed URLs are outside this crawl',
121
+ fragments: '{count} fragment URLs excluded',
122
+ cellDetail: '{notIndexed} of {total} pages · {rest} across the rest',
123
+ cellOverlap: '{count} also counted above',
124
+ },
125
+ urls: {
126
+ tableLabel: 'Indexing URLs',
127
+ searchPlaceholder: 'Search URLs…',
128
+ emptyTitle: 'No URLs found',
129
+ emptyBody: 'URLs will appear here once Google returns URL Inspection evidence.',
130
+ itemLabel: 'URLs',
131
+ statusIndexed: 'Indexed',
132
+ statusIndexedTooltip: 'Only URLs Google currently reports as indexed.',
133
+ statusNotIndexed: 'Not indexed',
134
+ statusNotIndexedTooltip: 'Only URLs Google does not currently report as indexed.',
135
+ facetCanonicalMismatch: 'Canonical mismatch',
136
+ facetRichResults: 'Rich results',
137
+ clearFilter: 'Clear {label} filter',
138
+ noIssues: 'No issues',
139
+ issuesMenu: 'Issues',
140
+ issuesMenuLabel: 'Filter by issue type',
141
+ severityError: 'Errors',
142
+ severityWarning: 'Warnings',
143
+ severityInfo: 'Info',
144
+ refreshing: 'Refreshing',
145
+ affected: '{count} URLs affected',
146
+ consolidationTitle: 'Consolidation targets',
147
+ consolidationTooltip: 'Google is folding these pages onto another canonical. Point your canonical at the same URL, or remove the duplication.',
148
+ consolidationEmpty: 'No consolidation targets found.',
149
+ consolidationCount: '{count} pages',
150
+ richResultsScope: 'Rich results · across {count} URLs on this page',
151
+ richResultsInvalid: 'Review {count} invalid',
152
+ richResultsAllValid: 'All valid',
153
+ richResultsEmpty: 'No rich results on this page.',
154
+ richResultsValidCount: '{count} valid',
155
+ richResultsInvalidCount: '{count} invalid',
156
+ notInSitemapOne: 'of the {total} URLs on this page is not in your current sitemap.',
157
+ notInSitemapMany: 'of the {total} URLs on this page are not in your current sitemap.',
158
+ columnUrl: 'URL',
159
+ columnStatus: 'Status',
160
+ columnCoverage: 'Coverage',
161
+ columnInSitemap: 'In sitemap',
162
+ columnLastCrawl: 'Last crawl',
163
+ columnFlags: 'Flags',
164
+ inSitemap: 'In sitemap',
165
+ notInSitemap: 'Not in sitemap',
166
+ openInNewTab: 'Open {path} in new tab',
167
+ flagCanonicalMismatch: 'Canonical Mismatch',
168
+ flagDesktopCrawl: 'Desktop Crawl',
169
+ flagSoft404: 'Soft 404',
170
+ flagRichResults: 'Rich Results',
171
+ noValue: '—',
172
+ today: 'Today',
173
+ yesterday: 'Yesterday',
174
+ remediationLabel: 'Recommended remediation',
175
+ why: 'Why:',
176
+ stageRobots: 'Robots.txt',
177
+ stageFetch: 'Fetch',
178
+ stageIndexing: 'Indexing',
179
+ stageVerdict: 'Verdict',
180
+ pipelineLabel: 'Crawl pipeline',
181
+ detailCrawler: 'Crawler',
182
+ detailLastCrawl: 'Last Crawl',
183
+ detailChecks: 'Checks',
184
+ detailRichResults: 'Rich Results',
185
+ detailCanonical: 'Canonical',
186
+ detailGoogleCanonical: 'Google sees',
187
+ detailMismatch: 'mismatch',
188
+ openUrl: 'Open URL',
189
+ inspectInGsc: 'Inspect in GSC',
190
+ recheck: 'Re-check with Google',
191
+ rechecking: 'Re-checking…',
192
+ recheckTooltip: 'Hit Google URL Inspection now. Each check uses 1 of this Site\'s daily checks.',
193
+ recheckRemainingTooltip: 'Hit Google URL Inspection now. This Site has {remaining} of {limit} daily checks left.',
194
+ cohortChip: 'Cohort: {label}',
195
+ recheckLimitTooltip: 'Daily inspection limit reached for this Site',
196
+ limitTitle: 'Daily inspection limit reached',
197
+ limitBody: 'Google\'s URL Inspection budget for this Site resets in ~{hours}h.',
198
+ recheckedTitle: 'Re-checked with Google',
199
+ recheckedBody: '{url}: {state}',
200
+ recheckedUpdated: 'updated',
201
+ recheckFailedTitle: 'Re-check failed',
202
+ unknownError: 'Unknown error',
203
+ verdicts: {
204
+ PASS: 'Indexed',
205
+ FAIL: 'Not indexed',
206
+ PARTIAL: 'Partial',
207
+ NEUTRAL: 'Not indexed',
208
+ VERDICT_UNSPECIFIED: 'Unknown',
209
+ },
210
+ indexingStates: {
211
+ INDEXING_ALLOWED: 'Allowed',
212
+ INDEXING_NOT_ALLOWED: 'Not allowed',
213
+ INDEXING_STATE_UNSPECIFIED: 'Unknown',
214
+ },
215
+ robotsTxtStates: {
216
+ ALLOWED: 'Allowed',
217
+ DISALLOWED: 'Blocked',
218
+ ROBOTS_TXT_STATE_UNSPECIFIED: 'Unknown',
219
+ },
220
+ pageFetchStates: {
221
+ SUCCESSFUL: 'Successful',
222
+ SOFT_404: 'Soft 404',
223
+ SERVER_ERROR: 'Server error',
224
+ REDIRECT_ERROR: 'Redirect error',
225
+ ACCESS_DENIED: 'Access denied',
226
+ BLOCKED_ROBOTS_TXT: 'Blocked by robots',
227
+ NOT_FOUND: 'Not found',
228
+ PAGE_FETCH_STATE_UNSPECIFIED: 'Unknown',
229
+ },
230
+ crawlers: {
231
+ DESKTOP: 'Desktop',
232
+ MOBILE: 'Mobile',
233
+ CRAWLING_USER_AGENT_UNSPECIFIED: 'Unknown',
234
+ },
235
+ coverageStates: {
236
+ 'Submitted and indexed': 'Indexed',
237
+ 'Indexed, not submitted in sitemap': 'Indexed (no sitemap)',
238
+ 'Crawled - currently not indexed': 'Crawled, not indexed',
239
+ 'Discovered - currently not indexed': 'Discovered, not indexed',
240
+ 'URL is unknown to Google': 'Unknown to Google',
241
+ 'Page with redirect': 'Redirect',
242
+ 'Blocked by robots.txt': 'Blocked (robots)',
243
+ 'Excluded by \'noindex\' tag': 'Noindex',
244
+ 'Soft 404': 'Soft 404',
245
+ 'Not found (404)': '404',
246
+ 'Server error (5xx)': 'Server error',
247
+ 'Duplicate without user-selected canonical': 'Duplicate',
248
+ 'Duplicate, Google chose different canonical than user': 'Canonical mismatch',
249
+ 'Alternate page with proper canonical tag': 'Canonical alternate',
250
+ 'Blocked due to unauthorized request (401)': 'Auth required',
251
+ 'Blocked due to access forbidden (403)': 'Forbidden',
252
+ },
253
+ },
254
+ urlsShell: {
255
+ searchPlaceholder: 'Search…',
256
+ clearSearch: 'Clear search',
257
+ emptyTitle: 'No results',
258
+ itemLabel: 'rows',
259
+ emptySearch: 'No {items} match "{q}"',
260
+ emptyFilter: 'No {items} match the selected filter',
261
+ clearFilters: 'Clear filters',
262
+ refreshFailedTitle: 'Latest refresh failed',
263
+ refreshFailedBody: 'Showing the last successful report.',
264
+ retry: 'Retry',
265
+ loadFailed: 'The URLs could not be loaded',
266
+ total: '{items} total',
267
+ },
140
268
  }
141
269
 
270
+ type Widen<T> = {
271
+ readonly [K in keyof T]: T[K] extends string ? string : Widen<T[K]>
272
+ }
273
+
274
+ /** Every string the indexing sections render, grouped by section. */
275
+ export type ProIndexingCopy = Widen<typeof DEFAULTS>
276
+
277
+ export const PRO_INDEXING_COPY: ProIndexingCopy = DEFAULTS
278
+
142
279
  type DeepPartial<T> = {
143
280
  readonly [K in keyof T]?: T[K] extends string ? string : DeepPartial<T[K]>
144
281
  }
package/shared/routes.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  // token of the shell's route map, filled with `IndexingSite.ref`. A route the
4
4
  // site leaves out resolves to null, and the link that needs it hides.
5
5
 
6
- import { SITE_ROUTE_TOKEN } from '@nuxtseo/pro-shell/shared/routes'
6
+ import { encodeProShellSiteRef, SITE_ROUTE_TOKEN } from '@nuxtseo/pro-shell/shared/routes'
7
7
 
8
8
  /** Logical routes with no Site in the path. */
9
9
  export const PRO_INDEXING_APP_ROUTES = [
@@ -54,7 +54,7 @@ export function resolveIndexingSiteRoute(routes: ProIndexingRouteMap, name: ProI
54
54
  const template = routes[name]
55
55
  if (typeof template !== 'string' || !site || !template.includes(SITE_ROUTE_TOKEN))
56
56
  return null
57
- return withQuery(template.split(SITE_ROUTE_TOKEN).join(encodeURIComponent(site)), query)
57
+ return withQuery(template.split(SITE_ROUTE_TOKEN).join(encodeProShellSiteRef(site)), query)
58
58
  }
59
59
 
60
60
  /** The URLs list filter an issue row links to, as `?issue=` or `?facet=`. */
package/shared/source.ts CHANGED
@@ -84,7 +84,7 @@ export interface IndexingSource {
84
84
  /** The Site's indexing diagnostics: summary, issues, and meta. */
85
85
  readonly diagnostics: (site: SiteInput) => IndexingRead<GscdumpIndexingDiagnosticsResponse>
86
86
  /** One page of the Site's inspected URLs. */
87
- readonly urls: (site: SiteInput, params: MaybeRefOrGetter<IndexingUrlsParams>) => IndexingRead<GscdumpIndexingUrlsResponse>
87
+ readonly urls: (site: SiteInput, params: MaybeRefOrGetter<IndexingUrlsReadParams>) => IndexingRead<GscdumpIndexingUrlsResponse>
88
88
 
89
89
  // Capabilities. A section that needs a missing one does not render.
90
90
 
@@ -111,8 +111,22 @@ export interface IndexingSource {
111
111
  readonly indexNow?: true
112
112
  /** Watched URLs. The site draws its own Watched URLs panel inside `IndexingCapabilityGate`. */
113
113
  readonly watchedUrls?: true
114
+ /**
115
+ * The `urls` read honours `params.cohort`. With it, Index cohort rows link
116
+ * to their exact cohort (`?cohort=`), and the URLs table passes the filter
117
+ * on. Without it, a cohort row links by its path prefix.
118
+ */
119
+ readonly cohortFilter?: true
114
120
  }
115
121
 
122
+ /**
123
+ * The `urls` read's parameters. `cohort` is an Index cohort filter value from
124
+ * `indexCohortFilterValue` (`@gscdump/sdk/indexing`), such as
125
+ * `lifecycle:versioned`. The table sends it only to a source with the
126
+ * `cohortFilter` capability; parse it with `parseIndexCohortFilter`.
127
+ */
128
+ export type IndexingUrlsReadParams = IndexingUrlsParams & { readonly cohort?: string }
129
+
116
130
  /** The optional fields of an IndexingSource. */
117
131
  export const INDEXING_CAPABILITIES = [
118
132
  'diagnose',
@@ -123,6 +137,7 @@ export const INDEXING_CAPABILITIES = [
123
137
  'changesRollup',
124
138
  'indexNow',
125
139
  'watchedUrls',
140
+ 'cohortFilter',
126
141
  ] as const satisfies ReadonlyArray<keyof IndexingSource>
127
142
 
128
143
  export type IndexingCapability = typeof INDEXING_CAPABILITIES[number]
@@ -0,0 +1,45 @@
1
+ import { indexCohortFilterValue, parseIndexCohortFilter } from '@gscdump/sdk/indexing'
2
+ import { issueDetails } from '@gscdump/sdk/indexing-issues'
3
+
4
+ /** A URLs-table facet: a panel above the rows. */
5
+ export type IndexingUrlsFacet = 'canonical_mismatch' | 'rich_results'
6
+
7
+ /** The URLs-table filters a route query carries. */
8
+ export interface IndexingUrlsQuery {
9
+ /** A known issue type. The `canonical_mismatch` facet implies its issue. */
10
+ readonly issue: string | undefined
11
+ readonly facet: IndexingUrlsFacet | undefined
12
+ /** Undefined while an issue filter is active: the API takes one of the two. */
13
+ readonly status: 'indexed' | 'not_indexed' | undefined
14
+ readonly search: string | undefined
15
+ /** An Index cohort filter value, such as `lifecycle:versioned`. Kept beside a status filter. */
16
+ readonly cohort: string | undefined
17
+ readonly page: number
18
+ }
19
+
20
+ type QueryValue = string | null | undefined | ReadonlyArray<string | null>
21
+
22
+ function text(value: QueryValue): string | undefined {
23
+ return typeof value === 'string' && value ? value : undefined
24
+ }
25
+
26
+ /**
27
+ * Parses a route query into the URLs-table filters. An unknown issue, facet,
28
+ * status or page reads as absent, so a stale link still shows the table.
29
+ * `IndexingUrlsTable` follows this on every route change.
30
+ */
31
+ export function parseIndexingUrlsQuery(query: Readonly<Record<string, QueryValue>>): IndexingUrlsQuery {
32
+ const rawIssue = text(query.issue)
33
+ const rawFacet = text(query.facet)
34
+ const facet = rawFacet === 'canonical_mismatch' || rawFacet === 'rich_results' ? rawFacet : undefined
35
+ const issue = rawIssue && issueDetails[rawIssue]
36
+ ? rawIssue
37
+ : facet === 'canonical_mismatch' ? 'canonical_mismatch' : undefined
38
+ const rawStatus = text(query.status)
39
+ const status = !issue && (rawStatus === 'indexed' || rawStatus === 'not_indexed') ? rawStatus : undefined
40
+ const rawPage = text(query.page)
41
+ const page = rawPage && /^[1-9]\d*$/.test(rawPage) ? Number(rawPage) : 1
42
+ const parsedCohort = parseIndexCohortFilter(text(query.cohort))
43
+ const cohort = parsedCohort._tag === 'ok' ? indexCohortFilterValue(parsedCohort.filter) : undefined
44
+ return { issue, facet, status, search: text(query.search), cohort, page }
45
+ }