Skip to content

feat(action-panel): add variant prop to ActionItem for destructive styling#301

Merged
IzumiSy merged 1 commit into
mainfrom
feat/action-item-variant
Jun 3, 2026
Merged

feat(action-panel): add variant prop to ActionItem for destructive styling#301
IzumiSy merged 1 commit into
mainfrom
feat/action-item-variant

Conversation

@IzumiSy

@IzumiSy IzumiSy commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Add an optional variant prop to ActionItem so that dangerous actions (e.g. "Delete") can be styled with destructive (red) text color in the ActionPanel.

スクリーンショット 2026-06-02 10 53 36

Usage

<ActionPanel
  title="Actions"
  actions={[
    {
      key: "delete",
      label: "Delete Result",
      icon: <Trash2Icon />,
      variant: "destructive",
      onClick: handleDelete,
    },
  ]}
/>

Notes

Non-breaking: variant is optional and defaults to "default" (existing behavior unchanged)

@IzumiSy IzumiSy force-pushed the feat/action-item-variant branch from 0c02977 to f605fc6 Compare June 2, 2026 02:09
@IzumiSy IzumiSy self-assigned this Jun 2, 2026
@IzumiSy IzumiSy added the preview A trigger label to create preview build by pkg-pr-new label Jun 2, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jun 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/tailor-platform/app-shell/@tailor-platform/app-shell@f605fc6
pnpm add https://pkg.pr.new/tailor-platform/app-shell/@tailor-platform/app-shell-sdk-plugin@f605fc6
pnpm add https://pkg.pr.new/tailor-platform/app-shell/@tailor-platform/app-shell-vite-plugin@f605fc6

commit: f605fc6

@IzumiSy IzumiSy removed the preview A trigger label to create preview build by pkg-pr-new label Jun 2, 2026
@IzumiSy IzumiSy requested a review from a team June 2, 2026 03:06
@erickteowarang

Copy link
Copy Markdown
Contributor

If you click on the whole row, does it trigger the event? As in is it basically acting as a button now?

@IzumiSy

IzumiSy commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

If you click on the whole row, does it trigger the event? As in is it basically acting as a button now?

Yes. No change from the current behaviour of ActionPanel component.

@erickteowarang

erickteowarang commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Ah yeap, I checked the code and I can see it's semantically correct (it's a <button />)

I feel like we should enforce that if you add a "destructive" variant, it should require a confirmation modal to make sure. Doesn't have to be in this PR

@IzumiSy IzumiSy merged commit 98270c5 into main Jun 3, 2026
8 checks passed
@IzumiSy IzumiSy deleted the feat/action-item-variant branch June 3, 2026 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants