@nuxtseo/pro-indexing 0.1.7 → 0.1.9
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 +37 -4
- package/app/components/IndexingCrawlPipeline.vue +2 -2
- package/app/components/IndexingPortfolioChanges.vue +35 -42
- package/app/components/IndexingSubmissionTimeline.vue +104 -0
- package/app/components/IndexingSubmissionsCard.vue +222 -0
- package/app/components/IndexingSubmissionsCell.vue +40 -0
- package/app/components/IndexingUrlsTable.vue +21 -2
- package/package.json +7 -7
- package/shared/changes.ts +43 -30
- package/shared/copy.ts +62 -10
- package/shared/source.ts +19 -0
- package/shared/submissions.ts +221 -0
package/README.md
CHANGED
|
@@ -9,6 +9,7 @@ The dashboard indexing sections that nuxtseo.com, gscdump.com and Request Indexi
|
|
|
9
9
|
- Portfolio Issues (`IndexingPortfolioIssues`) and Portfolio Changes (`IndexingPortfolioChanges`).
|
|
10
10
|
- The per-Site indexing overview parts: the diagnosis panel (`IndexingDiagnosisPanel`), the coverage trend (`IndexingCoverageTrend`), and Index cohorts (`IndexingCohortList`).
|
|
11
11
|
- The indexing URLs table (`IndexingUrlsTable`) and its crawl stages strip (`IndexingCrawlPipeline`).
|
|
12
|
+
- Submissions: the "Sent to search engines" card (`IndexingSubmissionsCard`), the URL Submission timeline (`IndexingSubmissionTimeline`, inside the URLs table detail), and the Sites list cell (`IndexingSubmissionsCell`).
|
|
12
13
|
- The capability gate for features a site draws itself (`IndexingCapabilityGate`).
|
|
13
14
|
- The `IndexingSource` contract, the route map (`proIndexing.routes`), and the copy (`proIndexing.copy`).
|
|
14
15
|
|
|
@@ -16,7 +17,7 @@ The dashboard indexing sections that nuxtseo.com, gscdump.com and Request Indexi
|
|
|
16
17
|
- Data. Every read goes through the site's `IndexingSource`. Portfolio sections take the scope's Sites as props.
|
|
17
18
|
- The diagnosis. `diagnoseIndexing` reads Crawl evidence, so the site passes it as the `diagnose` capability.
|
|
18
19
|
- Its Site list. The per-Site rows of the Portfolio Overview stay in the site's own list; they read `buildPortfolioOverview`.
|
|
19
|
-
- Page files, tabs, date pickers, eject and MCP chrome, IndexNow and Watched URLs panels, and any server code (ADR-0042, ADR-0167).
|
|
20
|
+
- Page files, tabs, date pickers, eject and MCP chrome, IndexNow and Watched URLs panels, and any server code (ADR-0042, ADR-0167). The IndexNow key setup, the send form, the Automatic sending switch and the receipt list stay the site's; the Submissions card counts what they sent.
|
|
20
21
|
|
|
21
22
|
## Rules
|
|
22
23
|
|
|
@@ -44,7 +45,7 @@ export default defineNuxtConfig({
|
|
|
44
45
|
```
|
|
45
46
|
|
|
46
47
|
- 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`, `shared/urls-query`.
|
|
48
|
+
- Import the pure modules by path: `@nuxtseo/pro-indexing/shared/source`, `shared/portfolio`, `shared/portfolio-overview`, `shared/changes`, `shared/submissions`, `shared/routes`, `shared/copy`, `shared/config`, `shared/urls-query`.
|
|
48
49
|
|
|
49
50
|
### IndexingSource
|
|
50
51
|
|
|
@@ -76,6 +77,9 @@ interface IndexingSource {
|
|
|
76
77
|
cohorts?: (site) => IndexingRead<IndexCohortsResponse>
|
|
77
78
|
sitemapProblems?: () => IndexingRead<{ unreachable: readonly string[], errors: readonly string[] }>
|
|
78
79
|
changesRollup?: () => IndexingRead<IndexingChangesRollup>
|
|
80
|
+
submissions?: (site) => IndexingRead<IndexingSubmissionSummary>
|
|
81
|
+
submissionOutcomes?: (site, params: MaybeRefOrGetter<IndexingSubmissionOutcomesParams>) => IndexingRead<IndexingSubmissionOutcomes>
|
|
82
|
+
submissionsRollup?: () => IndexingRead<IndexingSubmissionsRollup>
|
|
79
83
|
indexNow?: true
|
|
80
84
|
watchedUrls?: true
|
|
81
85
|
cohortFilter?: true // the urls read honours params.cohort
|
|
@@ -98,7 +102,10 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
98
102
|
| `canonicalMismatches` | URLs table: consolidation targets on the `canonical_mismatch` facet |
|
|
99
103
|
| `cohorts` | `IndexingCohortList` |
|
|
100
104
|
| `sitemapProblems` | Portfolio Overview: the Sitemap problems tile |
|
|
101
|
-
| `changesRollup` | `IndexingPortfolioChanges` |
|
|
105
|
+
| `changesRollup` | `IndexingPortfolioChanges`. Each row counts URL Inspection `indexStatus` changes for one Site on one UTC day: `indexed` (to `PASS`) and `dropped` (from `PASS`). Count a change only between two verdicts, never from or to null, and date it by `changedBefore` |
|
|
106
|
+
| `submissions` | `IndexingSubmissionsCard`: URLs sent per engine over 30 days, their Submission Receipts and triggers, and Automatic sending |
|
|
107
|
+
| `submissionOutcomes` | `IndexingSubmissionsCard`: "Afterwards in Google". `IndexingUrlsTable`: the URL Submission timeline in each URL's detail |
|
|
108
|
+
| `submissionsRollup` | `IndexingSubmissionsCell`, one read for every Site in the site's Sites list |
|
|
102
109
|
| `indexNow`, `watchedUrls` | `IndexingCapabilityGate` around the site's own panel |
|
|
103
110
|
| `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 |
|
|
104
111
|
|
|
@@ -141,6 +148,29 @@ const entries = computed<IndexingPortfolioEntry[]>(() => sites.value.map(site =>
|
|
|
141
148
|
|
|
142
149
|
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).
|
|
143
150
|
|
|
151
|
+
### Submissions
|
|
152
|
+
|
|
153
|
+
A Submission is a notification a Site sent to a search engine, through IndexNow or Google's Indexing API. The section answers "what did sending do?" with three rules: an accepted Submission Receipt proves receipt only, "Afterwards" is order in time and never cause, and no string states an indexing timeframe. The shapes live in `shared/submissions.ts`. Outcomes anchor where gscdump's `listSiteSubmissionOutcomes` anchors them. The summary counts differently from `getSiteSubmissionSummary`: gscdump adds up every receipt, so a URL sent twice counts twice. The section counts each URL once per engine, by its latest Submission Receipt. gscdump's summary cannot say which URLs repeat, so build `IndexingSubmissionSummary` from the receipt lists.
|
|
154
|
+
|
|
155
|
+
```vue
|
|
156
|
+
<IndexingSubmissionsCard :site="site">
|
|
157
|
+
<!-- Optional: the site's own Automatic sending switch, beside the state. -->
|
|
158
|
+
<template #automatic="{ state }">
|
|
159
|
+
<MyAutomaticSendingSwitch :on="state._tag !== 'off'" />
|
|
160
|
+
</template>
|
|
161
|
+
</IndexingSubmissionsCard>
|
|
162
|
+
|
|
163
|
+
<!-- In the site's own Sites table, under a "Submissions" heading (copy.submissions.columnTitle). -->
|
|
164
|
+
<IndexingSubmissionsCell :site="site" />
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
- `IndexingSubmissionSummary` counts distinct URLs per engine. Each URL counts once per engine, by its latest Submission Receipt. List only the engines the site can send to, even with no URL sent; never add an engine at zero.
|
|
168
|
+
- `completeness: { _tag: 'partial', receipts }` says the source stopped reading Submission Receipts before the window start. The card says how many it counted.
|
|
169
|
+
- `IndexingSubmissionOutcomes` joins each sent URL to Google's latest URL Inspection result from a check made after the URL's newest Submission in the window that the engine received: IndexNow at HTTP 200 or HTTP 202, or Google accepted. This matches gscdump's `listSiteSubmissionOutcomes`. A result checked before it reads `not-inspected`. A URL that no engine received stays out of the totals. A source may still return its row, anchored on its newest Submission, so the timeline shows the Submission that failed. `checked` below `sent` says the totals cover fewer URLs than the Site sent, for example when the source caps its lookups or no engine received some URLs. The source never starts a URL Inspection for this read.
|
|
170
|
+
- `automaticSending` is null when the Site has no IndexNow key. `key-unverified` is the switch on while the key file needs verification.
|
|
171
|
+
- The URLs table calls `submissionOutcomes(site, { url })` when a person opens a URL's detail, and draws the row whose URL matches, ignoring a trailing slash. Return only that URL's row. The card calls it once with `{ limit: 0 }` for the totals.
|
|
172
|
+
- `IndexingSubmissionsCell` calls `submissionsRollup()` in each row, so the source must return one shared read, keyed once for the scope, such as a query composable that dedupes by key. Leave the capability out rather than reading once per Site.
|
|
173
|
+
|
|
144
174
|
### Route map
|
|
145
175
|
|
|
146
176
|
Each site maps the sections' logical routes under `proIndexing.routes` in `app.config.ts`. A Site route holds the shell's `[site]` token, filled with `IndexingSite.ref`.
|
|
@@ -171,7 +201,7 @@ nuxtseo.com sets its map in `apps/pro/app/pro-indexing.ts` and its source in `la
|
|
|
171
201
|
|
|
172
202
|
### Copy
|
|
173
203
|
|
|
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.
|
|
204
|
+
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`, `submissions` (the Submissions card, timeline and cell), `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. A site that rewords `submissions.automaticLastCheck` also rewords `submissions.automaticLastCheckOne`, the line for one changed URL.
|
|
175
205
|
|
|
176
206
|
### Indexed tile tone
|
|
177
207
|
|
|
@@ -215,6 +245,7 @@ export function useAppIndexingSource(): IndexingSource {
|
|
|
215
245
|
| Index cohorts | yes, built from inspected URLs |
|
|
216
246
|
| URLs table | yes, no re-inspect, no rich results facet |
|
|
217
247
|
| Sitemap problems tile, IndexNow | off (no probe; dropped in #345) |
|
|
248
|
+
| Submissions card, timeline, cell | off. Its dashboard dropped IndexNow (#345); Submissions reach gscdump.com users through MCP and the API |
|
|
218
249
|
|
|
219
250
|
### Adopting on Request Indexing
|
|
220
251
|
|
|
@@ -244,6 +275,8 @@ export function useRiIndexingSource(): IndexingSource {
|
|
|
244
275
|
| URLs table with re-inspect | yes |
|
|
245
276
|
| Sitemap problems tile | yes, from its probe |
|
|
246
277
|
| Watched URLs | its own panel inside `IndexingCapabilityGate capability="watchedUrls"` |
|
|
278
|
+
| Submissions card and URL timeline | yes, from `getSiteSubmissionSummary` and `listSiteSubmissionOutcomes`, with its Automatic sending switch in the `#automatic` slot. Until those operations ship, build both from its IndexNow and Google receipt lists, as nuxtseo.com does |
|
|
279
|
+
| Submissions cell | once a fleet read exists (`submissionsRollup`) |
|
|
247
280
|
|
|
248
281
|
## Releasing
|
|
249
282
|
|
|
@@ -164,9 +164,9 @@ const statusSparklineColors: Record<StepStatus, string> = {
|
|
|
164
164
|
/* ─── Inline variant ─── */
|
|
165
165
|
.inline-pipeline {
|
|
166
166
|
display: flex;
|
|
167
|
+
flex-wrap: wrap;
|
|
167
168
|
align-items: flex-start;
|
|
168
|
-
gap: 0.375rem;
|
|
169
|
-
overflow-x: auto;
|
|
169
|
+
gap: 0.25rem 0.375rem;
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
.inline-step {
|
|
@@ -10,7 +10,7 @@ import { VisAxis, VisCrosshair, VisLine, VisStackedBar, VisTooltip, VisXYContain
|
|
|
10
10
|
import { useElementSize } from '@vueuse/core'
|
|
11
11
|
import { computed, useTemplateRef } from 'vue'
|
|
12
12
|
import { ClientOnly, NuxtLink, UiAlert, UiButton, UiEmptyState, UiFavicon, UiIcon, UiSkeleton, UiTableShell, UiTableTd, UiTableTh, UiTooltip, UiWidgetState } from '#components'
|
|
13
|
-
import { summarizeIndexingChanges } from '../../shared/changes'
|
|
13
|
+
import { countAxisTicks, summarizeIndexingChanges } from '../../shared/changes'
|
|
14
14
|
import { hasCoverageObservation, isEntryPending, portfolioFetchState } from '../../shared/portfolio'
|
|
15
15
|
import { useIndexingSource } from '../composables/useIndexingSource'
|
|
16
16
|
import { useProIndexingCopy } from '../composables/useProIndexingCopy'
|
|
@@ -63,35 +63,24 @@ const isCollecting = computed(() => rollupSettled.value && !siteRows.value.lengt
|
|
|
63
63
|
const isWithheld = computed(() => rollupSettled.value && !siteRows.value.length && fetchState.value.failed.length > 0)
|
|
64
64
|
|
|
65
65
|
const CHART_HEIGHT = 200
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
//
|
|
70
|
-
const
|
|
71
|
-
const
|
|
66
|
+
const INDEXED_LABEL = copy.changes.newlyIndexed
|
|
67
|
+
const DROPPED_LABEL = copy.changes.dropped
|
|
68
|
+
const INSPECTION_SOURCE = copy.changes.inspectionSource
|
|
69
|
+
// Gains above the zero line in the indexed green, losses below in the not-indexed amber.
|
|
70
|
+
const indexedColor = indexingVizColors.indexed
|
|
71
|
+
const droppedColor = indexingVizColors.notIndexed
|
|
72
72
|
|
|
73
73
|
const x = (_d: IndexingChangesDay, index: number) => index
|
|
74
|
-
const y = [(d: IndexingChangesDay) => d.
|
|
75
|
-
const barColors = [
|
|
74
|
+
const y = [(d: IndexingChangesDay) => d.indexed, (d: IndexingChangesDay) => -d.dropped]
|
|
75
|
+
const barColors = [indexedColor.color, droppedColor.color]
|
|
76
76
|
const zeroLine = () => 0
|
|
77
77
|
|
|
78
78
|
const xDomain = computed<[number, number]>(() => [-0.5, Math.max(days.value.length - 1, 0) + 0.5])
|
|
79
79
|
const yDomain = computed<[number, number]>(() => [
|
|
80
|
-
-Math.max(...days.value.map(day => day.
|
|
81
|
-
Math.max(...days.value.map(day => day.
|
|
80
|
+
-Math.max(...days.value.map(day => day.dropped), 0),
|
|
81
|
+
Math.max(...days.value.map(day => day.indexed), 1),
|
|
82
82
|
])
|
|
83
|
-
|
|
84
|
-
// 1, 2, or 5 multiple of a power of 10, and never below 1.
|
|
85
|
-
const yTickValues = computed(() => {
|
|
86
|
-
const [min, max] = yDomain.value
|
|
87
|
-
const raw = (max - min) / 4
|
|
88
|
-
const power = 10 ** Math.floor(Math.log10(raw))
|
|
89
|
-
const step = Math.max(1, [1, 2, 5, 10].find(factor => factor * power >= raw)! * power)
|
|
90
|
-
const ticks: number[] = []
|
|
91
|
-
for (let value = Math.ceil(min / step) * step; value <= max; value += step)
|
|
92
|
-
ticks.push(value)
|
|
93
|
-
return ticks
|
|
94
|
-
})
|
|
83
|
+
const yTickValues = computed(() => countAxisTicks(yDomain.value))
|
|
95
84
|
|
|
96
85
|
const plotEl = useTemplateRef<HTMLElement>('plotEl')
|
|
97
86
|
const { width: plotWidth } = useElementSize(plotEl)
|
|
@@ -116,8 +105,8 @@ function crosshairTemplate(d: IndexingChangesDay): string {
|
|
|
116
105
|
</div>`
|
|
117
106
|
return `<div style="display:flex;flex-direction:column;gap:4px;min-width:140px;padding:2px">
|
|
118
107
|
<div style="color:var(--ui-text-dimmed);font-size:12px">${dayLabel(d.day)}</div>
|
|
119
|
-
${row(
|
|
120
|
-
${row(
|
|
108
|
+
${row(INDEXED_LABEL, d.indexed, indexedColor.color)}
|
|
109
|
+
${row(DROPPED_LABEL, d.dropped, droppedColor.color)}
|
|
121
110
|
</div>`
|
|
122
111
|
}
|
|
123
112
|
|
|
@@ -177,12 +166,12 @@ function retryFailed() {
|
|
|
177
166
|
</p>
|
|
178
167
|
<ul class="flex flex-wrap gap-x-3 gap-y-1" :aria-label="copy.changes.legendLabel">
|
|
179
168
|
<li class="flex items-center gap-1.5 text-xs text-muted">
|
|
180
|
-
<span class="size-2 shrink-0 rounded-full" :class="
|
|
181
|
-
{{
|
|
169
|
+
<span class="size-2 shrink-0 rounded-full" :class="indexedColor.dot" aria-hidden="true" />
|
|
170
|
+
{{ INDEXED_LABEL }}
|
|
182
171
|
</li>
|
|
183
172
|
<li class="flex items-center gap-1.5 text-xs text-muted">
|
|
184
|
-
<span class="size-2 shrink-0 rounded-full" :class="
|
|
185
|
-
{{
|
|
173
|
+
<span class="size-2 shrink-0 rounded-full" :class="droppedColor.dot" aria-hidden="true" />
|
|
174
|
+
{{ DROPPED_LABEL }}
|
|
186
175
|
</li>
|
|
187
176
|
</ul>
|
|
188
177
|
|
|
@@ -224,6 +213,10 @@ function retryFailed() {
|
|
|
224
213
|
</template>
|
|
225
214
|
</ClientOnly>
|
|
226
215
|
</div>
|
|
216
|
+
<!-- Visible, not a tooltip: a bar's day can trail the change by months. -->
|
|
217
|
+
<p class="text-xs text-muted" data-changes-note>
|
|
218
|
+
{{ copy.changes.checkDates }}
|
|
219
|
+
</p>
|
|
227
220
|
|
|
228
221
|
<div class="sr-only">
|
|
229
222
|
<!-- eslint-disable-next-line vue/no-restricted-syntax -- The hidden chart equivalent is the documented raw-table exception. -->
|
|
@@ -235,10 +228,10 @@ function retryFailed() {
|
|
|
235
228
|
{{ copy.changes.day }}
|
|
236
229
|
</th>
|
|
237
230
|
<th scope="col">
|
|
238
|
-
{{
|
|
231
|
+
{{ INDEXED_LABEL }}
|
|
239
232
|
</th>
|
|
240
233
|
<th scope="col">
|
|
241
|
-
{{
|
|
234
|
+
{{ DROPPED_LABEL }}
|
|
242
235
|
</th>
|
|
243
236
|
</tr>
|
|
244
237
|
</thead>
|
|
@@ -247,31 +240,31 @@ function retryFailed() {
|
|
|
247
240
|
<th scope="row">
|
|
248
241
|
{{ dayLabel(day.day) }}
|
|
249
242
|
</th>
|
|
250
|
-
<td>{{ formatNumber(day.
|
|
251
|
-
<td>{{ formatNumber(day.
|
|
243
|
+
<td>{{ formatNumber(day.indexed) }}</td>
|
|
244
|
+
<td>{{ formatNumber(day.dropped) }}</td>
|
|
252
245
|
</tr>
|
|
253
246
|
</tbody>
|
|
254
247
|
</table>
|
|
255
248
|
</div>
|
|
256
249
|
</section>
|
|
257
250
|
|
|
258
|
-
<!-- Below sm the cells pad less, the Site name truncates, and the
|
|
259
|
-
headers wrap, so Site, Change,
|
|
251
|
+
<!-- Below sm the cells pad less, the Site name truncates, and the inspection
|
|
252
|
+
headers wrap, so Site, Change, Newly indexed, and Dropped from index fit 375px. -->
|
|
260
253
|
<UiTableShell :label="copy.changes.tableLabel" size="xs" bordered row-hover>
|
|
261
254
|
<template #head>
|
|
262
255
|
<UiTableTh no-padding class="px-1.5 py-2.5 sm:px-3">
|
|
263
256
|
{{ copy.changes.site }}
|
|
264
257
|
</UiTableTh>
|
|
265
258
|
<UiTableTh numeric visible-from="sm">
|
|
266
|
-
{{ copy.changes.
|
|
259
|
+
{{ copy.changes.indexed }}
|
|
267
260
|
</UiTableTh>
|
|
268
261
|
<UiTableTh numeric no-padding class="px-1.5 py-2.5 sm:px-3">
|
|
269
262
|
{{ copy.changes.change }}
|
|
270
263
|
</UiTableTh>
|
|
271
264
|
<!-- The label variant's (?) trigger is 24px and the primitive fixes its
|
|
272
265
|
size, so the whole header is the trigger: 44px tall on mobile. -->
|
|
273
|
-
<UiTableTh v-for="label in [
|
|
274
|
-
<UiTooltip :title="label" :description="
|
|
266
|
+
<UiTableTh v-for="label in [INDEXED_LABEL, DROPPED_LABEL]" :key="label" numeric no-padding class="px-1.5 py-1 sm:px-3 sm:py-2.5">
|
|
267
|
+
<UiTooltip :title="label" :description="INSPECTION_SOURCE" trigger-as="button">
|
|
275
268
|
<span class="text-label inline-flex min-h-11 sm:min-h-0 items-center gap-1 whitespace-normal text-right sm:whitespace-nowrap">
|
|
276
269
|
{{ label }}
|
|
277
270
|
<UiIcon name="life-buoy" class="size-3 shrink-0 text-dimmed" aria-hidden="true" />
|
|
@@ -293,24 +286,24 @@ function retryFailed() {
|
|
|
293
286
|
<UiTableTd size="xs" numeric visible-from="sm">
|
|
294
287
|
<UiSkeleton v-if="!row.level && isRowPending(row.siteId)" class="ml-auto h-5" :index="1" :base="40" :range="0" />
|
|
295
288
|
<template v-else>
|
|
296
|
-
{{ row.level ? formatNumber(row.level.
|
|
289
|
+
{{ row.level ? formatNumber(row.level.indexed) : '—' }}
|
|
297
290
|
</template>
|
|
298
291
|
</UiTableTd>
|
|
299
292
|
<UiTableTd size="xs" numeric no-padding class="px-1.5 sm:px-3">
|
|
300
293
|
<UiSkeleton v-if="!row.level && isRowPending(row.siteId)" class="ml-auto h-5" :index="2" :base="48" :range="0" />
|
|
301
294
|
<span v-else-if="row.level" class="inline-flex flex-col items-end sm:flex-row sm:items-baseline sm:gap-1.5">
|
|
302
295
|
<span v-if="sinceLabel(row.level.since)" class="text-xs text-dimmed">{{ sinceLabel(row.level.since) }}</span>
|
|
303
|
-
<span class="font-medium" :class="row.level.change
|
|
296
|
+
<span class="font-medium" :class="row.level.change < 0 ? 'text-warning' : ''">{{ changeFormat.format(row.level.change) }}</span>
|
|
304
297
|
</span>
|
|
305
298
|
<template v-else>
|
|
306
299
|
—
|
|
307
300
|
</template>
|
|
308
301
|
</UiTableTd>
|
|
309
302
|
<UiTableTd size="xs" numeric no-padding class="px-1.5 sm:px-3">
|
|
310
|
-
{{ formatNumber(row.
|
|
303
|
+
{{ formatNumber(row.indexed) }}
|
|
311
304
|
</UiTableTd>
|
|
312
305
|
<UiTableTd size="xs" numeric no-padding class="px-1.5 sm:px-3">
|
|
313
|
-
{{ formatNumber(row.
|
|
306
|
+
{{ formatNumber(row.dropped) }}
|
|
314
307
|
</UiTableTd>
|
|
315
308
|
</tr>
|
|
316
309
|
</UiTableShell>
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import type { IndexingSite } from '../../shared/source'
|
|
3
|
+
import type { IndexingSubmissionEvent } from '../../shared/submissions'
|
|
4
|
+
import { fillCopy } from '@nuxtseo/pro-shell/shared/copy'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
import { formatSubmissionDate, submissionTimeline } from '../../shared/submissions'
|
|
7
|
+
import { useIndexingSource } from '../composables/useIndexingSource'
|
|
8
|
+
import { useProIndexingCopy } from '../composables/useProIndexingCopy'
|
|
9
|
+
|
|
10
|
+
// One URL's Submission timeline: each time it was sent, then Google's crawl
|
|
11
|
+
// and Google's URL Inspection result, each dated, oldest first. Reads the
|
|
12
|
+
// `submissionOutcomes` capability filtered to this URL. Without it, or for a
|
|
13
|
+
// URL never sent in the window, it renders nothing.
|
|
14
|
+
//
|
|
15
|
+
// Events sort by date, so a crawl before the first Submission shows before it.
|
|
16
|
+
// Google's result is dated by the check that found it, never by when indexing
|
|
17
|
+
// happened, and the list never says sending caused it.
|
|
18
|
+
|
|
19
|
+
const { site, url } = defineProps<{
|
|
20
|
+
site: IndexingSite | null | undefined
|
|
21
|
+
url: string
|
|
22
|
+
}>()
|
|
23
|
+
|
|
24
|
+
const source = useIndexingSource()
|
|
25
|
+
const copy = useProIndexingCopy()
|
|
26
|
+
const text = copy.submissions
|
|
27
|
+
const read = source?.submissionOutcomes?.(() => site, () => ({ url })) ?? null
|
|
28
|
+
|
|
29
|
+
// The source may store the URL with or without a trailing slash, so match
|
|
30
|
+
// across it. Never take a row for another URL: the timeline does not print it.
|
|
31
|
+
const withoutSlash = (value: string) => value.replace(/\/$/, '')
|
|
32
|
+
const outcome = computed(() => read?.data.value?.outcomes.find(row => withoutSlash(row.url) === withoutSlash(url)) ?? null)
|
|
33
|
+
const events = computed(() => outcome.value ? submissionTimeline(outcome.value) : [])
|
|
34
|
+
|
|
35
|
+
const ENGINE_LABEL = { indexnow: text.engineIndexNow, google: text.engineGoogle } as const
|
|
36
|
+
const RECEIPT_LABEL = { 'accepted': text.receiptAccepted, 'in-progress': text.receiptInProgress, 'failed': text.receiptFailed } as const
|
|
37
|
+
const DOT = {
|
|
38
|
+
'sent': 'bg-[var(--ui-border-accented)]',
|
|
39
|
+
'crawled': 'bg-[var(--ui-border-accented)]',
|
|
40
|
+
'indexed': 'bg-[var(--ui-border-accented)]',
|
|
41
|
+
'not-indexed': 'bg-warning',
|
|
42
|
+
} as const
|
|
43
|
+
|
|
44
|
+
function reasonLabel(reason: string): string {
|
|
45
|
+
return copy.urls.coverageStates[reason as keyof typeof copy.urls.coverageStates] ?? reason
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function eventLabel(event: IndexingSubmissionEvent): { title: string, detail: string | null, tone: string } {
|
|
49
|
+
switch (event._tag) {
|
|
50
|
+
case 'sent': {
|
|
51
|
+
const parts = [RECEIPT_LABEL[event.send.state]]
|
|
52
|
+
if (event.send.trigger === 'automatic')
|
|
53
|
+
parts.push(text.triggerAutomatic)
|
|
54
|
+
return {
|
|
55
|
+
title: fillCopy(text.timelineSent, { engine: ENGINE_LABEL[event.send.engine] }),
|
|
56
|
+
detail: parts.join(' · '),
|
|
57
|
+
tone: event.send.state === 'failed' ? 'text-error' : 'text-muted',
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
case 'crawled':
|
|
61
|
+
return { title: text.timelineCrawled, detail: null, tone: 'text-muted' }
|
|
62
|
+
case 'indexed':
|
|
63
|
+
return { title: text.timelineIndexed, detail: null, tone: 'text-muted' }
|
|
64
|
+
case 'not-indexed':
|
|
65
|
+
return { title: text.timelineNotIndexed, detail: event.reason ? reasonLabel(event.reason) : null, tone: 'text-muted' }
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<template>
|
|
71
|
+
<section
|
|
72
|
+
v-if="outcome && events.length"
|
|
73
|
+
data-pro-indexing-section="submission-timeline"
|
|
74
|
+
:aria-label="text.timelineLabel"
|
|
75
|
+
>
|
|
76
|
+
<p class="text-label">
|
|
77
|
+
{{ text.timelineLabel }}
|
|
78
|
+
</p>
|
|
79
|
+
<ol class="mt-2 space-y-2 border-l border-default pl-3">
|
|
80
|
+
<li
|
|
81
|
+
v-for="(event, index) in events"
|
|
82
|
+
:key="`${event._tag}:${event.at}:${index}`"
|
|
83
|
+
class="relative flex flex-wrap items-baseline gap-x-2 text-sm"
|
|
84
|
+
:data-event="event._tag"
|
|
85
|
+
>
|
|
86
|
+
<span class="absolute top-1.5 -left-[15.5px] size-1.5 rounded-full" :class="DOT[event._tag]" aria-hidden="true" />
|
|
87
|
+
<span class="text-default">{{ eventLabel(event).title }}</span>
|
|
88
|
+
<span v-if="eventLabel(event).detail" :class="eventLabel(event).tone">{{ eventLabel(event).detail }}</span>
|
|
89
|
+
<time :datetime="event.at" class="text-mini text-dimmed">{{ formatSubmissionDate(event.at) }}</time>
|
|
90
|
+
</li>
|
|
91
|
+
<li
|
|
92
|
+
v-if="outcome.afterwards._tag === 'not-inspected'"
|
|
93
|
+
class="relative text-sm text-muted"
|
|
94
|
+
data-event="not-inspected"
|
|
95
|
+
>
|
|
96
|
+
<span class="absolute top-1.5 -left-[15.5px] size-1.5 rounded-full border border-default bg-default" aria-hidden="true" />
|
|
97
|
+
{{ text.timelineNotInspected }}
|
|
98
|
+
</li>
|
|
99
|
+
</ol>
|
|
100
|
+
<p v-if="outcome.afterwards._tag !== 'not-inspected'" class="mt-2 text-mini text-dimmed">
|
|
101
|
+
{{ text.timelineDates }}
|
|
102
|
+
</p>
|
|
103
|
+
</section>
|
|
104
|
+
</template>
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import type { IndexingSite } from '../../shared/source'
|
|
3
|
+
import type { IndexingAutomaticSending, IndexingSubmissionEngineTotals } from '../../shared/submissions'
|
|
4
|
+
import { formatGroupedNumber } from '@nuxtseo/design-system/app/composables/formatting'
|
|
5
|
+
import { fillCopy } from '@nuxtseo/pro-shell/shared/copy'
|
|
6
|
+
import { computed, useId } from 'vue'
|
|
7
|
+
import { UiHelpLabel, UiWidgetState } from '#components'
|
|
8
|
+
import { formatSubmissionDate, submissionTotals } from '../../shared/submissions'
|
|
9
|
+
import { useIndexingSource } from '../composables/useIndexingSource'
|
|
10
|
+
import { useProIndexingCopy } from '../composables/useProIndexingCopy'
|
|
11
|
+
|
|
12
|
+
// A Site's Submissions: what it sent to each search engine in the last 30
|
|
13
|
+
// days, what each engine's receipt says, and what Google reported afterwards.
|
|
14
|
+
// Reads the `submissions` capability, and `submissionOutcomes` for the
|
|
15
|
+
// "Afterwards in Google" block. Without `submissions` it renders nothing.
|
|
16
|
+
//
|
|
17
|
+
// An accepted receipt proves receipt only, so the counts never say "indexed" or
|
|
18
|
+
// "crawled". "Afterwards" is order in time: the block counts Google's results
|
|
19
|
+
// from checks made after each URL was sent, and never claims sending caused
|
|
20
|
+
// them.
|
|
21
|
+
|
|
22
|
+
const { site } = defineProps<{
|
|
23
|
+
site: IndexingSite | null | undefined
|
|
24
|
+
}>()
|
|
25
|
+
|
|
26
|
+
defineSlots<{
|
|
27
|
+
/** Beside the Automatic sending state, for the site's own switch. Gets the state. */
|
|
28
|
+
automatic?: (props: { state: IndexingAutomaticSending }) => unknown
|
|
29
|
+
/** In the header, for the site's eject menu. */
|
|
30
|
+
actions?: () => unknown
|
|
31
|
+
}>()
|
|
32
|
+
|
|
33
|
+
const source = useIndexingSource()
|
|
34
|
+
const copy = useProIndexingCopy()
|
|
35
|
+
const text = copy.submissions
|
|
36
|
+
const n = formatGroupedNumber
|
|
37
|
+
const headingId = useId()
|
|
38
|
+
|
|
39
|
+
const summaryRead = source?.submissions?.(() => site) ?? null
|
|
40
|
+
const outcomesRead = summaryRead ? source?.submissionOutcomes?.(() => site, { limit: 0 }) ?? null : null
|
|
41
|
+
|
|
42
|
+
const summary = computed(() => summaryRead?.data.value ?? null)
|
|
43
|
+
const outcomes = computed(() => outcomesRead?.data.value ?? null)
|
|
44
|
+
const days = computed(() => summary.value?.days ?? 30)
|
|
45
|
+
const totals = computed(() => summary.value ? submissionTotals(summary.value) : null)
|
|
46
|
+
|
|
47
|
+
const ENGINE_LABEL = { indexnow: text.engineIndexNow, google: text.engineGoogle } as const
|
|
48
|
+
|
|
49
|
+
function urlsLabel(count: number): string {
|
|
50
|
+
return count === 1 ? text.urlsOne : fillCopy(text.urlsMany, { count: n(count) })
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** The receipt and trigger counts after the URL total. A zero count is left out. */
|
|
54
|
+
function engineParts(engine: IndexingSubmissionEngineTotals) {
|
|
55
|
+
return [
|
|
56
|
+
{ key: 'accepted', label: fillCopy(text.accepted, { count: n(engine.accepted) }), tone: 'text-muted', show: true },
|
|
57
|
+
{ key: 'in-progress', label: fillCopy(text.inProgress, { count: n(engine.inProgress) }), tone: 'text-muted', show: engine.inProgress > 0 },
|
|
58
|
+
{ key: 'failed', label: fillCopy(text.failed, { count: n(engine.failed) }), tone: 'text-error', show: engine.failed > 0 },
|
|
59
|
+
{ key: 'automatic', label: fillCopy(text.automatic, { count: n(engine.automatic) }), tone: 'text-dimmed', show: engine.automatic > 0 },
|
|
60
|
+
{ key: 'manual', label: fillCopy(text.manual, { count: n(engine.manual) }), tone: 'text-dimmed', show: engine.manual > 0 && engine.automatic > 0 },
|
|
61
|
+
].filter(part => part.show)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const afterwardsScope = computed(() => {
|
|
65
|
+
const sent = outcomes.value?.sent ?? 0
|
|
66
|
+
return sent === 1 ? text.afterwardsScopeOne : fillCopy(text.afterwardsScope, { count: n(sent) })
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
const afterwardsFacts = computed(() => {
|
|
70
|
+
const value = outcomes.value
|
|
71
|
+
if (!value)
|
|
72
|
+
return []
|
|
73
|
+
return [
|
|
74
|
+
{ key: 'indexed', label: text.indexed, value: value.indexed },
|
|
75
|
+
{ key: 'not-indexed', label: text.notIndexed, value: value.notIndexed },
|
|
76
|
+
{ key: 'not-inspected', label: text.notInspected, value: value.notInspected },
|
|
77
|
+
]
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
function reasonLabel(reason: string): string {
|
|
81
|
+
return copy.urls.coverageStates[reason as keyof typeof copy.urls.coverageStates] ?? reason
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const automaticState = computed(() => {
|
|
85
|
+
const state = summary.value?.automaticSending
|
|
86
|
+
if (!state)
|
|
87
|
+
return null
|
|
88
|
+
if (state._tag === 'off')
|
|
89
|
+
return { label: text.automaticOff, detail: null }
|
|
90
|
+
const lastCheck = state.lastCheck
|
|
91
|
+
const truncation = lastCheck?.completeness._tag === 'truncated'
|
|
92
|
+
? lastCheck.completeness.reasons.map(reason => reason === 'daily-limit' ? text.automaticDailyLimit : text.automaticScanLimit).join(' ')
|
|
93
|
+
: ''
|
|
94
|
+
const detail = lastCheck
|
|
95
|
+
? [fillCopy(lastCheck.changedUrls === 1 ? text.automaticLastCheckOne : text.automaticLastCheck, { date: formatSubmissionDate(lastCheck.checkedAt), changed: n(lastCheck.changedUrls), sent: n(lastCheck.sentUrls) }), truncation].filter(Boolean).join(' ')
|
|
96
|
+
: text.automaticNoCheck
|
|
97
|
+
return {
|
|
98
|
+
label: state._tag === 'key-unverified' ? text.automaticKeyUnverified : fillCopy(text.automaticOn, { date: formatSubmissionDate(state.since) }),
|
|
99
|
+
detail,
|
|
100
|
+
}
|
|
101
|
+
})
|
|
102
|
+
</script>
|
|
103
|
+
|
|
104
|
+
<template>
|
|
105
|
+
<section
|
|
106
|
+
v-if="summaryRead"
|
|
107
|
+
data-pro-indexing-section="submissions"
|
|
108
|
+
:aria-labelledby="headingId"
|
|
109
|
+
class="rounded-xl border border-default p-4"
|
|
110
|
+
>
|
|
111
|
+
<div class="flex flex-wrap items-center justify-between gap-x-3 gap-y-1">
|
|
112
|
+
<h3 :id="headingId" class="text-sm font-strong text-highlighted">
|
|
113
|
+
<UiHelpLabel :text="text.title" :tooltip="fillCopy(text.titleTooltip, { days })" />
|
|
114
|
+
</h3>
|
|
115
|
+
<div class="flex items-center gap-2">
|
|
116
|
+
<span class="text-mini text-dimmed">{{ fillCopy(text.window, { days }) }}</span>
|
|
117
|
+
<slot name="actions" />
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
<UiWidgetState
|
|
122
|
+
:status="summaryRead.status.value"
|
|
123
|
+
:error="summaryRead.error.value"
|
|
124
|
+
:skeleton-lines="3"
|
|
125
|
+
retain-content-on-error
|
|
126
|
+
@retry="summaryRead.refresh()"
|
|
127
|
+
>
|
|
128
|
+
<template v-if="summary && totals">
|
|
129
|
+
<!-- Most Sites have sent nothing. A quiet line, not a framed empty
|
|
130
|
+
state: the Automatic sending row below stays the next step. -->
|
|
131
|
+
<div v-if="totals.urls === 0" class="mt-3" data-submissions="empty">
|
|
132
|
+
<p class="text-sm font-medium text-default">
|
|
133
|
+
{{ text.emptyTitle }}
|
|
134
|
+
</p>
|
|
135
|
+
<p class="mt-0.5 text-mini text-muted">
|
|
136
|
+
{{ fillCopy(text.emptyBody, { days }) }}
|
|
137
|
+
</p>
|
|
138
|
+
</div>
|
|
139
|
+
<dl v-else class="mt-3 divide-y divide-default" data-submissions="engines">
|
|
140
|
+
<div
|
|
141
|
+
v-for="engine in summary.engines"
|
|
142
|
+
:key="engine.engine"
|
|
143
|
+
class="flex flex-col gap-1 py-2 sm:flex-row sm:items-baseline sm:gap-4"
|
|
144
|
+
:data-engine="engine.engine"
|
|
145
|
+
>
|
|
146
|
+
<dt class="text-sm text-default sm:w-44 sm:shrink-0">
|
|
147
|
+
{{ ENGINE_LABEL[engine.engine] }}
|
|
148
|
+
</dt>
|
|
149
|
+
<dd class="flex min-w-0 flex-wrap items-baseline gap-x-3 gap-y-1 text-sm">
|
|
150
|
+
<span class="font-medium text-highlighted numerals-display">{{ urlsLabel(engine.urls) }}</span>
|
|
151
|
+
<template v-if="engine.urls > 0">
|
|
152
|
+
<span v-for="part in engineParts(engine)" :key="part.key" :class="part.tone">{{ part.label }}</span>
|
|
153
|
+
</template>
|
|
154
|
+
</dd>
|
|
155
|
+
</div>
|
|
156
|
+
</dl>
|
|
157
|
+
<p v-if="summary.completeness._tag === 'partial'" class="mt-1 text-mini text-dimmed">
|
|
158
|
+
{{ fillCopy(text.partial, { count: n(summary.completeness.receipts) }) }}
|
|
159
|
+
</p>
|
|
160
|
+
|
|
161
|
+
<div
|
|
162
|
+
v-if="outcomesRead && totals.urls > 0"
|
|
163
|
+
class="mt-4 border-t border-default pt-3"
|
|
164
|
+
data-submissions="afterwards"
|
|
165
|
+
>
|
|
166
|
+
<div class="flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1">
|
|
167
|
+
<h4 class="text-sm font-medium text-default">
|
|
168
|
+
<UiHelpLabel :text="text.afterwardsTitle" :tooltip="text.afterwardsTooltip" />
|
|
169
|
+
</h4>
|
|
170
|
+
<span v-if="outcomes" class="text-mini text-dimmed">{{ afterwardsScope }}</span>
|
|
171
|
+
</div>
|
|
172
|
+
<UiWidgetState
|
|
173
|
+
:status="outcomesRead.status.value"
|
|
174
|
+
:error="outcomesRead.error.value"
|
|
175
|
+
:skeleton-lines="1"
|
|
176
|
+
retain-content-on-error
|
|
177
|
+
@retry="outcomesRead.refresh()"
|
|
178
|
+
>
|
|
179
|
+
<template v-if="outcomes">
|
|
180
|
+
<!-- items-end: a label that wraps at phone width keeps the counts on one line. -->
|
|
181
|
+
<dl class="mt-2 grid grid-cols-3 items-end gap-3">
|
|
182
|
+
<div v-for="fact in afterwardsFacts" :key="fact.key" class="min-w-0" :data-afterwards="fact.key">
|
|
183
|
+
<dt class="text-mini text-muted">
|
|
184
|
+
{{ fact.label }}
|
|
185
|
+
</dt>
|
|
186
|
+
<dd class="text-base font-medium text-highlighted numerals-display">
|
|
187
|
+
{{ n(fact.value) }}
|
|
188
|
+
</dd>
|
|
189
|
+
</div>
|
|
190
|
+
</dl>
|
|
191
|
+
<ul v-if="outcomes.reasons.length" class="mt-2 flex flex-wrap gap-x-3 gap-y-1 text-mini text-muted">
|
|
192
|
+
<li v-for="reason in outcomes.reasons" :key="reason.reason">
|
|
193
|
+
{{ reasonLabel(reason.reason) }} · {{ n(reason.urls) }}
|
|
194
|
+
</li>
|
|
195
|
+
</ul>
|
|
196
|
+
<p v-if="outcomes.checked < outcomes.sent" class="mt-1 text-mini text-dimmed">
|
|
197
|
+
{{ fillCopy(text.afterwardsPartial, { checked: n(outcomes.checked), count: n(outcomes.sent) }) }}
|
|
198
|
+
</p>
|
|
199
|
+
</template>
|
|
200
|
+
</UiWidgetState>
|
|
201
|
+
</div>
|
|
202
|
+
|
|
203
|
+
<div
|
|
204
|
+
v-if="automaticState && summary.automaticSending"
|
|
205
|
+
class="mt-4 flex flex-col gap-2 border-t border-default pt-3 sm:flex-row sm:items-center sm:justify-between"
|
|
206
|
+
data-submissions="automatic"
|
|
207
|
+
>
|
|
208
|
+
<div class="min-w-0">
|
|
209
|
+
<p class="text-sm text-default">
|
|
210
|
+
<UiHelpLabel :text="text.automaticTitle" :tooltip="text.automaticTooltip" />
|
|
211
|
+
<span class="ml-2 text-muted">{{ automaticState.label }}</span>
|
|
212
|
+
</p>
|
|
213
|
+
<p v-if="automaticState.detail" class="mt-0.5 text-mini text-dimmed">
|
|
214
|
+
{{ automaticState.detail }}
|
|
215
|
+
</p>
|
|
216
|
+
</div>
|
|
217
|
+
<slot name="automatic" :state="summary.automaticSending" />
|
|
218
|
+
</div>
|
|
219
|
+
</template>
|
|
220
|
+
</UiWidgetState>
|
|
221
|
+
</section>
|
|
222
|
+
</template>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import type { IndexingSite } from '../../shared/source'
|
|
3
|
+
import { formatGroupedNumber } from '@nuxtseo/design-system/app/composables/formatting'
|
|
4
|
+
import { fillCopy } from '@nuxtseo/pro-shell/shared/copy'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
import { UiSkeleton } from '#components'
|
|
7
|
+
import { useIndexingSource } from '../composables/useIndexingSource'
|
|
8
|
+
import { useProIndexingCopy } from '../composables/useProIndexingCopy'
|
|
9
|
+
|
|
10
|
+
// One Site's Submissions in the last 30 days, as one cell of the site's own
|
|
11
|
+
// Sites list. Reads the `submissionsRollup` capability: one read for every
|
|
12
|
+
// Site, so a list of many Sites never reads once per row. Without it, the cell
|
|
13
|
+
// renders nothing. The column heading is the site's, worded by
|
|
14
|
+
// `copy.submissions.columnTitle` and `columnTooltip`.
|
|
15
|
+
|
|
16
|
+
const { site } = defineProps<{
|
|
17
|
+
site: IndexingSite
|
|
18
|
+
}>()
|
|
19
|
+
|
|
20
|
+
const source = useIndexingSource()
|
|
21
|
+
const copy = useProIndexingCopy()
|
|
22
|
+
const text = copy.submissions
|
|
23
|
+
const n = formatGroupedNumber
|
|
24
|
+
const read = source?.submissionsRollup?.() ?? null
|
|
25
|
+
|
|
26
|
+
const row = computed(() => read?.data.value?.sites[site.id] ?? null)
|
|
27
|
+
const loading = computed(() => !read?.data.value && (read?.status.value === 'pending' || read?.status.value === 'idle'))
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<span v-if="read" class="inline-flex items-baseline gap-1 text-sm" data-pro-indexing-section="submissions-cell">
|
|
32
|
+
<UiSkeleton v-if="loading" type="text" :base="48" class="!h-3" aria-hidden="true" />
|
|
33
|
+
<span v-else-if="!row" class="text-dimmed">{{ copy.urls.noValue }}</span>
|
|
34
|
+
<span v-else-if="row.urls === 0" class="text-dimmed">{{ text.cellNone }}</span>
|
|
35
|
+
<template v-else>
|
|
36
|
+
<span class="text-default numerals-display">{{ fillCopy(text.cellSent, { count: n(row.urls) }) }}</span>
|
|
37
|
+
<span v-if="row.failed > 0" class="text-mini text-error"> · {{ fillCopy(text.cellFailed, { count: n(row.failed) }) }}</span>
|
|
38
|
+
</template>
|
|
39
|
+
</span>
|
|
40
|
+
</template>
|
|
@@ -9,8 +9,9 @@ import { indexingActionForIssue, parseIndexCohortFilter } from '@gscdump/sdk/ind
|
|
|
9
9
|
import { issueDetails, severityOrder } from '@gscdump/sdk/indexing-issues'
|
|
10
10
|
import { DISPLAY_LOCALE, useProHumanFriendlyNumber } from '@nuxtseo/design-system/app/composables/formatting'
|
|
11
11
|
import { fillCopy } from '@nuxtseo/pro-shell/shared/copy'
|
|
12
|
+
import { useElementSize } from '@vueuse/core'
|
|
12
13
|
import { navigateTo, useRoute } from 'nuxt/app'
|
|
13
|
-
import { computed, h, onMounted, ref, watch } from 'vue'
|
|
14
|
+
import { computed, h, onMounted, ref, useTemplateRef, watch } from 'vue'
|
|
14
15
|
import { UiButton, UiChip, UiDataList, UiIcon, UiMetricLabel as UiMetricLabelCell, UiPopover, UiSeverityDot, UiSkeleton, UiSyncDot } from '#components'
|
|
15
16
|
import { useToast } from '#imports'
|
|
16
17
|
import { issueIcons } from '../../shared/issue-display'
|
|
@@ -18,6 +19,7 @@ import { parseIndexingUrlsQuery } from '../../shared/urls-query'
|
|
|
18
19
|
import { useIndexingSource } from '../composables/useIndexingSource'
|
|
19
20
|
import { useProIndexingCopy } from '../composables/useProIndexingCopy'
|
|
20
21
|
import IndexingCrawlPipeline from './IndexingCrawlPipeline.vue'
|
|
22
|
+
import IndexingSubmissionTimeline from './IndexingSubmissionTimeline.vue'
|
|
21
23
|
import IndexingUrlsTableShell from './IndexingUrlsTableShell.vue'
|
|
22
24
|
|
|
23
25
|
// One Site's inspected URLs: issue filter, status filter, search, pages, the
|
|
@@ -41,6 +43,10 @@ const { site, pageSize = 25, shell, forceSkeleton = false } = defineProps<{
|
|
|
41
43
|
}>()
|
|
42
44
|
|
|
43
45
|
const source = useIndexingSource()
|
|
46
|
+
// The table scrolls sideways on a phone, and an expanded row spans the whole
|
|
47
|
+
// table. Its detail is held to this visible width so nothing is cut off.
|
|
48
|
+
const { width: visibleWidth } = useElementSize(useTemplateRef<HTMLElement>('root'))
|
|
49
|
+
const hasSubmissionOutcomes = !!source?.submissionOutcomes
|
|
44
50
|
const copy = useProIndexingCopy().urls
|
|
45
51
|
const siteRef = () => site ?? null
|
|
46
52
|
const TableShell = computed(() => shell ?? IndexingUrlsTableShell)
|
|
@@ -640,7 +646,12 @@ function indexingUrlId(row: GscdumpIndexingUrl): string {
|
|
|
640
646
|
</script>
|
|
641
647
|
|
|
642
648
|
<template>
|
|
643
|
-
<div
|
|
649
|
+
<div
|
|
650
|
+
ref="root"
|
|
651
|
+
class="space-y-3"
|
|
652
|
+
data-pro-indexing-section="urls"
|
|
653
|
+
:style="visibleWidth ? { '--idx-visible-width': `${visibleWidth}px` } : undefined"
|
|
654
|
+
>
|
|
644
655
|
<!-- Facet panel: consolidation targets (canonical_mismatch) -->
|
|
645
656
|
<UiDataList
|
|
646
657
|
v-if="facet === 'canonical_mismatch'"
|
|
@@ -925,6 +936,9 @@ function indexingUrlId(row: GscdumpIndexingUrl): string {
|
|
|
925
936
|
<span class="text-xs" :class="url.verdict === 'PASS' ? 'text-muted' : 'text-default'">{{ url.coverageState }}</span>
|
|
926
937
|
</div>
|
|
927
938
|
|
|
939
|
+
<!-- Submissions of this URL, with the `submissionOutcomes` capability -->
|
|
940
|
+
<IndexingSubmissionTimeline v-if="hasSubmissionOutcomes" :site="site" :url="url.url" class="mb-3" />
|
|
941
|
+
|
|
928
942
|
<!-- Detail grid -->
|
|
929
943
|
<div class="idx-detail-grid">
|
|
930
944
|
<!-- Crawler -->
|
|
@@ -1028,6 +1042,11 @@ function indexingUrlId(row: GscdumpIndexingUrl): string {
|
|
|
1028
1042
|
}
|
|
1029
1043
|
|
|
1030
1044
|
.idx-expanded {
|
|
1045
|
+
/* Stays in view while the table scrolls sideways: the visible width less the
|
|
1046
|
+
row inset on each side and the table border. */
|
|
1047
|
+
position: sticky;
|
|
1048
|
+
left: 0.5rem;
|
|
1049
|
+
max-width: calc(var(--idx-visible-width, 100%) - 1rem - 2px);
|
|
1031
1050
|
padding: 1rem 1.25rem;
|
|
1032
1051
|
border-radius: 0.5rem;
|
|
1033
1052
|
background: color-mix(in srgb, var(--ui-bg-elevated) 20%, transparent);
|
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
|
+
"version": "0.1.9",
|
|
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.
|
|
41
|
-
"@nuxtseo/pro-shell": "^0.1.
|
|
40
|
+
"@nuxtseo/design-system": "^0.1.9",
|
|
41
|
+
"@nuxtseo/pro-shell": "^0.1.9",
|
|
42
42
|
"@vueuse/core": "^14.0.0 || ^15.0.0",
|
|
43
43
|
"nuxt": "^4.6.0",
|
|
44
44
|
"typescript": ">=5.8.0 <7",
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
"@unovis/vue": "^1.6.7"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@gscdump/contracts": "7.
|
|
53
|
-
"@gscdump/sdk": "7.
|
|
52
|
+
"@gscdump/contracts": "7.17.0",
|
|
53
|
+
"@gscdump/sdk": "7.17.0",
|
|
54
54
|
"@nuxt/ui": "^4.11.1",
|
|
55
|
-
"@nuxtseo/design-system": "0.1.
|
|
56
|
-
"@nuxtseo/pro-shell": "0.1.
|
|
55
|
+
"@nuxtseo/design-system": "0.1.9",
|
|
56
|
+
"@nuxtseo/pro-shell": "0.1.9",
|
|
57
57
|
"@vueuse/core": "^14.4.0",
|
|
58
58
|
"nuxt": "4.6.1",
|
|
59
59
|
"site-typecheck": "0.0.0",
|
package/shared/changes.ts
CHANGED
|
@@ -3,24 +3,22 @@
|
|
|
3
3
|
//
|
|
4
4
|
// Moved from nuxtseo.com `layers/pro/gsc/app/utils/indexing-changes.ts`.
|
|
5
5
|
//
|
|
6
|
-
// Two sources
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
// minus cleared is never presented as a change in level.
|
|
6
|
+
// Two sources. A Site's trend gives its indexed level and its change across the
|
|
7
|
+
// window. The roll-up counts URL Inspection changes: URLs Google dropped from
|
|
8
|
+
// its index and URLs it newly indexed. A Sitemap that grows or shrinks moves
|
|
9
|
+
// the trend's totals but never the roll-up.
|
|
11
10
|
|
|
12
11
|
import type { IndexingTrendReading } from '@gscdump/sdk/indexing'
|
|
13
|
-
import { notIndexedCount } from '@gscdump/sdk/indexing'
|
|
14
12
|
|
|
15
13
|
/** One Site on one UTC day of the roll-up. */
|
|
16
14
|
export interface IndexingChangesRow {
|
|
17
15
|
readonly siteId: string
|
|
18
|
-
/** UTC day, `YYYY-MM-DD
|
|
16
|
+
/** UTC day, `YYYY-MM-DD`, of the inspection that found the change. The change happened on or before it. */
|
|
19
17
|
readonly day: string
|
|
20
|
-
/**
|
|
21
|
-
readonly
|
|
22
|
-
/**
|
|
23
|
-
readonly
|
|
18
|
+
/** URLs an inspection found not indexed after the one before it found them indexed. */
|
|
19
|
+
readonly dropped: number
|
|
20
|
+
/** URLs an inspection found indexed after the one before it found them not indexed. */
|
|
21
|
+
readonly indexed: number
|
|
24
22
|
}
|
|
25
23
|
|
|
26
24
|
/** What the `changesRollup` capability returns. */
|
|
@@ -39,8 +37,8 @@ export interface IndexingChangesSite {
|
|
|
39
37
|
trend?: readonly IndexingTrendReading[]
|
|
40
38
|
}
|
|
41
39
|
export interface IndexingLevelChange {
|
|
42
|
-
|
|
43
|
-
/**
|
|
40
|
+
indexed: number
|
|
41
|
+
/** Negative means fewer URLs are indexed. */
|
|
44
42
|
change: number
|
|
45
43
|
/** The first day of the trend inside the window. */
|
|
46
44
|
since: string
|
|
@@ -48,22 +46,22 @@ export interface IndexingLevelChange {
|
|
|
48
46
|
|
|
49
47
|
export interface IndexingChangesDay {
|
|
50
48
|
day: string
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
dropped: number
|
|
50
|
+
indexed: number
|
|
53
51
|
}
|
|
54
52
|
|
|
55
53
|
export interface IndexingChangesSiteRow {
|
|
56
54
|
siteId: string
|
|
57
55
|
label: string
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
dropped: number
|
|
57
|
+
indexed: number
|
|
60
58
|
level: IndexingLevelChange | null
|
|
61
59
|
}
|
|
62
60
|
|
|
63
61
|
export interface IndexingChanges {
|
|
64
62
|
/** One entry per UTC day of the window, oldest first, zero filled. */
|
|
65
63
|
days: IndexingChangesDay[]
|
|
66
|
-
/** Sites with a change, largest
|
|
64
|
+
/** Sites with a change, largest indexed loss first. Unknown levels sort last. */
|
|
67
65
|
sites: IndexingChangesSiteRow[]
|
|
68
66
|
}
|
|
69
67
|
|
|
@@ -75,15 +73,30 @@ function windowAxis(through: string, windowDays: number): string[] {
|
|
|
75
73
|
new Date(last - (windowDays - 1 - index) * DAY_MS).toISOString().slice(0, 10))
|
|
76
74
|
}
|
|
77
75
|
|
|
78
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* Y axis ticks for a count chart over `[min, max]`. Counts are whole numbers,
|
|
78
|
+
* so the axis never labels a fraction: the step is a 1, 2, or 5 multiple of a
|
|
79
|
+
* power of 10, and never below 1.
|
|
80
|
+
*/
|
|
81
|
+
export function countAxisTicks([min, max]: readonly [number, number]): number[] {
|
|
82
|
+
const raw = (max - min) / 4
|
|
83
|
+
const power = 10 ** Math.floor(Math.log10(raw))
|
|
84
|
+
const step = Math.max(1, [1, 2, 5, 10].find(factor => factor * power >= raw)! * power)
|
|
85
|
+
const ticks: number[] = []
|
|
86
|
+
// `Math.ceil(-0.5)` is `-0`, which a formatter prints as "-0": `|| 0` makes it 0.
|
|
87
|
+
for (let value = Math.ceil(min / step) * step; value <= max; value += step)
|
|
88
|
+
ticks.push(value || 0)
|
|
89
|
+
return ticks
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** The indexed change across the window, or null without two days to compare. */
|
|
79
93
|
export function indexingLevelChange(trend: readonly IndexingTrendReading[], from: string): IndexingLevelChange | null {
|
|
80
94
|
const points = trend.filter(point => point.totalUrls > 0 && point.date >= from).toSorted((a, b) => a.date.localeCompare(b.date))
|
|
81
95
|
const first = points[0]
|
|
82
96
|
const last = points.at(-1)
|
|
83
97
|
if (!first || !last || first === last)
|
|
84
98
|
return null
|
|
85
|
-
|
|
86
|
-
return { notIndexed, change: notIndexed - notIndexedCount(first), since: first.date }
|
|
99
|
+
return { indexed: last.indexedCount, change: last.indexedCount - first.indexedCount, since: first.date }
|
|
87
100
|
}
|
|
88
101
|
|
|
89
102
|
/**
|
|
@@ -92,12 +105,12 @@ export function indexingLevelChange(trend: readonly IndexingTrendReading[], from
|
|
|
92
105
|
*/
|
|
93
106
|
export function summarizeIndexingChanges(rollup: IndexingChangesRollup, sites: readonly IndexingChangesSite[]): IndexingChanges {
|
|
94
107
|
const axis = windowAxis(rollup.through, rollup.windowDays)
|
|
95
|
-
const days = new Map(axis.map(day => [day, { day,
|
|
108
|
+
const days = new Map(axis.map(day => [day, { day, dropped: 0, indexed: 0 }]))
|
|
96
109
|
const bySite = new Map<string, IndexingChangesSiteRow>(sites.map(site => [site.id, {
|
|
97
110
|
siteId: site.id,
|
|
98
111
|
label: site.label,
|
|
99
|
-
|
|
100
|
-
|
|
112
|
+
dropped: 0,
|
|
113
|
+
indexed: 0,
|
|
101
114
|
level: site.trend ? indexingLevelChange(site.trend, axis[0]!) : null,
|
|
102
115
|
}]))
|
|
103
116
|
|
|
@@ -107,10 +120,10 @@ export function summarizeIndexingChanges(rollup: IndexingChangesRollup, sites: r
|
|
|
107
120
|
const site = bySite.get(row.siteId)
|
|
108
121
|
if (!day || !site)
|
|
109
122
|
continue
|
|
110
|
-
day.
|
|
111
|
-
day.
|
|
112
|
-
site.
|
|
113
|
-
site.
|
|
123
|
+
day.dropped += row.dropped
|
|
124
|
+
day.indexed += row.indexed
|
|
125
|
+
site.dropped += row.dropped
|
|
126
|
+
site.indexed += row.indexed
|
|
114
127
|
}
|
|
115
128
|
|
|
116
129
|
return {
|
|
@@ -118,7 +131,7 @@ export function summarizeIndexingChanges(rollup: IndexingChangesRollup, sites: r
|
|
|
118
131
|
sites: [...bySite.values()]
|
|
119
132
|
// A Site with a trend but nothing to compare stays, as unknown. Dropping it
|
|
120
133
|
// would read as no change.
|
|
121
|
-
.filter(site => site.
|
|
122
|
-
.sort((a, b) => (
|
|
134
|
+
.filter(site => site.dropped > 0 || site.indexed > 0 || !!site.level?.change || (!site.level && withTrend.has(site.siteId)))
|
|
135
|
+
.sort((a, b) => (a.level?.change ?? Number.POSITIVE_INFINITY) - (b.level?.change ?? Number.POSITIVE_INFINITY) || b.dropped - a.dropped || a.label.localeCompare(b.label)),
|
|
123
136
|
}
|
|
124
137
|
}
|
package/shared/copy.ts
CHANGED
|
@@ -18,9 +18,9 @@ const DEFAULTS = {
|
|
|
18
18
|
},
|
|
19
19
|
overview: {
|
|
20
20
|
indexedTitle: 'Indexed',
|
|
21
|
-
indexedTooltip: 'Share of
|
|
21
|
+
indexedTooltip: 'Share of reported URLs that Google has indexed.',
|
|
22
22
|
notIndexedTitle: 'Not indexed',
|
|
23
|
-
notIndexedTooltip: '
|
|
23
|
+
notIndexedTooltip: 'Reported URLs Google has not indexed.',
|
|
24
24
|
crawlErrorsTitle: 'Crawl errors',
|
|
25
25
|
crawlErrorsTooltip: 'URLs Google reports as not found, soft 404, or server errors. Sitemap availability and sitemap-page conflicts are shown separately.',
|
|
26
26
|
sitemapProblemsTitle: 'Sitemap problems',
|
|
@@ -38,7 +38,7 @@ const DEFAULTS = {
|
|
|
38
38
|
failedBody: 'Google indexing data could not be loaded for {site}.',
|
|
39
39
|
openReport: 'Open indexing report',
|
|
40
40
|
emptyNoObservation: 'Google hasn\'t reported coverage for this Site yet. Breakdown appears after the first Search Console sync.',
|
|
41
|
-
emptyAllIndexed: 'Every
|
|
41
|
+
emptyAllIndexed: 'Every reported URL is indexed, so there is nothing to break down.',
|
|
42
42
|
emptyUnattributedOne: 'Google hasn\'t attributed a reason to the {count} URL it has not indexed.',
|
|
43
43
|
emptyUnattributedMany: 'Google hasn\'t attributed a reason to the {count} URLs it has not indexed.',
|
|
44
44
|
},
|
|
@@ -54,20 +54,21 @@ const DEFAULTS = {
|
|
|
54
54
|
},
|
|
55
55
|
changes: {
|
|
56
56
|
window: 'Last {days} days',
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
newlyIndexed: 'Newly indexed',
|
|
58
|
+
dropped: 'Dropped from index',
|
|
59
59
|
legendLabel: 'Chart legend',
|
|
60
|
-
chartLabel: '
|
|
61
|
-
chartCaption: '
|
|
60
|
+
chartLabel: 'Newly indexed URLs above zero and URLs dropped from the index below zero, per day',
|
|
61
|
+
chartCaption: 'Newly indexed and dropped URLs per day',
|
|
62
62
|
day: 'Day',
|
|
63
63
|
tableLabel: 'Indexing changes by Site',
|
|
64
64
|
site: 'Site',
|
|
65
|
-
|
|
65
|
+
indexed: 'Indexed',
|
|
66
66
|
change: 'Change',
|
|
67
67
|
since: 'since {date}',
|
|
68
|
-
|
|
68
|
+
inspectionSource: 'Counts come from Google URL Inspection checks, one URL per change.',
|
|
69
|
+
checkDates: 'Each change is dated by the check that found it. Checks on one URL can be months apart.',
|
|
69
70
|
emptyTitle: 'No indexing changes recorded',
|
|
70
|
-
emptyBody: '
|
|
71
|
+
emptyBody: 'URL Inspection found no index changes for these Sites in the last {days} days.',
|
|
71
72
|
},
|
|
72
73
|
diagnosis: {
|
|
73
74
|
statusSevere: 'Action needed',
|
|
@@ -122,6 +123,57 @@ const DEFAULTS = {
|
|
|
122
123
|
cellDetail: '{notIndexed} of {total} pages · {rest} across the rest',
|
|
123
124
|
cellOverlap: '{count} also counted above',
|
|
124
125
|
},
|
|
126
|
+
submissions: {
|
|
127
|
+
title: 'Sent to search engines',
|
|
128
|
+
titleTooltip: 'URLs sent to search engines in the last {days} days. Each URL counts once per engine, by its latest Submission Receipt. An accepted Submission Receipt proves that the engine received the URL. It does not prove a crawl or indexing.',
|
|
129
|
+
window: 'Last {days} days',
|
|
130
|
+
engineIndexNow: 'IndexNow',
|
|
131
|
+
engineGoogle: 'Google Indexing API',
|
|
132
|
+
urlsOne: '1 URL',
|
|
133
|
+
urlsMany: '{count} URLs',
|
|
134
|
+
accepted: '{count} accepted',
|
|
135
|
+
inProgress: '{count} in progress',
|
|
136
|
+
failed: '{count} failed',
|
|
137
|
+
automatic: '{count} automatic',
|
|
138
|
+
manual: '{count} manual',
|
|
139
|
+
partial: 'Counts the {count} most recent Submission Receipts.',
|
|
140
|
+
emptyTitle: 'Tell search engines when URLs change',
|
|
141
|
+
emptyBody: 'No URLs sent in the last {days} days.',
|
|
142
|
+
afterwardsTitle: 'Afterwards in Google',
|
|
143
|
+
afterwardsTooltip: 'Google\'s latest URL Inspection result for each URL that a search engine received. Only a check made after the engine last received the URL counts. Not inspected yet means no check since then. It shows what happened next. It does not show that sending caused it. Google does not support IndexNow.',
|
|
144
|
+
afterwardsScope: 'Of {count} URLs sent',
|
|
145
|
+
afterwardsScopeOne: 'Of 1 URL sent',
|
|
146
|
+
afterwardsPartial: 'These counts cover {checked} of the {count} URLs sent.',
|
|
147
|
+
indexed: 'Indexed',
|
|
148
|
+
notIndexed: 'Not indexed',
|
|
149
|
+
notInspected: 'Not inspected yet',
|
|
150
|
+
automaticTitle: 'Automatic sending',
|
|
151
|
+
automaticTooltip: 'Sends new and changed sitemap URLs to IndexNow after each sitemap update.',
|
|
152
|
+
automaticOff: 'Off',
|
|
153
|
+
automaticOn: 'On since {date}',
|
|
154
|
+
automaticKeyUnverified: 'On. Nothing sends until the key file verifies.',
|
|
155
|
+
automaticNoCheck: 'No sitemap update checked yet.',
|
|
156
|
+
automaticLastCheck: 'Last check {date}: {changed} changed URLs found, {sent} sent.',
|
|
157
|
+
automaticLastCheckOne: 'Last check {date}: 1 changed URL found, {sent} sent.',
|
|
158
|
+
automaticDailyLimit: 'Stopped at the daily limit.',
|
|
159
|
+
automaticScanLimit: 'Stopped at the scan limit.',
|
|
160
|
+
timelineLabel: 'Submissions of this URL',
|
|
161
|
+
timelineSent: 'Sent to {engine}',
|
|
162
|
+
receiptAccepted: 'Accepted',
|
|
163
|
+
receiptInProgress: 'In progress',
|
|
164
|
+
receiptFailed: 'Failed',
|
|
165
|
+
triggerAutomatic: 'Automatic',
|
|
166
|
+
timelineCrawled: 'Google crawled',
|
|
167
|
+
timelineIndexed: 'Google reported indexed',
|
|
168
|
+
timelineNotIndexed: 'Google reported not indexed',
|
|
169
|
+
timelineNotInspected: 'Not inspected since it was sent',
|
|
170
|
+
timelineDates: 'Google results are dated by the URL Inspection check that found them.',
|
|
171
|
+
columnTitle: 'Submissions',
|
|
172
|
+
columnTooltip: 'URLs sent to search engines in the last {days} days.',
|
|
173
|
+
cellSent: '{count} sent',
|
|
174
|
+
cellFailed: '{count} failed',
|
|
175
|
+
cellNone: 'None',
|
|
176
|
+
},
|
|
125
177
|
urls: {
|
|
126
178
|
tableLabel: 'Indexing URLs',
|
|
127
179
|
searchPlaceholder: 'Search URLs…',
|
package/shared/source.ts
CHANGED
|
@@ -19,6 +19,7 @@ import type {
|
|
|
19
19
|
import type { IndexCohortsResponse, IndexingDiagnoseInput, IndexingOverviewDiagnosis } from '@gscdump/sdk/indexing'
|
|
20
20
|
import type { MaybeRefOrGetter, Ref } from 'vue'
|
|
21
21
|
import type { IndexingChangesRollup } from './changes'
|
|
22
|
+
import type { IndexingSubmissionOutcomes, IndexingSubmissionOutcomesParams, IndexingSubmissionsRollup, IndexingSubmissionSummary } from './submissions'
|
|
22
23
|
|
|
23
24
|
/** The state of one read. `idle` has not started; `pending` is in flight. */
|
|
24
25
|
export type IndexingReadStatus = 'idle' | 'pending' | 'success' | 'error'
|
|
@@ -107,6 +108,21 @@ export interface IndexingSource {
|
|
|
107
108
|
readonly sitemapProblems?: () => IndexingRead<IndexingSitemapProblems>
|
|
108
109
|
/** The Portfolio changes roll-up. With it, the Portfolio Changes section renders. */
|
|
109
110
|
readonly changesRollup?: () => IndexingRead<IndexingChangesRollup>
|
|
111
|
+
/**
|
|
112
|
+
* A Site's Submissions over the last 30 days: URLs sent per engine, their
|
|
113
|
+
* receipt states and triggers, and IndexNow Automatic sending. With it,
|
|
114
|
+
* `IndexingSubmissionsCard` renders.
|
|
115
|
+
*/
|
|
116
|
+
readonly submissions?: (site: SiteInput) => IndexingRead<IndexingSubmissionSummary>
|
|
117
|
+
/**
|
|
118
|
+
* Sent URLs joined to Google's URL Inspection results from checks made after
|
|
119
|
+
* each Submission. With it, the Submissions card shows "Afterwards in
|
|
120
|
+
* Google", and each URL in the URLs table shows its Submission timeline. The
|
|
121
|
+
* source never starts a URL Inspection for this read.
|
|
122
|
+
*/
|
|
123
|
+
readonly submissionOutcomes?: (site: SiteInput, params: MaybeRefOrGetter<IndexingSubmissionOutcomesParams>) => IndexingRead<IndexingSubmissionOutcomes>
|
|
124
|
+
/** Submissions per Site across the Portfolio, in one read. With it, `IndexingSubmissionsCell` renders. */
|
|
125
|
+
readonly submissionsRollup?: () => IndexingRead<IndexingSubmissionsRollup>
|
|
110
126
|
/** IndexNow submission. The site draws its own IndexNow panel inside `IndexingCapabilityGate`. */
|
|
111
127
|
readonly indexNow?: true
|
|
112
128
|
/** Watched URLs. The site draws its own Watched URLs panel inside `IndexingCapabilityGate`. */
|
|
@@ -135,6 +151,9 @@ export const INDEXING_CAPABILITIES = [
|
|
|
135
151
|
'cohorts',
|
|
136
152
|
'sitemapProblems',
|
|
137
153
|
'changesRollup',
|
|
154
|
+
'submissions',
|
|
155
|
+
'submissionOutcomes',
|
|
156
|
+
'submissionsRollup',
|
|
138
157
|
'indexNow',
|
|
139
158
|
'watchedUrls',
|
|
140
159
|
'cohortFilter',
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
// Submissions: the notifications a Site sent to a search engine, and what
|
|
2
|
+
// Google reported afterwards. The `submissions`, `submissionOutcomes` and
|
|
3
|
+
// `submissionsRollup` Indexing capabilities return these shapes. Outcomes
|
|
4
|
+
// anchor where gscdump's `listSiteSubmissionOutcomes` anchors them. The
|
|
5
|
+
// summary counts differently from `getSiteSubmissionSummary`: gscdump adds up
|
|
6
|
+
// every receipt, so a URL sent twice counts twice. Here each URL counts once
|
|
7
|
+
// per engine, by its latest Submission Receipt. gscdump's summary cannot say
|
|
8
|
+
// which URLs repeat, so a site builds `IndexingSubmissionSummary` from its
|
|
9
|
+
// receipt lists.
|
|
10
|
+
//
|
|
11
|
+
// Rules every section keeps:
|
|
12
|
+
// - An accepted receipt proves the engine received the URL. Nothing more.
|
|
13
|
+
// - "Afterwards" is order in time. It never says the Submission caused it.
|
|
14
|
+
// - No indexing timeframe.
|
|
15
|
+
// - A Submission is a notification sent to a search engine. A sitemap URL is
|
|
16
|
+
// never "submitted".
|
|
17
|
+
|
|
18
|
+
/** The window every Submission count covers, in days. */
|
|
19
|
+
export const SUBMISSION_WINDOW_DAYS = 30
|
|
20
|
+
|
|
21
|
+
/** Where a Submission went: IndexNow, or Google's Indexing API. */
|
|
22
|
+
export type IndexingSubmissionEngine = 'indexnow' | 'google'
|
|
23
|
+
|
|
24
|
+
/** Who started a Submission: a person or agent (`manual`), or Automatic sending. */
|
|
25
|
+
export type IndexingSubmissionTrigger = 'manual' | 'automatic'
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* What a receipt says about delivery. `accepted` is HTTP 200 from the engine.
|
|
29
|
+
* `in-progress` is queued, scheduled for retry, or an IndexNow key still in
|
|
30
|
+
* validation (HTTP 202). `failed` is a rejection or a delivery that stopped.
|
|
31
|
+
*/
|
|
32
|
+
export type IndexingReceiptState = 'accepted' | 'in-progress' | 'failed'
|
|
33
|
+
|
|
34
|
+
/** One engine's Submissions in the window. */
|
|
35
|
+
export interface IndexingSubmissionEngineTotals {
|
|
36
|
+
readonly engine: IndexingSubmissionEngine
|
|
37
|
+
/** Distinct URLs sent. A URL sent twice counts once, by its latest receipt. */
|
|
38
|
+
readonly urls: number
|
|
39
|
+
/** `accepted + inProgress + failed` is `urls`. */
|
|
40
|
+
readonly accepted: number
|
|
41
|
+
readonly inProgress: number
|
|
42
|
+
readonly failed: number
|
|
43
|
+
/** `manual + automatic` is `urls`, by the latest receipt's trigger. */
|
|
44
|
+
readonly manual: number
|
|
45
|
+
readonly automatic: number
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Why one automatic check left changed URLs unsent. */
|
|
49
|
+
export type IndexingAutomaticTruncation = 'daily-limit' | 'scan-limit'
|
|
50
|
+
|
|
51
|
+
/** The last sitemap update Automatic sending checked. */
|
|
52
|
+
export interface IndexingAutomaticCheck {
|
|
53
|
+
readonly checkedAt: string
|
|
54
|
+
/** New URLs and URLs with a changed `lastmod`. */
|
|
55
|
+
readonly changedUrls: number
|
|
56
|
+
readonly sentUrls: number
|
|
57
|
+
readonly completeness:
|
|
58
|
+
| { readonly _tag: 'complete' }
|
|
59
|
+
| { readonly _tag: 'truncated', readonly reasons: readonly IndexingAutomaticTruncation[] }
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* IndexNow Automatic sending. `key-unverified` is on, with nothing sent until
|
|
64
|
+
* the key file verifies again.
|
|
65
|
+
*/
|
|
66
|
+
export type IndexingAutomaticSending
|
|
67
|
+
= | { readonly _tag: 'off' }
|
|
68
|
+
| { readonly _tag: 'on', readonly since: string, readonly lastCheck: IndexingAutomaticCheck | null }
|
|
69
|
+
| { readonly _tag: 'key-unverified', readonly since: string, readonly lastCheck: IndexingAutomaticCheck | null }
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Whether the counts cover the whole window. `partial` means the source
|
|
73
|
+
* stopped reading receipts before the window start: the counts cover the
|
|
74
|
+
* `receipts` most recent receipts only.
|
|
75
|
+
*/
|
|
76
|
+
export type IndexingSubmissionCompleteness
|
|
77
|
+
= | { readonly _tag: 'complete' }
|
|
78
|
+
| { readonly _tag: 'partial', readonly receipts: number }
|
|
79
|
+
|
|
80
|
+
/** A Site's Submissions over the last `days` days. The `submissions` read. */
|
|
81
|
+
export interface IndexingSubmissionSummary {
|
|
82
|
+
/** The window start, an ISO date-time. */
|
|
83
|
+
readonly since: string
|
|
84
|
+
readonly days: number
|
|
85
|
+
/** One entry per engine the site can send to, even with no URL sent. An engine the site cannot send to is absent. */
|
|
86
|
+
readonly engines: readonly IndexingSubmissionEngineTotals[]
|
|
87
|
+
/** Null when the Site has no IndexNow key, so Automatic sending cannot turn on. */
|
|
88
|
+
readonly automaticSending: IndexingAutomaticSending | null
|
|
89
|
+
readonly completeness: IndexingSubmissionCompleteness
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** One Submission of one URL. */
|
|
93
|
+
export interface IndexingSubmissionSend {
|
|
94
|
+
readonly engine: IndexingSubmissionEngine
|
|
95
|
+
readonly trigger: IndexingSubmissionTrigger
|
|
96
|
+
readonly state: IndexingReceiptState
|
|
97
|
+
/** When the receipt was created. */
|
|
98
|
+
readonly sentAt: string
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Google's latest URL Inspection result for a sent URL, from a check made
|
|
103
|
+
* after the URL's newest Submission in the window that the engine received:
|
|
104
|
+
* IndexNow at HTTP 200 or HTTP 202, or Google accepted. gscdump anchors its
|
|
105
|
+
* outcomes the same way. A result checked before that Submission does not
|
|
106
|
+
* count: the URL reads `not-inspected`. A URL that no engine received stays
|
|
107
|
+
* out of the totals. A source may still return its row, anchored on its newest
|
|
108
|
+
* Submission, so the timeline shows the Submission that failed.
|
|
109
|
+
*/
|
|
110
|
+
export type IndexingGoogleAfterwards
|
|
111
|
+
= | { readonly _tag: 'not-inspected' }
|
|
112
|
+
| { readonly _tag: 'indexed', readonly checkedAt: string, readonly crawledAt: string | null }
|
|
113
|
+
| { readonly _tag: 'not-indexed', readonly checkedAt: string, readonly crawledAt: string | null, readonly reason: string | null }
|
|
114
|
+
|
|
115
|
+
/** One sent URL: its Submissions and what Google reported afterwards. */
|
|
116
|
+
export interface IndexingSubmissionOutcome {
|
|
117
|
+
readonly url: string
|
|
118
|
+
/** Its Submissions in the window, oldest first. */
|
|
119
|
+
readonly sends: readonly IndexingSubmissionSend[]
|
|
120
|
+
readonly afterwards: IndexingGoogleAfterwards
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** A not-indexed reason, as Google words its coverage state, and its URL count. */
|
|
124
|
+
export interface IndexingSubmissionReason {
|
|
125
|
+
readonly reason: string
|
|
126
|
+
readonly urls: number
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** What the `submissionOutcomes` read filters by. */
|
|
130
|
+
export interface IndexingSubmissionOutcomesParams {
|
|
131
|
+
/** One URL: return only its row, matched exactly or across a trailing slash. Absent reads every sent URL. */
|
|
132
|
+
readonly url?: string
|
|
133
|
+
/** Outcome rows to return. `0` returns only the totals. */
|
|
134
|
+
readonly limit?: number
|
|
135
|
+
readonly offset?: number
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** Sent URLs and Google's results afterwards. The `submissionOutcomes` read. */
|
|
139
|
+
export interface IndexingSubmissionOutcomes {
|
|
140
|
+
readonly since: string
|
|
141
|
+
readonly days: number
|
|
142
|
+
/** Distinct URLs sent in the window that match the filter. */
|
|
143
|
+
readonly sent: number
|
|
144
|
+
/**
|
|
145
|
+
* The URLs the totals cover: `indexed + notIndexed + notInspected`. Below
|
|
146
|
+
* `sent` when the source could not check every sent URL, or when no engine
|
|
147
|
+
* received some of them.
|
|
148
|
+
*/
|
|
149
|
+
readonly checked: number
|
|
150
|
+
readonly indexed: number
|
|
151
|
+
readonly notIndexed: number
|
|
152
|
+
readonly notInspected: number
|
|
153
|
+
/** The not-indexed URLs by Google's reason, most URLs first. */
|
|
154
|
+
readonly reasons: readonly IndexingSubmissionReason[]
|
|
155
|
+
/** One page of rows, most recently sent first. */
|
|
156
|
+
readonly outcomes: readonly IndexingSubmissionOutcome[]
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** Submissions per Site across the Portfolio. The `submissionsRollup` read. */
|
|
160
|
+
export interface IndexingSubmissionsRollup {
|
|
161
|
+
readonly since: string
|
|
162
|
+
readonly days: number
|
|
163
|
+
/**
|
|
164
|
+
* By `IndexingSite.id`. `urls` counts distinct URLs sent to any engine;
|
|
165
|
+
* `failed` counts those whose latest Submission Receipt on some engine
|
|
166
|
+
* failed. A Site the source read with no Submissions has zeros; a Site it
|
|
167
|
+
* could not read is absent.
|
|
168
|
+
*/
|
|
169
|
+
readonly sites: Readonly<Record<string, { readonly urls: number, readonly failed: number }>>
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** One dated event on a URL's Submission timeline. */
|
|
173
|
+
export type IndexingSubmissionEvent
|
|
174
|
+
= | { readonly _tag: 'sent', readonly at: string, readonly send: IndexingSubmissionSend }
|
|
175
|
+
| { readonly _tag: 'crawled', readonly at: string }
|
|
176
|
+
| { readonly _tag: 'indexed', readonly at: string }
|
|
177
|
+
| { readonly _tag: 'not-indexed', readonly at: string, readonly reason: string | null }
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* A URL's timeline: each Submission, Google's crawl, and Google's result,
|
|
181
|
+
* oldest first. Events sort by date, so a crawl before the first Submission
|
|
182
|
+
* shows before it. Ties keep sent, crawled, result order.
|
|
183
|
+
*/
|
|
184
|
+
export function submissionTimeline(outcome: IndexingSubmissionOutcome): IndexingSubmissionEvent[] {
|
|
185
|
+
const events: IndexingSubmissionEvent[] = outcome.sends.map(send => ({ _tag: 'sent', at: send.sentAt, send }))
|
|
186
|
+
const afterwards = outcome.afterwards
|
|
187
|
+
if (afterwards._tag !== 'not-inspected') {
|
|
188
|
+
if (afterwards.crawledAt)
|
|
189
|
+
events.push({ _tag: 'crawled', at: afterwards.crawledAt })
|
|
190
|
+
events.push(afterwards._tag === 'indexed'
|
|
191
|
+
? { _tag: 'indexed', at: afterwards.checkedAt }
|
|
192
|
+
: { _tag: 'not-indexed', at: afterwards.checkedAt, reason: afterwards.reason })
|
|
193
|
+
}
|
|
194
|
+
return events
|
|
195
|
+
.map((event, index) => ({ event, index, time: Date.parse(event.at) }))
|
|
196
|
+
.sort((a, b) => (a.time - b.time) || (a.index - b.index))
|
|
197
|
+
.map(({ event }) => event)
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/** The Submissions summed across a summary's engines. */
|
|
201
|
+
export function submissionTotals(summary: IndexingSubmissionSummary): Omit<IndexingSubmissionEngineTotals, 'engine'> {
|
|
202
|
+
return summary.engines.reduce(
|
|
203
|
+
(sum, engine) => ({
|
|
204
|
+
urls: sum.urls + engine.urls,
|
|
205
|
+
accepted: sum.accepted + engine.accepted,
|
|
206
|
+
inProgress: sum.inProgress + engine.inProgress,
|
|
207
|
+
failed: sum.failed + engine.failed,
|
|
208
|
+
manual: sum.manual + engine.manual,
|
|
209
|
+
automatic: sum.automatic + engine.automatic,
|
|
210
|
+
}),
|
|
211
|
+
{ urls: 0, accepted: 0, inProgress: 0, failed: 0, manual: 0, automatic: 0 },
|
|
212
|
+
)
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const SUBMISSION_DATE = new Intl.DateTimeFormat('en-US', { month: 'short', day: 'numeric', year: 'numeric', timeZone: 'UTC' })
|
|
216
|
+
|
|
217
|
+
/** A Submission date as "Nov 18, 2026", in UTC, so the server and the browser agree. */
|
|
218
|
+
export function formatSubmissionDate(iso: string): string {
|
|
219
|
+
const time = Date.parse(iso)
|
|
220
|
+
return Number.isNaN(time) ? iso : SUBMISSION_DATE.format(time)
|
|
221
|
+
}
|