Commit Graph
3 Commits
Author SHA1 Message Date
Danny White 476d4a5851 refactor(ui): drop redundant Button variant="default" props (#50161)
## What kind of change does this PR introduce?

Mechanical cleanup on top of the Button default-variant change (#50160).

## What is the current behavior?

Many callsites still pass `variant="default"` even though that is now
the component default.

## What is the new behavior?

Removes redundant static `variant="default"` from legacy `Button` and
`ButtonTooltip` callsites. Keeps explicit defaults where they document
the API:

- `button-default.tsx` and `button-sizes.tsx` demos
- `DocsButton`, which pins neutral styling at the wrapper boundary

## To test

Studio:

- [Auth → Rate
Limits](https://studio-staging-2s957kwc4-supabase.vercel.app/dashboard/project/_/auth/rate-limits):
dirty the form so Cancel appears; Cancel stays neutral, Save stays green
- [Project Settings → API
Keys](https://studio-staging-2s957kwc4-supabase.vercel.app/dashboard/project/_/settings/api-keys):
`DocsButton` in the header actions stays neutral

Design system:

- [Design system →
Button](https://design-system-git-dnywh-dc924ac1-supabase.vercel.app/design-system/docs/components/button):
`button-default` / `button-sizes` still show explicit default styling;
Primary (green) is restricted to the Primary section (and `asChild`)

WWW:

- [www → Brand
assets](https://zone-www-dot-com-git-dnywh-dc924ac1-supabase.vercel.app/brand-assets):
Download logo kit / Download button kit stay neutral
2026-09-11 17:05:26 +10:00
Gildas GarciaandIvan Vasilov 96d43099bb chore: refactor Button API so that it can be used a standard button (#46880)
## Problem

Our `<Button>` component breaks the default `button` contract by
redefining the `type` prop to set its variant (`primary`, `default`,
etc) instead of the button type (`submit`, `button`, etc).
This is confusing and forces to write more code when using it with
shadcn components that expect/inject the standard button props.

## Solution

- rename the `type` prop to `variant`
- rename the `htmlType` prop to `type`
- propagate the changes where necessary
- format code

## How to test

As this is just prop renaming, if it builds it's ok

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2026-06-16 23:59:58 +02:00
TaishiandJoshen Lim a8f6d85c49 Add message deletion functionality to AI Assistant (#37698)
* add delete chat message functionality

* Implement message editing functionality in AIAssistant

* add functionality to delete messages in AI Assistant chat in assistant state

* remove duplicated `text-xs` class

* add a 'group' class for improved styling and refining action button visibility on hover

* Refine action button visibility in AIAssistantPanel to show only for user messages on hover, improving user experience.

* remove `"` from the message to edit

* Enhance editing message display in AIAssistantPanel by updating styling for improved visibility and user experience.

* Refactor AIAssistantPanel state management by simplifying original message content initialization and clarifying comments for better code readability.

* clean up action button rendering in AIAssistantPanel message component

* adjust the chat message layout (space)

* simplify the editing mode message

* show the edit button even when user is already in the edit mode

* Update AssistantChatForm styling for editing mode, positioning the editing message above the input field without changing the layout

* use `ButtonTooltip` for edit button to show tooltip

* simplify the condiiton to show the edit buton

* add the delete action button

* Refactor action button rendering in AIAssistantPanel to improve clarity and maintainability. Ensure buttons are only shown for user messages on hover, and simplify the conditional rendering logic.

* Remove commented-out code for cleaner implementation.

* improve unused onDeleteAfter prop and consolidating delete logic into a single `deleteMessageFromHere` function for improved clarity

* abort streaming when a user deletes  a message

* delete unnecessary `originalMessageContent` state variable

* delete `confirmEdit` and move its logic into `sendMessageToAssistant`

* add `strokeWidth={1.5}` to `Pencil` icon

* add `opacity-50` to any messages that are after the message being edited, and it cancels the edit when those messages are clicked

* add a pulse animation to the user’s message being edited

* add more space between mesages and `AssistantChatForm`

* add framer-motion animation to `Editing message` element

* update strokeWidth of Trash2 icon in Message component for better visibility

* refactor Message component to make onDelete prop required

* add `DeleteMessageConfirmModal` for message deletion confirmation in Message component

* refactor message deletion logic in AIAssistant component to streamline editing process

* cancel editing when a user clicks the edit button again or the edit button in subsequent messages

* Add success toast notification for message deletion

* add Pencil icon to AIAssistantPanel component and fixed duplicated tailwind class

* Update AIAssistantPanel to use the Pencil icon

* Refactor AIAssistant to set editing message content from text parts

* Remove unused `reload` prop from AIAssistant component

* `setIsSticky(false)` when a user deletes all the messages or clear the chat to remove the `ArrowDown` icon scroll down button

* refactor: remove deleteMessagesBefore function from AiAssistantState

* refactor: simplify AssistantChatForm layout by removing unnecessary `z-index`

* enable the input field when a user wants to edit the message while the response is streaming

* Smol fixes

* remove conosle log

* Add state for resubmitting in AI Assistant panel

* Remove classes that hide the focus styles + fix focusing when editing message to ensure cursor is at the end of the text

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-08-25 17:51:29 +08:00