@nuxtseo/pro-indexing 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -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` and mirror the gscdump operations `getSiteSubmissionSummary` and `listSiteSubmissionOutcomes`, so a site that reads those maps them as they are.
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 first Submission in the window. A result checked before it reads `not-inspected`. `checked` below `sent` says the totals cover fewer URLs than the Site sent, for example when the source caps its lookups. 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
 
@@ -63,22 +63,22 @@ 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 NEW_LABEL = copy.changes.opened
67
- const CLEARED_LABEL = copy.changes.cleared
68
- const SAMPLED_COUNTS = copy.changes.sampledCounts
69
- // Amber and blue, by the bars' side of the zero line. Green would read as a repair.
70
- const newColor = indexingVizColors.notIndexed
71
- const clearedColor = indexingVizColors.crawled
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.opened, (d: IndexingChangesDay) => -d.cleared]
75
- const barColors = [newColor.color, clearedColor.color]
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.cleared), 0),
81
- Math.max(...days.value.map(day => day.opened), 1),
80
+ -Math.max(...days.value.map(day => day.dropped), 0),
81
+ Math.max(...days.value.map(day => day.indexed), 1),
82
82
  ])
83
83
  // Counts are whole numbers, so the axis never labels a fraction. The step is a
84
84
  // 1, 2, or 5 multiple of a power of 10, and never below 1.
@@ -116,8 +116,8 @@ function crosshairTemplate(d: IndexingChangesDay): string {
116
116
  </div>`
117
117
  return `<div style="display:flex;flex-direction:column;gap:4px;min-width:140px;padding:2px">
118
118
  <div style="color:var(--ui-text-dimmed);font-size:12px">${dayLabel(d.day)}</div>
119
- ${row(NEW_LABEL, d.opened, newColor.color)}
120
- ${row(CLEARED_LABEL, d.cleared, clearedColor.color)}
119
+ ${row(INDEXED_LABEL, d.indexed, indexedColor.color)}
120
+ ${row(DROPPED_LABEL, d.dropped, droppedColor.color)}
121
121
  </div>`
122
122
  }
123
123
 
@@ -177,12 +177,12 @@ function retryFailed() {
177
177
  </p>
178
178
  <ul class="flex flex-wrap gap-x-3 gap-y-1" :aria-label="copy.changes.legendLabel">
179
179
  <li class="flex items-center gap-1.5 text-xs text-muted">
180
- <span class="size-2 shrink-0 rounded-full" :class="newColor.dot" aria-hidden="true" />
181
- {{ NEW_LABEL }}
180
+ <span class="size-2 shrink-0 rounded-full" :class="indexedColor.dot" aria-hidden="true" />
181
+ {{ INDEXED_LABEL }}
182
182
  </li>
183
183
  <li class="flex items-center gap-1.5 text-xs text-muted">
184
- <span class="size-2 shrink-0 rounded-full" :class="clearedColor.dot" aria-hidden="true" />
185
- {{ CLEARED_LABEL }}
184
+ <span class="size-2 shrink-0 rounded-full" :class="droppedColor.dot" aria-hidden="true" />
185
+ {{ DROPPED_LABEL }}
186
186
  </li>
187
187
  </ul>
188
188
 
@@ -224,6 +224,10 @@ function retryFailed() {
224
224
  </template>
225
225
  </ClientOnly>
226
226
  </div>
227
+ <!-- Visible, not a tooltip: a bar's day can trail the change by months. -->
228
+ <p class="text-xs text-muted" data-changes-note>
229
+ {{ copy.changes.checkDates }}
230
+ </p>
227
231
 
228
232
  <div class="sr-only">
229
233
  <!-- eslint-disable-next-line vue/no-restricted-syntax -- The hidden chart equivalent is the documented raw-table exception. -->
@@ -235,10 +239,10 @@ function retryFailed() {
235
239
  {{ copy.changes.day }}
236
240
  </th>
237
241
  <th scope="col">
238
- {{ NEW_LABEL }}
242
+ {{ INDEXED_LABEL }}
239
243
  </th>
240
244
  <th scope="col">
241
- {{ CLEARED_LABEL }}
245
+ {{ DROPPED_LABEL }}
242
246
  </th>
243
247
  </tr>
244
248
  </thead>
@@ -247,31 +251,31 @@ function retryFailed() {
247
251
  <th scope="row">
248
252
  {{ dayLabel(day.day) }}
249
253
  </th>
250
- <td>{{ formatNumber(day.opened) }}</td>
251
- <td>{{ formatNumber(day.cleared) }}</td>
254
+ <td>{{ formatNumber(day.indexed) }}</td>
255
+ <td>{{ formatNumber(day.dropped) }}</td>
252
256
  </tr>
253
257
  </tbody>
254
258
  </table>
255
259
  </div>
256
260
  </section>
257
261
 
258
- <!-- Below sm the cells pad less, the Site name truncates, and the sampled
259
- headers wrap, so Site, Change, First recorded, and Cleared fit 375px. -->
262
+ <!-- Below sm the cells pad less, the Site name truncates, and the inspection
263
+ headers wrap, so Site, Change, Newly indexed, and Dropped from index fit 375px. -->
260
264
  <UiTableShell :label="copy.changes.tableLabel" size="xs" bordered row-hover>
261
265
  <template #head>
262
266
  <UiTableTh no-padding class="px-1.5 py-2.5 sm:px-3">
263
267
  {{ copy.changes.site }}
264
268
  </UiTableTh>
265
269
  <UiTableTh numeric visible-from="sm">
266
- {{ copy.changes.notIndexed }}
270
+ {{ copy.changes.indexed }}
267
271
  </UiTableTh>
268
272
  <UiTableTh numeric no-padding class="px-1.5 py-2.5 sm:px-3">
269
273
  {{ copy.changes.change }}
270
274
  </UiTableTh>
271
275
  <!-- The label variant's (?) trigger is 24px and the primitive fixes its
272
276
  size, so the whole header is the trigger: 44px tall on mobile. -->
273
- <UiTableTh v-for="label in [NEW_LABEL, CLEARED_LABEL]" :key="label" numeric no-padding class="px-1.5 py-1 sm:px-3 sm:py-2.5">
274
- <UiTooltip :title="label" :description="SAMPLED_COUNTS" trigger-as="button">
277
+ <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">
278
+ <UiTooltip :title="label" :description="INSPECTION_SOURCE" trigger-as="button">
275
279
  <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
280
  {{ label }}
277
281
  <UiIcon name="life-buoy" class="size-3 shrink-0 text-dimmed" aria-hidden="true" />
@@ -293,24 +297,24 @@ function retryFailed() {
293
297
  <UiTableTd size="xs" numeric visible-from="sm">
294
298
  <UiSkeleton v-if="!row.level && isRowPending(row.siteId)" class="ml-auto h-5" :index="1" :base="40" :range="0" />
295
299
  <template v-else>
296
- {{ row.level ? formatNumber(row.level.notIndexed) : '—' }}
300
+ {{ row.level ? formatNumber(row.level.indexed) : '—' }}
297
301
  </template>
298
302
  </UiTableTd>
299
303
  <UiTableTd size="xs" numeric no-padding class="px-1.5 sm:px-3">
300
304
  <UiSkeleton v-if="!row.level && isRowPending(row.siteId)" class="ml-auto h-5" :index="2" :base="48" :range="0" />
301
305
  <span v-else-if="row.level" class="inline-flex flex-col items-end sm:flex-row sm:items-baseline sm:gap-1.5">
302
306
  <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 > 0 ? 'text-warning' : ''">{{ changeFormat.format(row.level.change) }}</span>
307
+ <span class="font-medium" :class="row.level.change < 0 ? 'text-warning' : ''">{{ changeFormat.format(row.level.change) }}</span>
304
308
  </span>
305
309
  <template v-else>
306
310
  —
307
311
  </template>
308
312
  </UiTableTd>
309
313
  <UiTableTd size="xs" numeric no-padding class="px-1.5 sm:px-3">
310
- {{ formatNumber(row.opened) }}
314
+ {{ formatNumber(row.indexed) }}
311
315
  </UiTableTd>
312
316
  <UiTableTd size="xs" numeric no-padding class="px-1.5 sm:px-3">
313
- {{ formatNumber(row.cleared) }}
317
+ {{ formatNumber(row.dropped) }}
314
318
  </UiTableTd>
315
319
  </tr>
316
320
  </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>
@@ -18,6 +18,7 @@ import { parseIndexingUrlsQuery } from '../../shared/urls-query'
18
18
  import { useIndexingSource } from '../composables/useIndexingSource'
19
19
  import { useProIndexingCopy } from '../composables/useProIndexingCopy'
20
20
  import IndexingCrawlPipeline from './IndexingCrawlPipeline.vue'
21
+ import IndexingSubmissionTimeline from './IndexingSubmissionTimeline.vue'
21
22
  import IndexingUrlsTableShell from './IndexingUrlsTableShell.vue'
22
23
 
23
24
  // One Site's inspected URLs: issue filter, status filter, search, pages, the
@@ -41,6 +42,7 @@ const { site, pageSize = 25, shell, forceSkeleton = false } = defineProps<{
41
42
  }>()
42
43
 
43
44
  const source = useIndexingSource()
45
+ const hasSubmissionOutcomes = !!source?.submissionOutcomes
44
46
  const copy = useProIndexingCopy().urls
45
47
  const siteRef = () => site ?? null
46
48
  const TableShell = computed(() => shell ?? IndexingUrlsTableShell)
@@ -925,6 +927,9 @@ function indexingUrlId(row: GscdumpIndexingUrl): string {
925
927
  <span class="text-xs" :class="url.verdict === 'PASS' ? 'text-muted' : 'text-default'">{{ url.coverageState }}</span>
926
928
  </div>
927
929
 
930
+ <!-- Submissions of this URL, with the `submissionOutcomes` capability -->
931
+ <IndexingSubmissionTimeline v-if="hasSubmissionOutcomes" :site="site" :url="url.url" class="mb-3" />
932
+
928
933
  <!-- Detail grid -->
929
934
  <div class="idx-detail-grid">
930
935
  <!-- Crawler -->
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuxtseo/pro-indexing",
3
3
  "type": "module",
4
- "version": "0.1.7",
4
+ "version": "0.1.8",
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.7",
41
- "@nuxtseo/pro-shell": "^0.1.7",
40
+ "@nuxtseo/design-system": "^0.1.8",
41
+ "@nuxtseo/pro-shell": "^0.1.8",
42
42
  "@vueuse/core": "^14.0.0 || ^15.0.0",
43
43
  "nuxt": "^4.6.0",
44
44
  "typescript": ">=5.8.0 <7",
@@ -52,8 +52,8 @@
52
52
  "@gscdump/contracts": "7.13.0",
53
53
  "@gscdump/sdk": "7.13.0",
54
54
  "@nuxt/ui": "^4.11.1",
55
- "@nuxtseo/design-system": "0.1.7",
56
- "@nuxtseo/pro-shell": "0.1.7",
55
+ "@nuxtseo/design-system": "0.1.8",
56
+ "@nuxtseo/pro-shell": "0.1.8",
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 with different strengths. A Site's trend counts every URL, so it
7
- // owns the not-indexed change. The roll-up reads a page issue index, which can
8
- // hold a sample of URLs per reason on a large Site: its counts are floors, and
9
- // a URL can enter that sample long after Google reported it. So first recorded
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
- /** Issues the source first reported on this day. */
21
- readonly opened: number
22
- /** Issues the source stopped reporting on this day. This says nothing about a repair. */
23
- readonly cleared: number
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
- notIndexed: number
43
- /** Positive means more URLs are not indexed. */
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
- opened: number
52
- cleared: number
49
+ dropped: number
50
+ indexed: number
53
51
  }
54
52
 
55
53
  export interface IndexingChangesSiteRow {
56
54
  siteId: string
57
55
  label: string
58
- opened: number
59
- cleared: number
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 not-indexed rise first. Unknown levels sort last. */
64
+ /** Sites with a change, largest indexed loss first. Unknown levels sort last. */
67
65
  sites: IndexingChangesSiteRow[]
68
66
  }
69
67
 
@@ -75,15 +73,14 @@ 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
- /** The not-indexed change across the window, or null without two days to compare. */
76
+ /** The indexed change across the window, or null without two days to compare. */
79
77
  export function indexingLevelChange(trend: readonly IndexingTrendReading[], from: string): IndexingLevelChange | null {
80
78
  const points = trend.filter(point => point.totalUrls > 0 && point.date >= from).toSorted((a, b) => a.date.localeCompare(b.date))
81
79
  const first = points[0]
82
80
  const last = points.at(-1)
83
81
  if (!first || !last || first === last)
84
82
  return null
85
- const notIndexed = notIndexedCount(last)
86
- return { notIndexed, change: notIndexed - notIndexedCount(first), since: first.date }
83
+ return { indexed: last.indexedCount, change: last.indexedCount - first.indexedCount, since: first.date }
87
84
  }
88
85
 
89
86
  /**
@@ -92,12 +89,12 @@ export function indexingLevelChange(trend: readonly IndexingTrendReading[], from
92
89
  */
93
90
  export function summarizeIndexingChanges(rollup: IndexingChangesRollup, sites: readonly IndexingChangesSite[]): IndexingChanges {
94
91
  const axis = windowAxis(rollup.through, rollup.windowDays)
95
- const days = new Map(axis.map(day => [day, { day, opened: 0, cleared: 0 }]))
92
+ const days = new Map(axis.map(day => [day, { day, dropped: 0, indexed: 0 }]))
96
93
  const bySite = new Map<string, IndexingChangesSiteRow>(sites.map(site => [site.id, {
97
94
  siteId: site.id,
98
95
  label: site.label,
99
- opened: 0,
100
- cleared: 0,
96
+ dropped: 0,
97
+ indexed: 0,
101
98
  level: site.trend ? indexingLevelChange(site.trend, axis[0]!) : null,
102
99
  }]))
103
100
 
@@ -107,10 +104,10 @@ export function summarizeIndexingChanges(rollup: IndexingChangesRollup, sites: r
107
104
  const site = bySite.get(row.siteId)
108
105
  if (!day || !site)
109
106
  continue
110
- day.opened += row.opened
111
- day.cleared += row.cleared
112
- site.opened += row.opened
113
- site.cleared += row.cleared
107
+ day.dropped += row.dropped
108
+ day.indexed += row.indexed
109
+ site.dropped += row.dropped
110
+ site.indexed += row.indexed
114
111
  }
115
112
 
116
113
  return {
@@ -118,7 +115,7 @@ export function summarizeIndexingChanges(rollup: IndexingChangesRollup, sites: r
118
115
  sites: [...bySite.values()]
119
116
  // A Site with a trend but nothing to compare stays, as unknown. Dropping it
120
117
  // would read as no change.
121
- .filter(site => site.opened > 0 || site.cleared > 0 || !!site.level?.change || (!site.level && withTrend.has(site.siteId)))
122
- .sort((a, b) => (b.level?.change ?? Number.NEGATIVE_INFINITY) - (a.level?.change ?? Number.NEGATIVE_INFINITY) || b.opened - a.opened || a.label.localeCompare(b.label)),
118
+ .filter(site => site.dropped > 0 || site.indexed > 0 || !!site.level?.change || (!site.level && withTrend.has(site.siteId)))
119
+ .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
120
  }
124
121
  }
package/shared/copy.ts CHANGED
@@ -18,9 +18,9 @@ const DEFAULTS = {
18
18
  },
19
19
  overview: {
20
20
  indexedTitle: 'Indexed',
21
- indexedTooltip: 'Share of submitted URLs that Google has indexed.',
21
+ indexedTooltip: 'Share of reported URLs that Google has indexed.',
22
22
  notIndexedTitle: 'Not indexed',
23
- notIndexedTooltip: 'Submitted URLs Google has not indexed.',
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 submitted URL is indexed, so there is nothing to break down.',
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
- opened: 'First recorded',
58
- cleared: 'Cleared',
57
+ newlyIndexed: 'Newly indexed',
58
+ dropped: 'Dropped from index',
59
59
  legendLabel: 'Chart legend',
60
- chartLabel: 'First recorded issues above zero and cleared issues below zero, per day',
61
- chartCaption: 'First recorded and cleared issues per day',
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
- notIndexed: 'Not indexed',
65
+ indexed: 'Indexed',
66
66
  change: 'Change',
67
67
  since: 'since {date}',
68
- sampledCounts: 'Reads up to 100 URLs per reason on a large Site, so this count can be below the real total.',
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: 'Search Console reported no change in not indexed URLs, and no recorded or cleared issues, for these Sites in the last {days} days.',
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 sent, from a check made after it was sent. Not inspected yet means no check since then. It shows what happened next. It does not show that sending caused it.',
144
+ afterwardsScope: 'Of {count} URLs sent',
145
+ afterwardsScopeOne: 'Of 1 URL sent',
146
+ afterwardsPartial: 'Google results 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,213 @@
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. They mirror
4
+ // the gscdump operations `getSiteSubmissionSummary` and
5
+ // `listSiteSubmissionOutcomes`, so a site that reads those maps them as they
6
+ // are. A site that cannot read them yet builds them from its receipt lists.
7
+ //
8
+ // Rules every section keeps:
9
+ // - An accepted receipt proves the engine received the URL. Nothing more.
10
+ // - "Afterwards" is order in time. It never says the Submission caused it.
11
+ // - No indexing timeframe.
12
+ // - A Submission is a notification sent to a search engine. A sitemap URL is
13
+ // never "submitted".
14
+
15
+ /** The window every Submission count covers, in days. */
16
+ export const SUBMISSION_WINDOW_DAYS = 30
17
+
18
+ /** Where a Submission went: IndexNow, or Google's Indexing API. */
19
+ export type IndexingSubmissionEngine = 'indexnow' | 'google'
20
+
21
+ /** Who started a Submission: a person or agent (`manual`), or Automatic sending. */
22
+ export type IndexingSubmissionTrigger = 'manual' | 'automatic'
23
+
24
+ /**
25
+ * What a receipt says about delivery. `accepted` is HTTP 200 from the engine.
26
+ * `in-progress` is queued, scheduled for retry, or an IndexNow key still in
27
+ * validation (HTTP 202). `failed` is a rejection or a delivery that stopped.
28
+ */
29
+ export type IndexingReceiptState = 'accepted' | 'in-progress' | 'failed'
30
+
31
+ /** One engine's Submissions in the window. */
32
+ export interface IndexingSubmissionEngineTotals {
33
+ readonly engine: IndexingSubmissionEngine
34
+ /** Distinct URLs sent. A URL sent twice counts once, by its latest receipt. */
35
+ readonly urls: number
36
+ /** `accepted + inProgress + failed` is `urls`. */
37
+ readonly accepted: number
38
+ readonly inProgress: number
39
+ readonly failed: number
40
+ /** `manual + automatic` is `urls`, by the latest receipt's trigger. */
41
+ readonly manual: number
42
+ readonly automatic: number
43
+ }
44
+
45
+ /** Why one automatic check left changed URLs unsent. */
46
+ export type IndexingAutomaticTruncation = 'daily-limit' | 'scan-limit'
47
+
48
+ /** The last sitemap update Automatic sending checked. */
49
+ export interface IndexingAutomaticCheck {
50
+ readonly checkedAt: string
51
+ /** New URLs and URLs with a changed `lastmod`. */
52
+ readonly changedUrls: number
53
+ readonly sentUrls: number
54
+ readonly completeness:
55
+ | { readonly _tag: 'complete' }
56
+ | { readonly _tag: 'truncated', readonly reasons: readonly IndexingAutomaticTruncation[] }
57
+ }
58
+
59
+ /**
60
+ * IndexNow Automatic sending. `key-unverified` is on, with nothing sent until
61
+ * the key file verifies again.
62
+ */
63
+ export type IndexingAutomaticSending
64
+ = | { readonly _tag: 'off' }
65
+ | { readonly _tag: 'on', readonly since: string, readonly lastCheck: IndexingAutomaticCheck | null }
66
+ | { readonly _tag: 'key-unverified', readonly since: string, readonly lastCheck: IndexingAutomaticCheck | null }
67
+
68
+ /**
69
+ * Whether the counts cover the whole window. `partial` means the source
70
+ * stopped reading receipts before the window start: the counts cover the
71
+ * `receipts` most recent receipts only.
72
+ */
73
+ export type IndexingSubmissionCompleteness
74
+ = | { readonly _tag: 'complete' }
75
+ | { readonly _tag: 'partial', readonly receipts: number }
76
+
77
+ /** A Site's Submissions over the last `days` days. The `submissions` read. */
78
+ export interface IndexingSubmissionSummary {
79
+ /** The window start, an ISO date-time. */
80
+ readonly since: string
81
+ readonly days: number
82
+ /** One entry per engine the site can send to, even with no URL sent. An engine the site cannot send to is absent. */
83
+ readonly engines: readonly IndexingSubmissionEngineTotals[]
84
+ /** Null when the Site has no IndexNow key, so Automatic sending cannot turn on. */
85
+ readonly automaticSending: IndexingAutomaticSending | null
86
+ readonly completeness: IndexingSubmissionCompleteness
87
+ }
88
+
89
+ /** One Submission of one URL. */
90
+ export interface IndexingSubmissionSend {
91
+ readonly engine: IndexingSubmissionEngine
92
+ readonly trigger: IndexingSubmissionTrigger
93
+ readonly state: IndexingReceiptState
94
+ /** When the receipt was created. */
95
+ readonly sentAt: string
96
+ }
97
+
98
+ /**
99
+ * Google's latest URL Inspection result for a sent URL, from a check made
100
+ * after the URL's first Submission in the window. A result checked before
101
+ * that Submission does not count: the URL reads `not-inspected`.
102
+ */
103
+ export type IndexingGoogleAfterwards
104
+ = | { readonly _tag: 'not-inspected' }
105
+ | { readonly _tag: 'indexed', readonly checkedAt: string, readonly crawledAt: string | null }
106
+ | { readonly _tag: 'not-indexed', readonly checkedAt: string, readonly crawledAt: string | null, readonly reason: string | null }
107
+
108
+ /** One sent URL: its Submissions and what Google reported afterwards. */
109
+ export interface IndexingSubmissionOutcome {
110
+ readonly url: string
111
+ /** Its Submissions in the window, oldest first. */
112
+ readonly sends: readonly IndexingSubmissionSend[]
113
+ readonly afterwards: IndexingGoogleAfterwards
114
+ }
115
+
116
+ /** A not-indexed reason, as Google words its coverage state, and its URL count. */
117
+ export interface IndexingSubmissionReason {
118
+ readonly reason: string
119
+ readonly urls: number
120
+ }
121
+
122
+ /** What the `submissionOutcomes` read filters by. */
123
+ export interface IndexingSubmissionOutcomesParams {
124
+ /** One URL: return only its row, matched exactly or across a trailing slash. Absent reads every sent URL. */
125
+ readonly url?: string
126
+ /** Outcome rows to return. `0` returns only the totals. */
127
+ readonly limit?: number
128
+ readonly offset?: number
129
+ }
130
+
131
+ /** Sent URLs and Google's results afterwards. The `submissionOutcomes` read. */
132
+ export interface IndexingSubmissionOutcomes {
133
+ readonly since: string
134
+ readonly days: number
135
+ /** Distinct URLs sent in the window that match the filter. */
136
+ readonly sent: number
137
+ /**
138
+ * The URLs the totals cover: `indexed + notIndexed + notInspected`. Below
139
+ * `sent` when the source could not check every sent URL.
140
+ */
141
+ readonly checked: number
142
+ readonly indexed: number
143
+ readonly notIndexed: number
144
+ readonly notInspected: number
145
+ /** The not-indexed URLs by Google's reason, most URLs first. */
146
+ readonly reasons: readonly IndexingSubmissionReason[]
147
+ /** One page of rows, most recently sent first. */
148
+ readonly outcomes: readonly IndexingSubmissionOutcome[]
149
+ }
150
+
151
+ /** Submissions per Site across the Portfolio. The `submissionsRollup` read. */
152
+ export interface IndexingSubmissionsRollup {
153
+ readonly since: string
154
+ readonly days: number
155
+ /**
156
+ * By `IndexingSite.id`. `urls` counts distinct URLs sent to any engine;
157
+ * `failed` counts those whose latest Submission Receipt on some engine
158
+ * failed. A Site the source read with no Submissions has zeros; a Site it
159
+ * could not read is absent.
160
+ */
161
+ readonly sites: Readonly<Record<string, { readonly urls: number, readonly failed: number }>>
162
+ }
163
+
164
+ /** One dated event on a URL's Submission timeline. */
165
+ export type IndexingSubmissionEvent
166
+ = | { readonly _tag: 'sent', readonly at: string, readonly send: IndexingSubmissionSend }
167
+ | { readonly _tag: 'crawled', readonly at: string }
168
+ | { readonly _tag: 'indexed', readonly at: string }
169
+ | { readonly _tag: 'not-indexed', readonly at: string, readonly reason: string | null }
170
+
171
+ /**
172
+ * A URL's timeline: each Submission, Google's crawl, and Google's result,
173
+ * oldest first. Events sort by date, so a crawl before the first Submission
174
+ * shows before it. Ties keep sent, crawled, result order.
175
+ */
176
+ export function submissionTimeline(outcome: IndexingSubmissionOutcome): IndexingSubmissionEvent[] {
177
+ const events: IndexingSubmissionEvent[] = outcome.sends.map(send => ({ _tag: 'sent', at: send.sentAt, send }))
178
+ const afterwards = outcome.afterwards
179
+ if (afterwards._tag !== 'not-inspected') {
180
+ if (afterwards.crawledAt)
181
+ events.push({ _tag: 'crawled', at: afterwards.crawledAt })
182
+ events.push(afterwards._tag === 'indexed'
183
+ ? { _tag: 'indexed', at: afterwards.checkedAt }
184
+ : { _tag: 'not-indexed', at: afterwards.checkedAt, reason: afterwards.reason })
185
+ }
186
+ return events
187
+ .map((event, index) => ({ event, index, time: Date.parse(event.at) }))
188
+ .sort((a, b) => (a.time - b.time) || (a.index - b.index))
189
+ .map(({ event }) => event)
190
+ }
191
+
192
+ /** The Submissions summed across a summary's engines. */
193
+ export function submissionTotals(summary: IndexingSubmissionSummary): Omit<IndexingSubmissionEngineTotals, 'engine'> {
194
+ return summary.engines.reduce(
195
+ (sum, engine) => ({
196
+ urls: sum.urls + engine.urls,
197
+ accepted: sum.accepted + engine.accepted,
198
+ inProgress: sum.inProgress + engine.inProgress,
199
+ failed: sum.failed + engine.failed,
200
+ manual: sum.manual + engine.manual,
201
+ automatic: sum.automatic + engine.automatic,
202
+ }),
203
+ { urls: 0, accepted: 0, inProgress: 0, failed: 0, manual: 0, automatic: 0 },
204
+ )
205
+ }
206
+
207
+ const SUBMISSION_DATE = new Intl.DateTimeFormat('en-US', { month: 'short', day: 'numeric', year: 'numeric', timeZone: 'UTC' })
208
+
209
+ /** A Submission date as "Nov 18, 2026", in UTC, so the server and the browser agree. */
210
+ export function formatSubmissionDate(iso: string): string {
211
+ const time = Date.parse(iso)
212
+ return Number.isNaN(time) ? iso : SUBMISSION_DATE.format(time)
213
+ }