@nuxtseo/pro-indexing 0.0.0-stage → 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 +249 -2
- package/app/app.config.ts +14 -0
- package/app/components/IndexingCapabilityGate.vue +20 -0
- package/app/components/IndexingCohortList.vue +130 -0
- package/app/components/IndexingCoverageTrend.vue +145 -0
- package/app/components/IndexingCrawlPipeline.vue +211 -0
- package/app/components/IndexingDiagnosisPanel.vue +266 -0
- package/app/components/IndexingPortfolioChanges.vue +320 -0
- package/app/components/IndexingPortfolioIssues.vue +202 -0
- package/app/components/IndexingPortfolioOverview.vue +200 -0
- package/app/components/IndexingSiteIssues.vue +123 -0
- package/app/components/IndexingUrlsTable.vue +1084 -0
- package/app/components/IndexingUrlsTableShell.vue +237 -0
- package/app/composables/useIndexingSource.ts +27 -0
- package/app/composables/useProIndexingConfig.ts +10 -0
- package/app/composables/useProIndexingCopy.ts +10 -0
- package/app/composables/useProIndexingRoute.ts +23 -0
- package/nuxt.config.ts +33 -0
- package/package.json +67 -3
- package/shared/changes.ts +124 -0
- package/shared/config.ts +36 -0
- package/shared/copy.ts +306 -0
- package/shared/coverage-trend.ts +72 -0
- package/shared/issue-display.ts +77 -0
- package/shared/portfolio-overview.ts +120 -0
- package/shared/portfolio.ts +79 -0
- package/shared/routes.ts +63 -0
- package/shared/source.ts +153 -0
- package/shared/urls-query.ts +45 -0
|
@@ -0,0 +1,1084 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { GscdumpCanonicalMismatchesResponse, GscdumpIndexingUrlsResponse } from '@gscdump/contracts'
|
|
3
|
+
import type { UiTableColumn } from '@nuxtseo/design-system/app/shared/table'
|
|
4
|
+
import type { Component, VNode } from 'vue'
|
|
5
|
+
import type { IndexingSite } from '../../shared/source'
|
|
6
|
+
import type { IndexingUrlsFacet } from '../../shared/urls-query'
|
|
7
|
+
import { gscConsoleUrl } from '@gscdump/sdk/gsc-console-url'
|
|
8
|
+
import { indexingActionForIssue, parseIndexCohortFilter } from '@gscdump/sdk/indexing'
|
|
9
|
+
import { issueDetails, severityOrder } from '@gscdump/sdk/indexing-issues'
|
|
10
|
+
import { DISPLAY_LOCALE, useProHumanFriendlyNumber } from '@nuxtseo/design-system/app/composables/formatting'
|
|
11
|
+
import { fillCopy } from '@nuxtseo/pro-shell/shared/copy'
|
|
12
|
+
import { navigateTo, useRoute } from 'nuxt/app'
|
|
13
|
+
import { computed, h, onMounted, ref, watch } from 'vue'
|
|
14
|
+
import { UiButton, UiChip, UiDataList, UiIcon, UiMetricLabel as UiMetricLabelCell, UiPopover, UiSeverityDot, UiSkeleton, UiSyncDot } from '#components'
|
|
15
|
+
import { useToast } from '#imports'
|
|
16
|
+
import { issueIcons } from '../../shared/issue-display'
|
|
17
|
+
import { parseIndexingUrlsQuery } from '../../shared/urls-query'
|
|
18
|
+
import { useIndexingSource } from '../composables/useIndexingSource'
|
|
19
|
+
import { useProIndexingCopy } from '../composables/useProIndexingCopy'
|
|
20
|
+
import IndexingCrawlPipeline from './IndexingCrawlPipeline.vue'
|
|
21
|
+
import IndexingUrlsTableShell from './IndexingUrlsTableShell.vue'
|
|
22
|
+
|
|
23
|
+
// One Site's inspected URLs: issue filter, status filter, search, pages, the
|
|
24
|
+
// facet panels, and the per-URL detail. Reads `diagnostics` and `urls` from
|
|
25
|
+
// the IndexingSource. `diagnose` adds the remediation for the filtered issue,
|
|
26
|
+
// `inspect` adds "Re-check with Google", and `canonicalMismatches` adds the
|
|
27
|
+
// consolidation targets. A site with its own table shell passes it as `shell`.
|
|
28
|
+
|
|
29
|
+
type GscdumpIndexingUrl = GscdumpIndexingUrlsResponse['urls'][number]
|
|
30
|
+
type ConsolidationTargetRow = GscdumpCanonicalMismatchesResponse['consolidationTargets'][number]
|
|
31
|
+
interface RichResultDistributionRow { type: string, valid: number, invalid: number }
|
|
32
|
+
type StatusKey = 'indexed' | 'not_indexed'
|
|
33
|
+
|
|
34
|
+
const { site, pageSize = 25, shell, forceSkeleton = false } = defineProps<{
|
|
35
|
+
site: IndexingSite | null | undefined
|
|
36
|
+
pageSize?: number
|
|
37
|
+
/** The site's own table shell. It takes the props, events, and slots of `IndexingUrlsTableShell`. */
|
|
38
|
+
shell?: Component
|
|
39
|
+
/** Show the loading skeleton, for a site's design review mode. */
|
|
40
|
+
forceSkeleton?: boolean
|
|
41
|
+
}>()
|
|
42
|
+
|
|
43
|
+
const source = useIndexingSource()
|
|
44
|
+
const copy = useProIndexingCopy().urls
|
|
45
|
+
const siteRef = () => site ?? null
|
|
46
|
+
const TableShell = computed(() => shell ?? IndexingUrlsTableShell)
|
|
47
|
+
|
|
48
|
+
const route = useRoute()
|
|
49
|
+
|
|
50
|
+
// The route query is the table's filter state: `issue`, `facet`, `status`,
|
|
51
|
+
// `search` and `page`. The table writes it on each change and follows it, so
|
|
52
|
+
// Back and Forward re-filter in place and a filtered view stays a link.
|
|
53
|
+
const tableQuery = computed(() => parseIndexingUrlsQuery(route.query))
|
|
54
|
+
const mountQuery = tableQuery.value
|
|
55
|
+
|
|
56
|
+
type TableQueryKey = 'cohort' | 'facet' | 'issue' | 'page' | 'search' | 'status'
|
|
57
|
+
|
|
58
|
+
function updateRouteQuery(
|
|
59
|
+
updates: Partial<Record<TableQueryKey, string | undefined>>,
|
|
60
|
+
replace = false,
|
|
61
|
+
) {
|
|
62
|
+
const query = { ...route.query }
|
|
63
|
+
for (const [key, value] of Object.entries(updates)) {
|
|
64
|
+
if (value)
|
|
65
|
+
query[key] = value
|
|
66
|
+
else
|
|
67
|
+
delete query[key]
|
|
68
|
+
}
|
|
69
|
+
void navigateTo({ query }, replace ? { replace: true } : undefined)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Active facet (canonical_mismatch | rich_results).
|
|
73
|
+
const facet = ref<IndexingUrlsFacet | undefined>(mountQuery.facet)
|
|
74
|
+
const isRichResultsFacet = computed(() => facet.value === 'rich_results')
|
|
75
|
+
|
|
76
|
+
const facetLabel = computed(() => {
|
|
77
|
+
if (facet.value === 'canonical_mismatch')
|
|
78
|
+
return copy.facetCanonicalMismatch
|
|
79
|
+
if (facet.value === 'rich_results')
|
|
80
|
+
return copy.facetRichResults
|
|
81
|
+
return facet.value ?? ''
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
function clearFacet() {
|
|
85
|
+
if (issueFilter.value === 'canonical_mismatch')
|
|
86
|
+
issueFilter.value = undefined
|
|
87
|
+
facet.value = undefined
|
|
88
|
+
page.value = 1
|
|
89
|
+
updateRouteQuery({ facet: undefined, issue: undefined, page: undefined })
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const page = ref(mountQuery.page)
|
|
93
|
+
|
|
94
|
+
// Internal search
|
|
95
|
+
const q = ref(mountQuery.search ?? '')
|
|
96
|
+
|
|
97
|
+
// An exact Index cohort (`?cohort=`), read only by a source with the
|
|
98
|
+
// `cohortFilter` capability. It narrows the status filter, never replaces it.
|
|
99
|
+
const cohortFilterSupported = source?.cohortFilter === true
|
|
100
|
+
const cohort = ref<string | undefined>(cohortFilterSupported ? mountQuery.cohort : undefined)
|
|
101
|
+
const cohortLabel = computed(() => {
|
|
102
|
+
const parsed = parseIndexCohortFilter(cohort.value)
|
|
103
|
+
return parsed._tag === 'ok' ? parsed.filter.key : ''
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
function clearCohort() {
|
|
107
|
+
cohort.value = undefined
|
|
108
|
+
page.value = 1
|
|
109
|
+
updateRouteQuery({ cohort: undefined, page: undefined })
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// The API accepts one status. A single-select control keeps the URL and request exact.
|
|
113
|
+
const statusFilter = ref<StatusKey | undefined>(mountQuery.status)
|
|
114
|
+
|
|
115
|
+
const statusFilters = [
|
|
116
|
+
{ key: 'indexed' as StatusKey, label: copy.statusIndexed, icon: 'success', tooltip: copy.statusIndexedTooltip },
|
|
117
|
+
{ key: 'not_indexed' as StatusKey, label: copy.statusNotIndexed, icon: 'error', tooltip: copy.statusNotIndexedTooltip },
|
|
118
|
+
]
|
|
119
|
+
|
|
120
|
+
function toggleStatusFilter(key: string) {
|
|
121
|
+
if (key !== 'indexed' && key !== 'not_indexed')
|
|
122
|
+
return
|
|
123
|
+
const nextStatus = statusFilter.value === key ? undefined : key
|
|
124
|
+
statusFilter.value = nextStatus
|
|
125
|
+
issueFilter.value = undefined
|
|
126
|
+
facet.value = undefined
|
|
127
|
+
page.value = 1
|
|
128
|
+
updateRouteQuery({
|
|
129
|
+
status: nextStatus,
|
|
130
|
+
issue: undefined,
|
|
131
|
+
facet: undefined,
|
|
132
|
+
page: undefined,
|
|
133
|
+
})
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// --- Diagnostics (issue filter) ---
|
|
137
|
+
// The `canonical_mismatch` facet filters SERVER-side: gscdump's `getIndexingUrls`
|
|
138
|
+
// accepts `issue=canonical_mismatch` (verified in gscdump's INDEXING_ISSUE_FILTERS),
|
|
139
|
+
// so we drive the existing `issue` param rather than client-filtering the sample.
|
|
140
|
+
const issueFilter = ref<string | undefined>(mountQuery.issue)
|
|
141
|
+
|
|
142
|
+
const diagnosticsRead = source?.diagnostics(siteRef) ?? null
|
|
143
|
+
const diagnosticsData = computed(() => diagnosticsRead?.data.value ?? null)
|
|
144
|
+
const diagnosticsStatus = computed(() => diagnosticsRead?.status.value ?? 'idle')
|
|
145
|
+
|
|
146
|
+
const hydrated = ref(false)
|
|
147
|
+
onMounted(() => { hydrated.value = true })
|
|
148
|
+
const isDiagnosticsLoading = computed(() => hydrated.value && diagnosticsStatus.value === 'pending' && !diagnosticsData.value)
|
|
149
|
+
|
|
150
|
+
const issuesBySeverity = computed(() => {
|
|
151
|
+
if (!diagnosticsData.value?.issues)
|
|
152
|
+
return []
|
|
153
|
+
|
|
154
|
+
return severityOrder
|
|
155
|
+
.map(severity => ({
|
|
156
|
+
severity,
|
|
157
|
+
issues: diagnosticsData.value!.issues.filter(i => i.severity === severity && i.count > 0),
|
|
158
|
+
}))
|
|
159
|
+
.filter(g => g.issues.length > 0)
|
|
160
|
+
})
|
|
161
|
+
|
|
162
|
+
const hasAnyIssues = computed(() => issuesBySeverity.value.length > 0)
|
|
163
|
+
|
|
164
|
+
const issuePopoverOpen = ref(false)
|
|
165
|
+
|
|
166
|
+
const totalErrorCount = computed(() =>
|
|
167
|
+
issuesBySeverity.value.find(g => g.severity === 'error')?.issues.reduce((s, i) => s + i.count, 0) ?? 0,
|
|
168
|
+
)
|
|
169
|
+
const totalWarningCount = computed(() =>
|
|
170
|
+
issuesBySeverity.value.find(g => g.severity === 'warning')?.issues.reduce((s, i) => s + i.count, 0) ?? 0,
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
const activeIssueData = computed(() => {
|
|
174
|
+
if (!issueFilter.value || !diagnosticsData.value?.issues)
|
|
175
|
+
return null
|
|
176
|
+
const issue = diagnosticsData.value.issues.find(i => i.type === issueFilter.value)
|
|
177
|
+
if (!issue)
|
|
178
|
+
return null
|
|
179
|
+
const details = issueDetails[issue.type]
|
|
180
|
+
if (!details)
|
|
181
|
+
return null
|
|
182
|
+
return {
|
|
183
|
+
...details,
|
|
184
|
+
...issue,
|
|
185
|
+
description: issue.type === 'crawled_not_indexed' || issue.type === 'soft_404'
|
|
186
|
+
? details.description
|
|
187
|
+
: issue.description || details.description,
|
|
188
|
+
}
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
function isIssueActive(issueType: string): boolean {
|
|
192
|
+
return issueFilter.value === issueType
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function handleIssueClick(issueType: string) {
|
|
196
|
+
const nextIssue = issueFilter.value === issueType ? undefined : issueType
|
|
197
|
+
issueFilter.value = nextIssue
|
|
198
|
+
statusFilter.value = undefined
|
|
199
|
+
facet.value = undefined
|
|
200
|
+
page.value = 1
|
|
201
|
+
issuePopoverOpen.value = false
|
|
202
|
+
updateRouteQuery({
|
|
203
|
+
issue: nextIssue,
|
|
204
|
+
status: undefined,
|
|
205
|
+
facet: undefined,
|
|
206
|
+
page: undefined,
|
|
207
|
+
})
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function clearTableFilters() {
|
|
211
|
+
q.value = ''
|
|
212
|
+
cohort.value = undefined
|
|
213
|
+
statusFilter.value = undefined
|
|
214
|
+
issueFilter.value = undefined
|
|
215
|
+
facet.value = undefined
|
|
216
|
+
page.value = 1
|
|
217
|
+
updateRouteQuery({
|
|
218
|
+
cohort: undefined,
|
|
219
|
+
facet: undefined,
|
|
220
|
+
issue: undefined,
|
|
221
|
+
search: undefined,
|
|
222
|
+
status: undefined,
|
|
223
|
+
page: undefined,
|
|
224
|
+
})
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function updateSearch(value: string) {
|
|
228
|
+
q.value = value
|
|
229
|
+
page.value = 1
|
|
230
|
+
updateRouteQuery({
|
|
231
|
+
search: value || undefined,
|
|
232
|
+
page: undefined,
|
|
233
|
+
}, true)
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function updatePage(nextPage: number) {
|
|
237
|
+
if (page.value === nextPage)
|
|
238
|
+
return
|
|
239
|
+
page.value = nextPage
|
|
240
|
+
updateRouteQuery({
|
|
241
|
+
page: nextPage > 1 ? String(nextPage) : undefined,
|
|
242
|
+
})
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
watch(tableQuery, (next) => {
|
|
246
|
+
q.value = next.search ?? ''
|
|
247
|
+
issueFilter.value = next.issue
|
|
248
|
+
statusFilter.value = next.status
|
|
249
|
+
facet.value = next.facet
|
|
250
|
+
cohort.value = cohortFilterSupported ? next.cohort : undefined
|
|
251
|
+
page.value = next.page
|
|
252
|
+
})
|
|
253
|
+
|
|
254
|
+
// --- URL table data ---
|
|
255
|
+
|
|
256
|
+
const params = computed(() => ({
|
|
257
|
+
limit: pageSize,
|
|
258
|
+
offset: (page.value - 1) * pageSize,
|
|
259
|
+
status: statusFilter.value,
|
|
260
|
+
issue: issueFilter.value || undefined,
|
|
261
|
+
search: q.value || undefined,
|
|
262
|
+
...(cohort.value ? { cohort: cohort.value } : {}),
|
|
263
|
+
}))
|
|
264
|
+
|
|
265
|
+
const urlsRead = source?.urls(siteRef, params) ?? null
|
|
266
|
+
const data = computed(() => urlsRead?.data.value ?? null)
|
|
267
|
+
const fetchStatus = computed(() => urlsRead?.status.value ?? 'idle')
|
|
268
|
+
const error = computed(() => urlsRead?.error.value ?? null)
|
|
269
|
+
const refresh = () => urlsRead?.refresh() ?? Promise.resolve()
|
|
270
|
+
const displayError = computed(() => error.value instanceof Error ? error.value : null)
|
|
271
|
+
const activeRemediation = computed(() => {
|
|
272
|
+
const diagnostics = diagnosticsData.value
|
|
273
|
+
const issue = issueFilter.value
|
|
274
|
+
if (!diagnostics || !issue || !source?.diagnose)
|
|
275
|
+
return null
|
|
276
|
+
const diagnosis = source.diagnose({
|
|
277
|
+
totalUrls: diagnostics.summary.totalUrls,
|
|
278
|
+
indexed: diagnostics.summary.indexed,
|
|
279
|
+
issues: diagnostics.issues,
|
|
280
|
+
sampleUrls: data.value?.urls ?? [],
|
|
281
|
+
})
|
|
282
|
+
return indexingActionForIssue(diagnosis, issue) ?? null
|
|
283
|
+
})
|
|
284
|
+
|
|
285
|
+
// Clear status filter when issue filter is set
|
|
286
|
+
watch(issueFilter, (v) => {
|
|
287
|
+
if (v)
|
|
288
|
+
statusFilter.value = undefined
|
|
289
|
+
})
|
|
290
|
+
|
|
291
|
+
// A URL carries rich-results signal if it has typed items, or a meaningful
|
|
292
|
+
// verdict (PASS/FAIL/PARTIAL — not the neutral/unspecified placeholders).
|
|
293
|
+
function hasRichResult(url: GscdumpIndexingUrl): boolean {
|
|
294
|
+
if (url.richResultsItems?.length)
|
|
295
|
+
return true
|
|
296
|
+
const v = url.richResultsVerdict
|
|
297
|
+
return !!v && !v.includes('UNSPECIFIED') && v !== 'NEUTRAL'
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// Client-side filtered URLs for the rich-results facet (sample-scoped, no
|
|
301
|
+
// aggregate API per §5.6). Status and issue remain server-backed.
|
|
302
|
+
const displayUrls = computed(() => {
|
|
303
|
+
if (!data.value?.urls)
|
|
304
|
+
return []
|
|
305
|
+
let urls = data.value.urls
|
|
306
|
+
if (isRichResultsFacet.value)
|
|
307
|
+
urls = urls.filter(hasRichResult)
|
|
308
|
+
return urls
|
|
309
|
+
})
|
|
310
|
+
|
|
311
|
+
// --- Facet panels (above the table) ---
|
|
312
|
+
|
|
313
|
+
// `canonical_mismatch` facet: consolidation targets (Google's chosen
|
|
314
|
+
// canonicals), from the `canonicalMismatches` capability. Leaving the facet
|
|
315
|
+
// stops the read.
|
|
316
|
+
const consolidationRead = source?.canonicalMismatches?.(siteRef, () => facet.value === 'canonical_mismatch') ?? null
|
|
317
|
+
const consolidationData = computed<GscdumpCanonicalMismatchesResponse | null>(() => consolidationRead?.data.value ?? null)
|
|
318
|
+
const consolidationStatus = computed(() => consolidationRead?.status.value ?? 'idle')
|
|
319
|
+
|
|
320
|
+
// `rich_results` facet: aggregate the LOADED sample's rich-results items by type
|
|
321
|
+
// into valid (parent verdict PASS) vs invalid (FAIL/PARTIAL) counts. Sample-scoped.
|
|
322
|
+
const richResultsDistribution = computed<RichResultDistributionRow[]>(() => {
|
|
323
|
+
const urls = data.value?.urls ?? []
|
|
324
|
+
const byType = new Map<string, { type: string, valid: number, invalid: number }>()
|
|
325
|
+
for (const u of urls) {
|
|
326
|
+
if (!u.richResultsItems?.length)
|
|
327
|
+
continue
|
|
328
|
+
const valid = u.richResultsVerdict === 'PASS'
|
|
329
|
+
const invalid = u.richResultsVerdict === 'FAIL' || u.richResultsVerdict === 'PARTIAL'
|
|
330
|
+
if (!valid && !invalid)
|
|
331
|
+
continue
|
|
332
|
+
for (const item of u.richResultsItems) {
|
|
333
|
+
const type = item.richResultType
|
|
334
|
+
if (!type)
|
|
335
|
+
continue
|
|
336
|
+
const entry = byType.get(type) ?? { type, valid: 0, invalid: 0 }
|
|
337
|
+
if (valid)
|
|
338
|
+
entry.valid++
|
|
339
|
+
else
|
|
340
|
+
entry.invalid++
|
|
341
|
+
byType.set(type, entry)
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
return [...byType.values()].sort((a, b) => (b.invalid - a.invalid) || (b.valid - a.valid))
|
|
345
|
+
})
|
|
346
|
+
const richResultsScopeCount = computed(() => data.value?.urls?.length ?? 0)
|
|
347
|
+
const richResultsInvalidTotal = computed(() => richResultsDistribution.value.reduce((sum, r) => sum + r.invalid, 0))
|
|
348
|
+
|
|
349
|
+
// No-facet summary: how many of the loaded sample aren't in the current sitemap.
|
|
350
|
+
const notInSitemapCount = computed(() => (data.value?.urls ?? []).filter(u => inSitemap(u) === false).length)
|
|
351
|
+
|
|
352
|
+
const total = computed(() => data.value?.pagination.total || 0)
|
|
353
|
+
const indexingGscSiteLabel = computed(() => {
|
|
354
|
+
const meta = data.value?.meta
|
|
355
|
+
if (!meta)
|
|
356
|
+
return ''
|
|
357
|
+
if ('gscPropertyUrl' in meta && typeof meta.gscPropertyUrl === 'string' && meta.gscPropertyUrl)
|
|
358
|
+
return meta.gscPropertyUrl
|
|
359
|
+
return meta.siteUrl
|
|
360
|
+
})
|
|
361
|
+
|
|
362
|
+
// --- Manual re-inspection ---
|
|
363
|
+
const inspectUrls = source?.inspect?.() ?? null
|
|
364
|
+
const inflightUrls = ref(new Set<string>())
|
|
365
|
+
// The daily URL Inspection checks left, as the last `inspect` call reported them.
|
|
366
|
+
const inspectQuota = ref<{ remaining: number, limit: number } | null>(null)
|
|
367
|
+
const inspectBudgetRemaining = computed(() => inspectQuota.value?.remaining ?? null)
|
|
368
|
+
const recheckTitle = computed(() => {
|
|
369
|
+
const quota = inspectQuota.value
|
|
370
|
+
if (quota?.remaining === 0)
|
|
371
|
+
return copy.recheckLimitTooltip
|
|
372
|
+
return quota ? fillCopy(copy.recheckRemainingTooltip, quota) : copy.recheckTooltip
|
|
373
|
+
})
|
|
374
|
+
const toast = useToast()
|
|
375
|
+
|
|
376
|
+
async function handleReinspect(url: GscdumpIndexingUrl) {
|
|
377
|
+
if (!site?.dataId || !inspectUrls || inflightUrls.value.has(url.url))
|
|
378
|
+
return
|
|
379
|
+
inflightUrls.value = new Set([...inflightUrls.value, url.url])
|
|
380
|
+
try {
|
|
381
|
+
const res = await inspectUrls(site, [url.url])
|
|
382
|
+
if ('error' in res && res.error === 'rate_limited') {
|
|
383
|
+
inspectQuota.value = { remaining: 0, limit: res.rateLimit?.limit ?? inspectQuota.value?.limit ?? 0 }
|
|
384
|
+
toast.add({
|
|
385
|
+
title: copy.limitTitle,
|
|
386
|
+
description: fillCopy(copy.limitBody, { hours: Math.round(res.retryAfterSeconds / 3600) }),
|
|
387
|
+
color: 'warning',
|
|
388
|
+
icon: 'clock',
|
|
389
|
+
})
|
|
390
|
+
return
|
|
391
|
+
}
|
|
392
|
+
const ok = res as Exclude<typeof res, { error: 'rate_limited' }>
|
|
393
|
+
inspectQuota.value = { remaining: ok.rateLimit.remaining, limit: ok.rateLimit.limit }
|
|
394
|
+
if (ok.results.length > 0) {
|
|
395
|
+
toast.add({
|
|
396
|
+
title: copy.recheckedTitle,
|
|
397
|
+
description: fillCopy(copy.recheckedBody, { url: url.url, state: ok.results[0]!.coverageState ?? ok.results[0]!.verdict ?? copy.recheckedUpdated }),
|
|
398
|
+
color: 'success',
|
|
399
|
+
icon: 'check',
|
|
400
|
+
})
|
|
401
|
+
await refresh()
|
|
402
|
+
}
|
|
403
|
+
else if (ok.errors.length > 0) {
|
|
404
|
+
toast.add({
|
|
405
|
+
title: copy.recheckFailedTitle,
|
|
406
|
+
description: ok.errors[0]!.error,
|
|
407
|
+
color: 'error',
|
|
408
|
+
icon: 'warning',
|
|
409
|
+
})
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
catch (e) {
|
|
413
|
+
toast.add({
|
|
414
|
+
title: copy.recheckFailedTitle,
|
|
415
|
+
description: e instanceof Error ? e.message : copy.unknownError,
|
|
416
|
+
color: 'error',
|
|
417
|
+
icon: 'warning',
|
|
418
|
+
})
|
|
419
|
+
}
|
|
420
|
+
finally {
|
|
421
|
+
const next = new Set(inflightUrls.value)
|
|
422
|
+
next.delete(url.url)
|
|
423
|
+
inflightUrls.value = next
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
const isLoading = computed(() => hydrated.value && (forceSkeleton || (fetchStatus.value === 'pending' && !data.value)))
|
|
427
|
+
|
|
428
|
+
function formatDate(dateStr: string | null): string {
|
|
429
|
+
if (!dateStr)
|
|
430
|
+
return copy.noValue
|
|
431
|
+
const date = new Date(dateStr)
|
|
432
|
+
const now = new Date()
|
|
433
|
+
const diff = now.getTime() - date.getTime()
|
|
434
|
+
const days = Math.floor(diff / (24 * 60 * 60 * 1000))
|
|
435
|
+
|
|
436
|
+
if (days === 0)
|
|
437
|
+
return copy.today
|
|
438
|
+
if (days === 1)
|
|
439
|
+
return copy.yesterday
|
|
440
|
+
return new Intl.DateTimeFormat(DISPLAY_LOCALE, { month: 'short', day: 'numeric' }).format(date)
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
function formatFullDate(dateStr: string | null): string {
|
|
444
|
+
if (!dateStr)
|
|
445
|
+
return copy.noValue
|
|
446
|
+
const date = new Date(dateStr)
|
|
447
|
+
return new Intl.DateTimeFormat(DISPLAY_LOCALE, { month: 'short', day: 'numeric', year: 'numeric', hour: '2-digit', minute: '2-digit' }).format(date)
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
function getPath(url: string): string {
|
|
451
|
+
if (!url || !url.startsWith('http'))
|
|
452
|
+
return url
|
|
453
|
+
return new URL(url).pathname || '/'
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
function canonicalDisplayLabel(
|
|
457
|
+
url: string,
|
|
458
|
+
differenceKind: GscdumpIndexingUrl['canonicalMismatchKind'],
|
|
459
|
+
): string {
|
|
460
|
+
return differenceKind === 'cross_domain' ? url : getPath(url)
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
function hasCanonicalMismatch(url: GscdumpIndexingUrl): boolean {
|
|
464
|
+
return url.canonicalMismatchKind === 'path'
|
|
465
|
+
|| url.canonicalMismatchKind === 'cross_domain'
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
// §8.E — sitemap membership, parsed from the GSC coverageState (no new API).
|
|
469
|
+
// `true` = Google saw it in a submitted sitemap; `false` = indexed/known but NOT
|
|
470
|
+
// in the current sitemap (the gap worth surfacing); `null` = can't tell.
|
|
471
|
+
function inSitemap(url: GscdumpIndexingUrl): boolean | null {
|
|
472
|
+
const cs = url.coverageState?.toLowerCase() ?? ''
|
|
473
|
+
if (!cs)
|
|
474
|
+
return null
|
|
475
|
+
if (cs.includes('not submitted in sitemap'))
|
|
476
|
+
return false
|
|
477
|
+
if (cs.includes('submitted'))
|
|
478
|
+
return true
|
|
479
|
+
return null
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
const indexingStateLabels: Readonly<Record<string, string>> = copy.indexingStates
|
|
483
|
+
const robotsTxtStateLabels: Readonly<Record<string, string>> = copy.robotsTxtStates
|
|
484
|
+
const pageFetchStateLabels: Readonly<Record<string, string>> = copy.pageFetchStates
|
|
485
|
+
const crawlerLabels: Readonly<Record<string, string>> = copy.crawlers
|
|
486
|
+
const verdictLabels: Readonly<Record<string, string>> = copy.verdicts
|
|
487
|
+
// Short labels for verbose GSC coverage state strings
|
|
488
|
+
const coverageShortLabels: Readonly<Record<string, string>> = copy.coverageStates
|
|
489
|
+
|
|
490
|
+
function shortCoverage(raw: string | null | undefined): string {
|
|
491
|
+
if (!raw)
|
|
492
|
+
return copy.noValue
|
|
493
|
+
return coverageShortLabels[raw] || raw
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
function humanize(raw: string | null | undefined, labels: Readonly<Record<string, string>>) {
|
|
497
|
+
if (!raw)
|
|
498
|
+
return copy.noValue
|
|
499
|
+
return labels[raw] || raw.replace(/_/g, ' ').replace(/\b\w/g, c => c.toUpperCase()).replace(/\s(Unspecified|State)/gi, '').trim() || copy.noValue
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
type SeverityType = 'success' | 'error' | 'warning' | 'neutral'
|
|
503
|
+
|
|
504
|
+
function stateSeverity(raw: string | null | undefined, successValues: string[]): SeverityType {
|
|
505
|
+
if (!raw)
|
|
506
|
+
return 'neutral'
|
|
507
|
+
if (raw.includes('UNSPECIFIED') || raw === 'NEUTRAL')
|
|
508
|
+
return 'neutral'
|
|
509
|
+
return successValues.includes(raw) ? 'success' : 'error'
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
// --- Column definitions ---
|
|
513
|
+
|
|
514
|
+
function renderHeader(label: string) {
|
|
515
|
+
return h(UiMetricLabelCell, { size: 'sm', tone: 'muted', label })
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
const columns = computed<UiTableColumn<GscdumpIndexingUrl>[]>(() => {
|
|
519
|
+
const cols: UiTableColumn<GscdumpIndexingUrl>[] = [
|
|
520
|
+
{
|
|
521
|
+
accessorKey: 'url',
|
|
522
|
+
header: () => renderHeader(copy.columnUrl),
|
|
523
|
+
rowHeader: true,
|
|
524
|
+
cell: ({ row }) => {
|
|
525
|
+
const url = row.original
|
|
526
|
+
return h('div', { class: 'flex items-center gap-2.5 min-w-0 group/url' }, [
|
|
527
|
+
h('span', { class: 'truncate text-sm font-medium text-default', title: url.url }, getPath(url.url)),
|
|
528
|
+
h('a', {
|
|
529
|
+
'href': url.url,
|
|
530
|
+
'target': '_blank',
|
|
531
|
+
'rel': 'noopener',
|
|
532
|
+
'aria-label': fillCopy(copy.openInNewTab, { path: getPath(url.url) }),
|
|
533
|
+
'class': 'inline-flex min-h-11 min-w-11 shrink-0 items-center justify-center rounded-md opacity-100 outline-none motion-safe:transition-opacity focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-primary sm:min-h-0 sm:min-w-0 sm:opacity-0 sm:group-hover/url:opacity-100',
|
|
534
|
+
'onClick': (e: Event) => e.stopPropagation(),
|
|
535
|
+
}, [
|
|
536
|
+
h(UiIcon, { name: 'external', class: 'size-3 text-dimmed hover:text-default' }),
|
|
537
|
+
]),
|
|
538
|
+
])
|
|
539
|
+
},
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
accessorKey: 'verdict',
|
|
543
|
+
header: () => renderHeader(copy.columnStatus),
|
|
544
|
+
cell: ({ row }) => {
|
|
545
|
+
const url = row.original
|
|
546
|
+
if (url.verdict === 'PASS')
|
|
547
|
+
return h('span', { class: 'text-xs text-muted' }, humanize(url.verdict, verdictLabels))
|
|
548
|
+
return h(UiSeverityDot, {
|
|
549
|
+
severity: stateSeverity(url.verdict, ['PASS']),
|
|
550
|
+
label: humanize(url.verdict, verdictLabels),
|
|
551
|
+
})
|
|
552
|
+
},
|
|
553
|
+
},
|
|
554
|
+
]
|
|
555
|
+
|
|
556
|
+
cols.push({
|
|
557
|
+
accessorKey: 'coverageState',
|
|
558
|
+
header: () => renderHeader(copy.columnCoverage),
|
|
559
|
+
visibleFrom: 'md',
|
|
560
|
+
cell: ({ row }) => {
|
|
561
|
+
const url = row.original
|
|
562
|
+
return h('span', {
|
|
563
|
+
class: 'text-xs text-muted truncate block',
|
|
564
|
+
title: url.coverageState,
|
|
565
|
+
}, shortCoverage(url.coverageState))
|
|
566
|
+
},
|
|
567
|
+
})
|
|
568
|
+
|
|
569
|
+
cols.push({
|
|
570
|
+
id: 'inSitemap',
|
|
571
|
+
header: () => renderHeader(copy.columnInSitemap),
|
|
572
|
+
visibleFrom: 'md',
|
|
573
|
+
cell: ({ row }) => {
|
|
574
|
+
const member = inSitemap(row.original)
|
|
575
|
+
if (member === null)
|
|
576
|
+
return h('span', { class: 'text-xs text-dimmed' }, copy.noValue)
|
|
577
|
+
return member
|
|
578
|
+
? h('span', { class: 'text-xs text-muted' }, copy.inSitemap)
|
|
579
|
+
: h(UiSeverityDot, { severity: 'warning' as const, label: copy.notInSitemap })
|
|
580
|
+
},
|
|
581
|
+
})
|
|
582
|
+
|
|
583
|
+
cols.push({
|
|
584
|
+
accessorKey: 'lastCrawlTime',
|
|
585
|
+
header: () => renderHeader(copy.columnLastCrawl),
|
|
586
|
+
visibleFrom: 'lg',
|
|
587
|
+
cell: ({ row }) => {
|
|
588
|
+
const url = row.original
|
|
589
|
+
return h('span', { class: 'text-xs text-muted tabular-nums' }, formatDate(url.lastCrawlTime))
|
|
590
|
+
},
|
|
591
|
+
})
|
|
592
|
+
cols.push({
|
|
593
|
+
id: 'flags',
|
|
594
|
+
header: () => renderHeader(copy.columnFlags),
|
|
595
|
+
align: 'center' as const,
|
|
596
|
+
visibleFrom: 'lg',
|
|
597
|
+
cell: ({ row }) => {
|
|
598
|
+
const url = row.original
|
|
599
|
+
const flags: VNode[] = []
|
|
600
|
+
if (hasCanonicalMismatch(url)) {
|
|
601
|
+
flags.push(h('div', { class: 'size-5 rounded bg-accented flex items-center justify-center', title: copy.flagCanonicalMismatch }, [
|
|
602
|
+
h(UiIcon, { name: 'compare', class: 'size-3 text-muted' }),
|
|
603
|
+
]))
|
|
604
|
+
}
|
|
605
|
+
if (url.crawlingUserAgent === 'DESKTOP') {
|
|
606
|
+
flags.push(h('div', { class: 'size-5 rounded bg-accented flex items-center justify-center', title: copy.flagDesktopCrawl }, [
|
|
607
|
+
h(UiIcon, { name: 'monitor', class: 'size-3 text-muted' }),
|
|
608
|
+
]))
|
|
609
|
+
}
|
|
610
|
+
if (url.pageFetchState === 'SOFT_404') {
|
|
611
|
+
flags.push(h('div', { class: 'size-5 rounded bg-accented flex items-center justify-center', title: copy.flagSoft404 }, [
|
|
612
|
+
h(UiIcon, { name: 'file-x', class: 'size-3 text-muted' }),
|
|
613
|
+
]))
|
|
614
|
+
}
|
|
615
|
+
if (url.richResultsVerdict === 'PASS') {
|
|
616
|
+
flags.push(h('div', { class: 'size-5 rounded bg-accented flex items-center justify-center', title: copy.flagRichResults }, [
|
|
617
|
+
h(UiIcon, { name: 'ai', class: 'size-3 text-muted' }),
|
|
618
|
+
]))
|
|
619
|
+
}
|
|
620
|
+
flags.push(h(UiIcon, {
|
|
621
|
+
'name': 'expand',
|
|
622
|
+
'class': ['size-3.5 text-dimmed motion-safe:transition-transform motion-safe:duration-200', row.getIsExpanded() && 'rotate-180'],
|
|
623
|
+
'aria-hidden': 'true',
|
|
624
|
+
}))
|
|
625
|
+
return h('div', { class: 'flex items-center justify-center gap-1' }, flags)
|
|
626
|
+
},
|
|
627
|
+
})
|
|
628
|
+
|
|
629
|
+
return cols
|
|
630
|
+
})
|
|
631
|
+
function consolidationTargetCount(row: ConsolidationTargetRow): number {
|
|
632
|
+
return row.count
|
|
633
|
+
}
|
|
634
|
+
function richResultsTotal(row: RichResultDistributionRow): number {
|
|
635
|
+
return row.valid + row.invalid
|
|
636
|
+
}
|
|
637
|
+
function indexingUrlId(row: GscdumpIndexingUrl): string {
|
|
638
|
+
return row.url
|
|
639
|
+
}
|
|
640
|
+
</script>
|
|
641
|
+
|
|
642
|
+
<template>
|
|
643
|
+
<div class="space-y-3" data-pro-indexing-section="urls">
|
|
644
|
+
<!-- Facet panel: consolidation targets (canonical_mismatch) -->
|
|
645
|
+
<UiDataList
|
|
646
|
+
v-if="facet === 'canonical_mismatch'"
|
|
647
|
+
:title="copy.consolidationTitle"
|
|
648
|
+
icon="compare"
|
|
649
|
+
:tooltip="copy.consolidationTooltip"
|
|
650
|
+
:items="consolidationData?.consolidationTargets ?? []"
|
|
651
|
+
:loading="consolidationStatus === 'pending'"
|
|
652
|
+
:bar-value="consolidationTargetCount"
|
|
653
|
+
empty-icon="compare"
|
|
654
|
+
:empty-text="copy.consolidationEmpty"
|
|
655
|
+
>
|
|
656
|
+
<template #default="{ item }">
|
|
657
|
+
<a
|
|
658
|
+
:href="item.google_canonical"
|
|
659
|
+
target="_blank"
|
|
660
|
+
rel="noopener"
|
|
661
|
+
class="font-mono text-sm truncate text-default hover:text-primary motion-safe:transition-colors"
|
|
662
|
+
:title="item.google_canonical"
|
|
663
|
+
>{{ getPath(item.google_canonical) }}</a>
|
|
664
|
+
<span class="text-sm text-muted shrink-0">{{ fillCopy(copy.consolidationCount, { count: item.count }) }}</span>
|
|
665
|
+
</template>
|
|
666
|
+
</UiDataList>
|
|
667
|
+
|
|
668
|
+
<!-- Facet panel: rich-results distribution (sample-scoped, §5.6) -->
|
|
669
|
+
<div v-else-if="facet === 'rich_results'" class="space-y-2">
|
|
670
|
+
<div class="flex items-baseline justify-between gap-3 px-1">
|
|
671
|
+
<p class="text-mini font-semibold uppercase tracking-[0.08em] text-dimmed">
|
|
672
|
+
{{ fillCopy(copy.richResultsScope, { count: richResultsScopeCount }) }}
|
|
673
|
+
</p>
|
|
674
|
+
<p v-if="richResultsInvalidTotal" class="text-xs font-medium text-error shrink-0">
|
|
675
|
+
{{ fillCopy(copy.richResultsInvalid, { count: richResultsInvalidTotal }) }}
|
|
676
|
+
</p>
|
|
677
|
+
<p v-else class="text-xs text-muted shrink-0">
|
|
678
|
+
{{ copy.richResultsAllValid }}
|
|
679
|
+
</p>
|
|
680
|
+
</div>
|
|
681
|
+
<UiDataList
|
|
682
|
+
:items="richResultsDistribution"
|
|
683
|
+
:bar-value="richResultsTotal"
|
|
684
|
+
empty-icon="ai"
|
|
685
|
+
:empty-text="copy.richResultsEmpty"
|
|
686
|
+
>
|
|
687
|
+
<template #default="{ item }">
|
|
688
|
+
<span class="text-sm font-medium text-default truncate">{{ item.type }}</span>
|
|
689
|
+
<span class="text-sm shrink-0 tabular-nums">
|
|
690
|
+
<span class="text-muted">{{ fillCopy(copy.richResultsValidCount, { count: item.valid }) }}</span>
|
|
691
|
+
<span v-if="item.invalid" class="text-error ml-2">{{ fillCopy(copy.richResultsInvalidCount, { count: item.invalid }) }}</span>
|
|
692
|
+
</span>
|
|
693
|
+
</template>
|
|
694
|
+
</UiDataList>
|
|
695
|
+
</div>
|
|
696
|
+
|
|
697
|
+
<!-- No-facet summary line: sitemap membership of the URLs on this page. -->
|
|
698
|
+
<p v-else-if="notInSitemapCount > 0" class="text-xs text-muted px-1">
|
|
699
|
+
<span class="font-medium text-default">{{ notInSitemapCount }}</span>
|
|
700
|
+
{{ fillCopy(notInSitemapCount === 1 ? copy.notInSitemapOne : copy.notInSitemapMany, { total: displayUrls.length }) }}
|
|
701
|
+
</p>
|
|
702
|
+
|
|
703
|
+
<component
|
|
704
|
+
:is="TableShell"
|
|
705
|
+
:q="q"
|
|
706
|
+
:filter="statusFilter"
|
|
707
|
+
:filters="statusFilters"
|
|
708
|
+
:is-loading="isLoading"
|
|
709
|
+
:error="displayError"
|
|
710
|
+
:rows="displayUrls"
|
|
711
|
+
:table-data="displayUrls"
|
|
712
|
+
:total="total"
|
|
713
|
+
:page="page"
|
|
714
|
+
:page-size="pageSize"
|
|
715
|
+
:columns="columns"
|
|
716
|
+
:has-cached-data="Boolean(data)"
|
|
717
|
+
:has-external-filter="Boolean(issueFilter || facet || cohort)"
|
|
718
|
+
:show-saved-filters="false"
|
|
719
|
+
:row-id="indexingUrlId"
|
|
720
|
+
:initial-expanded-row-id="mountQuery.issue ? displayUrls[0]?.url : undefined"
|
|
721
|
+
table-size="xs"
|
|
722
|
+
:table-label="copy.tableLabel"
|
|
723
|
+
:search-placeholder="copy.searchPlaceholder"
|
|
724
|
+
empty-icon="file-search"
|
|
725
|
+
:empty-title="copy.emptyTitle"
|
|
726
|
+
:empty-default-description="copy.emptyBody"
|
|
727
|
+
:item-label="copy.itemLabel"
|
|
728
|
+
row-clickable
|
|
729
|
+
@update:q="updateSearch"
|
|
730
|
+
@update:page="updatePage"
|
|
731
|
+
@toggle-filter="toggleStatusFilter"
|
|
732
|
+
@clear-filters="clearTableFilters"
|
|
733
|
+
@retry="refresh"
|
|
734
|
+
>
|
|
735
|
+
<template #toolbar>
|
|
736
|
+
<UiSkeleton v-if="isDiagnosticsLoading" class="h-11 w-20 sm:h-7" />
|
|
737
|
+
|
|
738
|
+
<UiChip
|
|
739
|
+
v-else-if="diagnosticsData && !hasAnyIssues"
|
|
740
|
+
purpose="status"
|
|
741
|
+
status="success"
|
|
742
|
+
icon="success"
|
|
743
|
+
role="status"
|
|
744
|
+
>
|
|
745
|
+
{{ copy.noIssues }}
|
|
746
|
+
</UiChip>
|
|
747
|
+
|
|
748
|
+
<UiPopover v-else-if="hasAnyIssues" v-model:open="issuePopoverOpen">
|
|
749
|
+
<UiButton
|
|
750
|
+
purpose="secondary"
|
|
751
|
+
size="xs"
|
|
752
|
+
class="min-h-11 sm:min-h-0"
|
|
753
|
+
:aria-label="copy.issuesMenuLabel"
|
|
754
|
+
:aria-expanded="issuePopoverOpen"
|
|
755
|
+
>
|
|
756
|
+
<UiIcon name="warning" class="size-3.5" aria-hidden="true" />
|
|
757
|
+
<span>{{ copy.issuesMenu }}</span>
|
|
758
|
+
<span v-if="totalErrorCount" class="tabular-nums text-error">{{ useProHumanFriendlyNumber(totalErrorCount) }}</span>
|
|
759
|
+
<span v-else-if="totalWarningCount" class="tabular-nums text-warning">{{ useProHumanFriendlyNumber(totalWarningCount) }}</span>
|
|
760
|
+
<UiIcon
|
|
761
|
+
name="expand"
|
|
762
|
+
class="size-3 motion-safe:transition-transform motion-safe:duration-200"
|
|
763
|
+
:class="issuePopoverOpen && 'rotate-180'"
|
|
764
|
+
aria-hidden="true"
|
|
765
|
+
/>
|
|
766
|
+
</UiButton>
|
|
767
|
+
|
|
768
|
+
<template #panel>
|
|
769
|
+
<div class="max-h-80 w-72 space-y-1 overflow-y-auto p-1.5">
|
|
770
|
+
<template v-for="group in issuesBySeverity" :key="group.severity">
|
|
771
|
+
<div class="px-2 pb-1 pt-2 text-label text-dimmed">
|
|
772
|
+
<UiSeverityDot :severity="group.severity === 'error' ? 'error' : group.severity === 'warning' ? 'warning' : 'info'" :label="group.severity === 'error' ? copy.severityError : group.severity === 'warning' ? copy.severityWarning : copy.severityInfo" />
|
|
773
|
+
</div>
|
|
774
|
+
<UiButton
|
|
775
|
+
v-for="issue in group.issues"
|
|
776
|
+
:key="issue.type"
|
|
777
|
+
purpose="quiet"
|
|
778
|
+
size="sm"
|
|
779
|
+
class="min-h-11 w-full justify-start sm:min-h-0"
|
|
780
|
+
:class="isIssueActive(issue.type) && 'bg-accented'"
|
|
781
|
+
:aria-pressed="isIssueActive(issue.type)"
|
|
782
|
+
@click="handleIssueClick(issue.type)"
|
|
783
|
+
>
|
|
784
|
+
<UiIcon :name="issueIcons[issue.type] || 'caution'" class="size-3.5 shrink-0 text-dimmed" aria-hidden="true" />
|
|
785
|
+
<span class="truncate text-default" :title="issue.label">{{ issue.label }}</span>
|
|
786
|
+
<span class="ml-auto shrink-0 font-medium text-muted">{{ useProHumanFriendlyNumber(issue.count) }}</span>
|
|
787
|
+
</UiButton>
|
|
788
|
+
</template>
|
|
789
|
+
</div>
|
|
790
|
+
</template>
|
|
791
|
+
</UiPopover>
|
|
792
|
+
|
|
793
|
+
<UiButton
|
|
794
|
+
v-if="issueFilter && activeIssueData && !facet"
|
|
795
|
+
purpose="secondary"
|
|
796
|
+
size="xs"
|
|
797
|
+
class="min-h-11 sm:min-h-0"
|
|
798
|
+
:aria-label="fillCopy(copy.clearFilter, { label: activeIssueData.label })"
|
|
799
|
+
@click="handleIssueClick(activeIssueData.type)"
|
|
800
|
+
>
|
|
801
|
+
<UiIcon :name="issueIcons[activeIssueData.type] || 'caution'" class="size-3 text-muted" aria-hidden="true" />
|
|
802
|
+
{{ activeIssueData.label }}
|
|
803
|
+
<span class="text-muted">{{ useProHumanFriendlyNumber(activeIssueData.count) }}</span>
|
|
804
|
+
<UiIcon name="close" class="size-3 text-dimmed" aria-hidden="true" />
|
|
805
|
+
</UiButton>
|
|
806
|
+
|
|
807
|
+
<UiButton
|
|
808
|
+
v-if="facet"
|
|
809
|
+
purpose="secondary"
|
|
810
|
+
size="xs"
|
|
811
|
+
class="min-h-11 sm:min-h-0"
|
|
812
|
+
:aria-label="fillCopy(copy.clearFilter, { label: facetLabel })"
|
|
813
|
+
@click="clearFacet"
|
|
814
|
+
>
|
|
815
|
+
<UiIcon :name="facet === 'canonical_mismatch' ? 'compare' : 'ai'" class="size-3 text-muted" aria-hidden="true" />
|
|
816
|
+
{{ facetLabel }}
|
|
817
|
+
<UiIcon name="close" class="size-3 text-dimmed" aria-hidden="true" />
|
|
818
|
+
</UiButton>
|
|
819
|
+
|
|
820
|
+
<UiButton
|
|
821
|
+
v-if="cohort"
|
|
822
|
+
purpose="secondary"
|
|
823
|
+
size="xs"
|
|
824
|
+
class="min-h-11 sm:min-h-0"
|
|
825
|
+
:aria-label="fillCopy(copy.clearFilter, { label: cohortLabel })"
|
|
826
|
+
@click="clearCohort"
|
|
827
|
+
>
|
|
828
|
+
{{ fillCopy(copy.cohortChip, { label: cohortLabel }) }}
|
|
829
|
+
<UiIcon name="close" class="size-3 text-dimmed" aria-hidden="true" />
|
|
830
|
+
</UiButton>
|
|
831
|
+
|
|
832
|
+
<UiSyncDot v-if="fetchStatus === 'pending' && data" status="syncing" :label="copy.refreshing" />
|
|
833
|
+
</template>
|
|
834
|
+
|
|
835
|
+
<template #notices>
|
|
836
|
+
<Transition
|
|
837
|
+
enter-active-class="motion-safe:transition-[opacity,max-height] motion-safe:duration-200 motion-safe:ease-out"
|
|
838
|
+
enter-from-class="max-h-0 opacity-0"
|
|
839
|
+
enter-to-class="max-h-64 opacity-100"
|
|
840
|
+
leave-active-class="motion-safe:transition-[opacity,max-height] motion-safe:duration-150 motion-safe:ease-in"
|
|
841
|
+
leave-from-class="max-h-64 opacity-100"
|
|
842
|
+
leave-to-class="max-h-0 opacity-0"
|
|
843
|
+
mode="out-in"
|
|
844
|
+
>
|
|
845
|
+
<div
|
|
846
|
+
v-if="activeIssueData && facet !== 'canonical_mismatch'"
|
|
847
|
+
:key="activeIssueData.type"
|
|
848
|
+
class="rounded-lg border border-default bg-elevated/50 px-4 py-3"
|
|
849
|
+
>
|
|
850
|
+
<div class="flex items-start gap-2.5">
|
|
851
|
+
<UiIcon
|
|
852
|
+
:name="issueIcons[activeIssueData.type] || 'caution'"
|
|
853
|
+
class="mt-0.5 size-4 shrink-0 text-muted"
|
|
854
|
+
aria-hidden="true"
|
|
855
|
+
/>
|
|
856
|
+
<div class="min-w-0">
|
|
857
|
+
<h4 class="text-sm font-semibold">
|
|
858
|
+
{{ activeIssueData.label }}
|
|
859
|
+
</h4>
|
|
860
|
+
<p class="mt-0.5 text-sm text-muted">
|
|
861
|
+
{{ fillCopy(copy.affected, { count: useProHumanFriendlyNumber(activeIssueData.count) }) }}
|
|
862
|
+
</p>
|
|
863
|
+
<p class="mt-1.5 text-sm leading-relaxed text-muted">
|
|
864
|
+
{{ activeIssueData.description }}
|
|
865
|
+
</p>
|
|
866
|
+
<div class="mt-2 flex items-start gap-2 rounded-md bg-accented/50 p-2.5">
|
|
867
|
+
<UiIcon name="tip" class="mt-0.5 size-3.5 shrink-0 text-dimmed" aria-hidden="true" />
|
|
868
|
+
<p class="text-sm leading-relaxed text-default">
|
|
869
|
+
{{ activeIssueData.fix }}
|
|
870
|
+
</p>
|
|
871
|
+
</div>
|
|
872
|
+
</div>
|
|
873
|
+
</div>
|
|
874
|
+
</div>
|
|
875
|
+
</Transition>
|
|
876
|
+
</template>
|
|
877
|
+
|
|
878
|
+
<template #expanded-component="{ row: url }">
|
|
879
|
+
<div :key="url.url" class="idx-expanded">
|
|
880
|
+
<section
|
|
881
|
+
v-if="activeRemediation"
|
|
882
|
+
class="mb-3 border-b border-default pb-3"
|
|
883
|
+
:aria-label="copy.remediationLabel"
|
|
884
|
+
>
|
|
885
|
+
<p class="text-label">
|
|
886
|
+
{{ activeRemediation.title }}
|
|
887
|
+
</p>
|
|
888
|
+
<p class="mt-1 text-sm text-default">
|
|
889
|
+
{{ activeRemediation.detail }}
|
|
890
|
+
</p>
|
|
891
|
+
<p class="mt-2 text-sm text-muted">
|
|
892
|
+
<span class="font-medium text-default">{{ copy.why }}</span>
|
|
893
|
+
{{ activeRemediation.why }}
|
|
894
|
+
</p>
|
|
895
|
+
<UiButton
|
|
896
|
+
:href="activeRemediation.source.url"
|
|
897
|
+
target="_blank"
|
|
898
|
+
purpose="link"
|
|
899
|
+
trailing-icon="external"
|
|
900
|
+
size="xs"
|
|
901
|
+
class="mt-2 min-h-11 sm:min-h-0"
|
|
902
|
+
>
|
|
903
|
+
{{ activeRemediation.source.label }}
|
|
904
|
+
</UiButton>
|
|
905
|
+
</section>
|
|
906
|
+
<!-- Crawl pipeline -->
|
|
907
|
+
<IndexingCrawlPipeline
|
|
908
|
+
class="mb-3"
|
|
909
|
+
variant="inline"
|
|
910
|
+
:steps="[
|
|
911
|
+
{ label: copy.stageRobots, status: stateSeverity(url.robotsTxtState, ['ALLOWED']), value: humanize(url.robotsTxtState, robotsTxtStateLabels) },
|
|
912
|
+
{ label: copy.stageFetch, status: stateSeverity(url.pageFetchState, ['SUCCESSFUL']), value: humanize(url.pageFetchState, pageFetchStateLabels) },
|
|
913
|
+
{ label: copy.stageIndexing, status: stateSeverity(url.indexingState, ['INDEXING_ALLOWED']), value: humanize(url.indexingState, indexingStateLabels) },
|
|
914
|
+
{ label: copy.stageVerdict, status: stateSeverity(url.verdict, ['PASS']), value: humanize(url.verdict, verdictLabels) },
|
|
915
|
+
]"
|
|
916
|
+
/>
|
|
917
|
+
|
|
918
|
+
<!-- Coverage reason -->
|
|
919
|
+
<div
|
|
920
|
+
v-if="url.coverageState"
|
|
921
|
+
class="idx-coverage"
|
|
922
|
+
:class="url.verdict === 'PASS' ? 'idx-coverage--pass' : 'idx-coverage--issue'"
|
|
923
|
+
>
|
|
924
|
+
<UiIcon name="note" class="size-3 shrink-0 mt-px text-dimmed" />
|
|
925
|
+
<span class="text-xs" :class="url.verdict === 'PASS' ? 'text-muted' : 'text-default'">{{ url.coverageState }}</span>
|
|
926
|
+
</div>
|
|
927
|
+
|
|
928
|
+
<!-- Detail grid -->
|
|
929
|
+
<div class="idx-detail-grid">
|
|
930
|
+
<!-- Crawler -->
|
|
931
|
+
<div class="idx-detail">
|
|
932
|
+
<span class="idx-detail-label">{{ copy.detailCrawler }}</span>
|
|
933
|
+
<span class="text-xs text-muted">{{ humanize(url.crawlingUserAgent ?? '', crawlerLabels) }}</span>
|
|
934
|
+
</div>
|
|
935
|
+
|
|
936
|
+
<!-- Last crawl -->
|
|
937
|
+
<div class="idx-detail">
|
|
938
|
+
<span class="idx-detail-label">{{ copy.detailLastCrawl }}</span>
|
|
939
|
+
<span class="text-xs font-medium text-default">{{ formatFullDate(url.lastCrawlTime) }}</span>
|
|
940
|
+
</div>
|
|
941
|
+
|
|
942
|
+
<!-- Checks -->
|
|
943
|
+
<div class="idx-detail">
|
|
944
|
+
<span class="idx-detail-label">{{ copy.detailChecks }}</span>
|
|
945
|
+
<span class="text-xs text-muted">{{ url.checkCount }}</span>
|
|
946
|
+
</div>
|
|
947
|
+
|
|
948
|
+
<!-- Rich Results -->
|
|
949
|
+
<div v-if="url.richResultsVerdict && !url.richResultsVerdict.includes('UNSPECIFIED')" class="idx-detail">
|
|
950
|
+
<span class="idx-detail-label">{{ copy.detailRichResults }}</span>
|
|
951
|
+
<div class="flex flex-wrap items-center gap-1.5">
|
|
952
|
+
<UiSeverityDot :severity="stateSeverity(url.richResultsVerdict, ['PASS'])" :label="humanize(url.richResultsVerdict, verdictLabels)" />
|
|
953
|
+
<span
|
|
954
|
+
v-for="item in (url.richResultsItems || [])"
|
|
955
|
+
:key="item.richResultType"
|
|
956
|
+
class="idx-chip"
|
|
957
|
+
>
|
|
958
|
+
{{ item.richResultType }}
|
|
959
|
+
</span>
|
|
960
|
+
</div>
|
|
961
|
+
</div>
|
|
962
|
+
</div>
|
|
963
|
+
|
|
964
|
+
<!-- Canonicals -->
|
|
965
|
+
<div v-if="url.userCanonical || url.googleCanonical" class="idx-canonicals">
|
|
966
|
+
<div class="idx-detail">
|
|
967
|
+
<span class="idx-detail-label">{{ copy.detailCanonical }}</span>
|
|
968
|
+
<span class="text-xs text-muted font-mono truncate" :title="url.userCanonical || undefined">
|
|
969
|
+
{{ url.userCanonical ? getPath(url.userCanonical) : copy.noValue }}
|
|
970
|
+
</span>
|
|
971
|
+
</div>
|
|
972
|
+
<div v-if="hasCanonicalMismatch(url)" class="idx-detail">
|
|
973
|
+
<span class="idx-detail-label">{{ copy.detailGoogleCanonical }}</span>
|
|
974
|
+
<span class="text-xs font-mono truncate text-warning" :title="url.googleCanonical || undefined">
|
|
975
|
+
{{ url.googleCanonical ? canonicalDisplayLabel(url.googleCanonical, url.canonicalMismatchKind) : copy.noValue }}
|
|
976
|
+
<span class="idx-chip text-warning ml-1">{{ copy.detailMismatch }}</span>
|
|
977
|
+
</span>
|
|
978
|
+
</div>
|
|
979
|
+
</div>
|
|
980
|
+
|
|
981
|
+
<!-- Actions -->
|
|
982
|
+
<div class="flex flex-wrap items-center gap-2 mt-4 pt-3 border-t border-default">
|
|
983
|
+
<UiButton
|
|
984
|
+
:href="url.url"
|
|
985
|
+
target="_blank"
|
|
986
|
+
size="xs"
|
|
987
|
+
class="min-h-11 sm:min-h-0"
|
|
988
|
+
purpose="secondary"
|
|
989
|
+
icon="external"
|
|
990
|
+
:label="copy.openUrl"
|
|
991
|
+
/>
|
|
992
|
+
<UiButton
|
|
993
|
+
:href="gscConsoleUrl({ siteLabel: indexingGscSiteLabel, resource: 'url-inspection', page: url.url })"
|
|
994
|
+
target="_blank"
|
|
995
|
+
size="xs"
|
|
996
|
+
class="min-h-11 sm:min-h-0"
|
|
997
|
+
purpose="secondary"
|
|
998
|
+
icon="search"
|
|
999
|
+
:label="copy.inspectInGsc"
|
|
1000
|
+
/>
|
|
1001
|
+
<UiButton
|
|
1002
|
+
v-if="inspectUrls"
|
|
1003
|
+
size="xs"
|
|
1004
|
+
class="min-h-11 sm:min-h-0"
|
|
1005
|
+
purpose="secondary"
|
|
1006
|
+
:icon="inflightUrls.has(url.url) ? 'loading' : 'refresh'"
|
|
1007
|
+
:label="inflightUrls.has(url.url) ? copy.rechecking : copy.recheck"
|
|
1008
|
+
:disabled="inflightUrls.has(url.url) || inspectBudgetRemaining === 0"
|
|
1009
|
+
v-bind="{ title: recheckTitle }"
|
|
1010
|
+
@click="handleReinspect(url)"
|
|
1011
|
+
/>
|
|
1012
|
+
</div>
|
|
1013
|
+
</div>
|
|
1014
|
+
</template>
|
|
1015
|
+
</component>
|
|
1016
|
+
</div>
|
|
1017
|
+
</template>
|
|
1018
|
+
|
|
1019
|
+
<style scoped>
|
|
1020
|
+
.idx-chip {
|
|
1021
|
+
display: inline-flex;
|
|
1022
|
+
align-items: center;
|
|
1023
|
+
padding: 0.125rem 0.375rem;
|
|
1024
|
+
border-radius: 0.25rem;
|
|
1025
|
+
font-size: 11px;
|
|
1026
|
+
color: var(--ui-text-muted);
|
|
1027
|
+
background: var(--ui-bg-accented);
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
.idx-expanded {
|
|
1031
|
+
padding: 1rem 1.25rem;
|
|
1032
|
+
border-radius: 0.5rem;
|
|
1033
|
+
background: color-mix(in srgb, var(--ui-bg-elevated) 20%, transparent);
|
|
1034
|
+
border: 1px solid color-mix(in srgb, var(--ui-border) 20%, transparent);
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
.idx-coverage {
|
|
1038
|
+
display: flex;
|
|
1039
|
+
align-items: flex-start;
|
|
1040
|
+
gap: 0.375rem;
|
|
1041
|
+
padding: 0.5rem 0.625rem;
|
|
1042
|
+
border-radius: 0.375rem;
|
|
1043
|
+
margin-bottom: 0.75rem;
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
.idx-coverage--pass {
|
|
1047
|
+
background: color-mix(in srgb, var(--color-success-400) 5%, transparent);
|
|
1048
|
+
border: 1px solid color-mix(in srgb, var(--color-success-400) 10%, transparent);
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
.idx-coverage--issue {
|
|
1052
|
+
background: color-mix(in srgb, var(--color-warning-500) 5%, transparent);
|
|
1053
|
+
border: 1px solid color-mix(in srgb, var(--color-warning-500) 10%, transparent);
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
.idx-detail-grid {
|
|
1057
|
+
display: grid;
|
|
1058
|
+
grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
|
|
1059
|
+
gap: 0.625rem 1.5rem;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
.idx-detail {
|
|
1063
|
+
display: flex;
|
|
1064
|
+
flex-direction: column;
|
|
1065
|
+
gap: 0.125rem;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
.idx-detail-label {
|
|
1069
|
+
font-size: 10px;
|
|
1070
|
+
font-weight: 500;
|
|
1071
|
+
text-transform: uppercase;
|
|
1072
|
+
letter-spacing: 0.04em;
|
|
1073
|
+
color: var(--ui-text-dimmed);
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
.idx-canonicals {
|
|
1077
|
+
display: flex;
|
|
1078
|
+
flex-direction: column;
|
|
1079
|
+
gap: 0.375rem;
|
|
1080
|
+
margin-top: 0.75rem;
|
|
1081
|
+
padding-top: 0.75rem;
|
|
1082
|
+
border-top: 1px solid color-mix(in srgb, var(--ui-border) 30%, transparent);
|
|
1083
|
+
}
|
|
1084
|
+
</style>
|