# Agentic upgrade instructions

This file contains structured instructions for AI assistants helping consumers upgrade to this version of the package.

## Automated migrations

Run the automated migration tool first to apply all available codemods for this release:

```bash
dt-app update @dynatrace/strato-components
```

Sections marked **Automated by codemod** below have already been applied — verify the result rather than applying them manually. Sections marked **Opt-in feature** are new features that need a decision from the consumer. All other sections require manual code changes.

## Modes

Assume unattended mode unless the consumer is clearly present in the session.

**Unattended.** Apply the codemod results and the required migrations. Skip every section whose first line starts with `> **Opt-in feature:**`. Do not make decisions for the consumer.

**Attended.** Finish the codemod results and the required migrations first. Then handle each opt-in section in turn:

1. Run the section's **Detect** step over the consumer's repository.
2. If nothing matches, mention the section in one line and move on.
3. If there are matches, show the section title and the match count. List each match with `file:line` and the proposed diff from the **Propose** step, then ask the question from the **Ask** step.
4. Do not edit anything before the consumer answers. Apply only the changes they accept.

End with a summary that lists the sections applied, declined, uncertain and without matches. Do not write declined sections to the repository.

---

Each section below corresponds to a change in this release that requires consumer attention. Sections are separated by `---`.

## Opt-in features in this release

1. Non-interactive DataTable rows
2. Size limit for automatic EmptyState
3. EmptyState presets

---

> **Opt-in feature:** Non-interactive DataTable rows. No existing code requires migration.

**Detect.** Find every `DataTable` from `@dynatrace/strato-components/tables` that sets `interactiveRows`. Include aliased imports and local wrappers around `DataTable`. Look for code that works around rows that must not react to the user, for example handlers such as `onActiveRowChange` that return early for certain rows, or styles that remove pointer events from certain rows. Skip tables without `interactiveRows`. If you cannot tell whether a guard exists to disable a row or for another reason, list the site as uncertain and do not propose a change.

**Propose.** Pass a `disableRowInteractivity` function in the `interactiveRows` object. It receives the row data and returns `true` for rows that must not be interactive. Remove the workaround it replaces.

```tsx
import { DataTable } from '@dynatrace/strato-components/tables';

<DataTable
  columns={columns}
  data={variables}
  interactiveRows={{
    disableRowInteractivity: (row) => !row.trusted,
  }}
/>;
```

**Ask.** For each match, show `file:line` and the diff. Tell the consumer that disabled rows show no hover, active or focus effects, are skipped by keyboard navigation and don't call `onActiveRowChange`. Row actions, cell actions and other interactive elements inside the row stay interactive. Ask whether to apply the change to all matches, to selected ones, or to none.

---

> **Opt-in feature:** Size limit for automatic EmptyState. No existing code requires migration.

**Detect.** Find every `EmptyState` from `@dynatrace/strato-components/content` that uses `size="auto"`. Include aliased imports and local wrappers. Relevant sites are those where the empty state sits in a container that is often larger than the content needs, or where a wrapper limits its height or width to keep it small. Skip any `EmptyState` with a fixed `size`. If you cannot tell whether a limit is wanted, list the site as uncertain and do not propose a change.

**Propose.** Set `maxSize` to `'small'`, `'default'` or `'large'`. `maxSize` defaults to `'large'` and is only allowed with `size="auto"`.

```tsx
<EmptyState size="auto" maxSize="default" />
```

**Ask.** For each match, show `file:line` and suggest a `maxSize`. Tell the consumer that the empty state stops growing at that size even when the container is larger. Ask whether to apply the change to all matches, to selected ones, or to none.

---

> **Opt-in feature:** EmptyState presets. No existing code requires migration.

**Detect.** Find every `EmptyState` from `@dynatrace/strato-components/content` that builds a common situation by hand with its own visual, title and description. The presets cover these reasons: `something-missing`, `no-result`, `something-wrong`, `create-new`, `cancelled` and `no-permission`. Include aliased imports and local wrappers. Skip empty states whose content is specific to the app. If you cannot tell which reason fits, list the site as uncertain and do not propose a change.

**Propose.** Set the `preset` prop to the matching reason. Slots you pass replace the matching default.

```tsx
import { Button } from '@dynatrace/strato-components/buttons';
import { EmptyState } from '@dynatrace/strato-components/content';

<EmptyState preset="something-wrong">
  <EmptyState.Actions>
    <Button>Try again</Button>
  </EmptyState.Actions>
</EmptyState>;
```

To change the visual context or hide the visual, pass an object, for example `preset={{ reason: 'something-wrong', context: 'table' }}` or `preset={{ reason: 'something-wrong', showVisual: false }}`.

For the `no-permission` preset, pass the missing permissions to include them in the copyable details for an admin: `preset={{ reason: 'no-permission', missingPermissions: ['storage:logs:read'] }}`. To hide the Playground link, set `showPlaygroundLink: false`.

**Ask.** For each match, show `file:line` and the diff. Tell the consumer that the preset supplies its own visual, title and description, so the existing texts are replaced unless the matching slot is kept. Ask whether to apply the change to all matches, to selected ones, or to none.
