Files
Danny White d458429081 fix(studio): clarify pipeline validation feedback (#52055)
## Problem

Pipeline review shows validation failures below the cost estimate, far
from the settings that need changes. Publication-loading failures also
appear in several places with conflicting retry instructions.

## Solution

Attach full-width errors and warnings to their Connection or Data
sections. Keep the current scroll position and show description-only
guidance above the footer. Consolidate publication-loading failures into
one Data-step error with Continue to retry, preserving the existing
sheet behaviour.

_The main fix, spreading out the error and warnings to their respective
sections:_

| Before | After |
| --- | --- |
| <img width="1280" height="1522" alt="New Pipeline Supabase"
src="https://github.com/user-attachments/assets/36df1814-e73f-4440-b338-79b672431c60"
/> | <img width="1280" height="1522" alt="15619"
src="https://github.com/user-attachments/assets/08e39cdd-0e69-4318-b992-dfa81ad8a6c2"
/> |
| _All at bottom_ | _Attached to each section_ |

_Misc fixes for API blocks:_

| Before | After |
| --- | --- |
| <img width="1516" height="1350" alt="CleanShot 2026-10-21 at 15 19
24@2x"
src="https://github.com/user-attachments/assets/56ac9cf7-9c30-4129-8fbc-2708f35a51b9"
/> | <img width="1520" height="1232" alt="CleanShot 2026-10-21 at 15 22
56@2x"
src="https://github.com/user-attachments/assets/c4f4b039-38de-4af0-9bb9-b487ff6ddb63"
/> |

## To test

1. Enable **Pipeline creation wizard** in Feature Previews and open
`/project/<ref>/database/pipelines/new`. Complete Connection and Data to
reach Review.
2. In Chrome DevTools → Network, right-click a captured POST ending
`/replication/<ref>/destinations/validate` (Connection) or
`/replication/<ref>/pipelines/validate` (Data), then select **Override
content**. Reach Review before enabling the destination override. Keep
HTTP status **200** and save:

```json
{"validation_failures":[{"name":"Test validation issue","reason":"Test failure for the review screen.","failure_type":"critical"}]}
```

3. Click **Start pipeline**. Expect a flush Admonition at the bottom of
the matching section and danger guidance above the footer, without
automatic scrolling. Change `critical` to `warning` to check warning
guidance and **Start pipeline anyway**. Edit and retry to confirm values
persist.
4. On Data, block the GET ending
`/replication/v2/<ref>/sources/<id>/publications/<name>`. Expect one
flush publication-loading failure above the footer, including with
Advanced settings open. **Continue** retries; remove the block and retry
to recover.
5. Check desktop and phone widths. Stop before confirming creation, then
remove overrides and request blocks.
2026-10-22 00:07:06 +00:00

43 lines
1.5 KiB
TypeScript

import type { UseFormReturn } from 'react-hook-form'
import { AdvancedSettings } from '../DestinationPanel/DestinationForm/AdvancedSettings'
import type { DestinationPanelSchemaType } from '../DestinationPanel/DestinationForm/DestinationForm.schema'
import { PublicationSelection } from '../DestinationPanel/DestinationForm/PublicationSelection'
import { TableCopySelection } from '../DestinationPanel/DestinationForm/TableCopySelection'
import type { DestinationType } from '../DestinationPanel/DestinationPanel.types'
export const PipelineDataSection = ({
type,
form,
onSelectNewPublication,
revealInvalidSettings = false,
showLoadError = true,
}: {
type: DestinationType
form: UseFormReturn<DestinationPanelSchemaType>
onSelectNewPublication: () => void
revealInvalidSettings?: boolean
showLoadError?: boolean
}) => (
<section aria-label="Data">
<div className="p-5 flex flex-col gap-y-6">
<h3 className="text-sm font-medium text-foreground">Data</h3>
<div className="flex flex-col gap-y-4">
<PublicationSelection
form={form}
onSelectNewPublication={onSelectNewPublication}
showLoadError={showLoadError}
/>
<TableCopySelection form={form} editMode={false} showLoadError={showLoadError} />
</div>
</div>
<AdvancedSettings
type={type}
form={form}
group="data"
revealInvalidSettings={revealInvalidSettings}
showLoadError={showLoadError}
/>
</section>
)