chore: UX Fixes (#26643)

* Copy changes

* Move search bar inline with new button

* Get rid of no more results message

* Change hidden badge to (hidden)

* Remove Cal.ai badge from sidebar

* Add dropdown to create button when there is multiple options

* Fix delete dialog

* Saved filters updates

* More string fixes

* Switch members table to use names

* Fix member spacing

* Fix routing form identifier field

* Fix routing forms stuff

* Only show SMS hint on SMS options

* Make workflow delete button minimal

* Fix padding on workflow steps

* Remove min width on workflow title

* Fix delete workflow PR

* Fix org profile buttons

* Fix org profile screen partially scrolled down

* Improve logos & banner uploads

* Personal profile fixes

* Fix settings general view stuff

* Sentence case consistency

* Fix stuff I broke

* Fix fab

* Fix hidden translation string

* Fix text fields

* Make button small for solo users too

* fix: update E2E tests to match sentence case labels in routing forms

* fix: update tests to match sentence case label changes

- insights.e2e.ts: chart titles (14 strings)
- event-types.e2e.ts: Organizer phone number location
- EditLocationDialog.test.tsx: phone number labels

* fix: address Cubic AI review feedback (confidence 9+)

- Replace hardcoded text-gray-500 with text-muted in TextField.tsx hint section
- Replace text locator with data-testid in E2E test for location select

Co-Authored-By: unknown <>

* fix: update E2E tests for sentence case label changes

- Use data-testid selectors for location options (more reliable than text)
- Update field identifiers in routing-forms tests to match new labels
- Fix Long text selector in manage-booking-questions test

* fix: replace text locator with data-testid in manage-booking-questions E2E test

Replace fragile text="Long text" locator with resilient
page.getByTestId("select-option-textarea") selector per E2E best practices.

Addresses Cubic AI review feedback (confidence 9/10).

Co-Authored-By: unknown <>

* fix: use .last() for multiple location select items

---------

Co-authored-by: Pedro Castro <[email protected]>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-01-13 00:56:08 -05:00
1 parent 32d97fbea4
commit 7c66f33de2
31 files changed
+3350 -1887

No files matched your search

@@ -12,7 +12,13 @@ import { Avatar } from "@calcom/ui/components/avatar";
import { Form } from "@calcom/ui/components/form";
import { ToggleGroup, Select } from "@calcom/ui/components/form";
import { Icon } from "@calcom/ui/components/icon";
import { Sheet, SheetContent, SheetFooter, SheetHeader, SheetBody } from "@calcom/ui/components/sheet";
import {
Sheet,
SheetContent,
SheetFooter,
SheetHeader,
SheetBody,
} from "@calcom/ui/components/sheet";
import { Skeleton, Loader } from "@calcom/ui/components/skeleton";
import { showToast } from "@calcom/ui/components/toast";
import { Tooltip } from "@calcom/ui/components/tooltip";
@@ -50,7 +56,9 @@ export function EditMemberSheet({
(state) => [state.editMode, state.setEditMode, state.setMutationLoading],
shallow
);
const [role, setRole] = useState<string>(selectedUser.customRoleId || selectedUser.role);
const [role, setRole] = useState<string>(
selectedUser.customRoleId || selectedUser.role
);
const name =
selectedUser.name ||
(() => {
@@ -61,16 +69,19 @@ export function EditMemberSheet({
const bookerUrl = selectedUser.bookerUrl;
const utils = trpc.useUtils();
const bookerUrlWithoutProtocol = bookerUrl.replace(/^https?:\/\//, "");
const bookingLink = selectedUser.username ? `${bookerUrlWithoutProtocol}/${selectedUser.username}` : "";
const bookingLink = selectedUser.username
? `${bookerUrlWithoutProtocol}/${selectedUser.username}`
: "";
// Load custom roles for the team
const { data: customRoles, isPending: isLoadingRoles } = trpc.viewer.pbac.getTeamRoles.useQuery(
{ teamId },
{
enabled: !!teamId,
retry: false, // Don't retry if PBAC is not enabled
}
);
const { data: customRoles, isPending: isLoadingRoles } =
trpc.viewer.pbac.getTeamRoles.useQuery(
{ teamId },
{
enabled: !!teamId,
retry: false, // Don't retry if PBAC is not enabled
}
);
const options = useMemo(() => {
// If we have custom roles, only show custom roles
@@ -95,7 +106,10 @@ export function EditMemberSheet({
label: t("owner"),
value: MembershipRole.OWNER,
},
].filter(({ value }) => value !== MembershipRole.OWNER || currentMember === MembershipRole.OWNER);
].filter(
({ value }) =>
value !== MembershipRole.OWNER || currentMember === MembershipRole.OWNER
);
}, [t, currentMember, customRoles]);
// Determine if we should use Select (when custom roles exist) or ToggleGroup (traditional only)
@@ -109,10 +123,11 @@ export function EditMemberSheet({
},
});
const { data: getUserConnectedApps, isPending } = trpc.viewer.teams.getUserConnectedApps.useQuery({
userIds: [selectedUser.id],
teamId,
});
const { data: getUserConnectedApps, isPending } =
trpc.viewer.teams.getUserConnectedApps.useQuery({
userIds: [selectedUser.id],
teamId,
});
const connectedApps = getUserConnectedApps?.[selectedUser.id];
@@ -191,21 +206,32 @@ export function EditMemberSheet({
onOpenChange={() => {
setEditMode(false);
dispatch({ type: "CLOSE_MODAL" });
}}>
}}
>
<SheetContent className="bg-cal-muted">
{!isPending && !isLoadingRoles ? (
<Form form={form} handleSubmit={changeRole} className="flex h-full flex-col">
<Form
form={form}
handleSubmit={changeRole}
className="flex h-full flex-col"
>
<SheetHeader showCloseButton={false} className="w-full">
<div className="border-sublte bg-default w-full rounded-xl border p-4">
<div className="border-subtle bg-default w-full rounded-xl border p-4">
<div
className="block w-full rounded-lg ring-1 ring-[#0000000F]"
style={{
background: "linear-gradient(to top right, var(--cal-bg-emphasis), var(--cal-bg))",
background:
"linear-gradient(to top right, var(--cal-bg-emphasis), var(--cal-bg))",
height: "110px",
}}
/>
<div className="bg-default ml-3 w-fit translate-y-[-50%] rounded-full p-1 ring-1 ring-[#0000000F]">
<Avatar asChild size="lg" alt={`${name} avatar`} imageSrc={selectedUser.avatarUrl} />
<Avatar
asChild
size="lg"
alt={`${name} avatar`}
imageSrc={selectedUser.avatarUrl}
/>
</div>
<Skeleton as="p" waitForTranslation={false}>
<h2 className="text-emphasis font-sans text-2xl font-semibold">
@@ -214,16 +240,28 @@ export function EditMemberSheet({
</Skeleton>
<Skeleton as="p" waitForTranslation={false}>
<p className="text-subtle max-h-[3em] overflow-hidden text-ellipsis text-sm font-normal">
{selectedUser.bio ? selectedUser?.bio : t("user_has_no_bio")}
{selectedUser.bio
? selectedUser?.bio
: t("user_has_no_bio")}
</p>
</Skeleton>
</div>
</SheetHeader>
<SheetBody className="stack-y-4 flex flex-col p-4">
<div className="stack-y-4 mb-4 flex flex-col">
<h3 className="text-emphasis mb-1 text-base font-semibold">{t("profile")}</h3>
<DisplayInfo label="Cal" value={bookingLink} icon="external-link" />
<DisplayInfo label={t("email")} value={selectedUser.email} icon="at-sign" />
<h3 className="text-emphasis mb-1 text-base font-semibold">
{t("profile")}
</h3>
<DisplayInfo
label="Cal"
value={bookingLink}
icon="external-link"
/>
<DisplayInfo
label={t("email")}
value={selectedUser.email}
icon="at-sign"
/>
{!editMode ? (
<DisplayInfo
label={t("role")}
@@ -239,7 +277,9 @@ export function EditMemberSheet({
<div className="flex flex-1">
{shouldUseSelect ? (
<Select
value={options.find((option) => option.value === form.watch("role"))}
value={options.find(
(option) => option.value === form.watch("role")
)}
onChange={(selectedOption: any) => {
if (selectedOption) {
form.setValue("role", selectedOption.value);
@@ -247,7 +287,9 @@ export function EditMemberSheet({
}}
options={options}
isDisabled={isLoadingRoles}
placeholder={isLoadingRoles ? t("loading") : t("select_role")}
placeholder={
isLoadingRoles ? t("loading") : t("select_role")
}
className="flex-1"
/>
) : (
@@ -267,7 +309,9 @@ export function EditMemberSheet({
<div className="flex items-center gap-6">
<div className="flex w-[110px] items-center gap-2">
<Icon className="text-subtle h-4 w-4" name="grid-3x3" />
<label className="text-subtle text-sm font-medium">{t("apps")}</label>
<label className="text-subtle text-sm font-medium">
{t("apps")}
</label>
</div>
<div className="flex flex-1">
{!connectedApps ? (
@@ -62,12 +62,22 @@ export function CreateButton(props: CreateBtnProps) {
const hasTeams = !!options.find((option) => option.teamId);
const platform = !!options.find((option) => option.platform);
const hasMultipleOptions = options.length > 1;
const isFabVariant = !disableMobileButton;
// On FAB variant, EndIcon shows as "plus" on mobile, so we remove StartIcon to avoid duplicate
// On button variant, both icons work correctly
const startIcon = isFabVariant && hasMultipleOptions ? undefined : "plus";
const endIcon = hasMultipleOptions ? "chevron-down" : undefined;
// inject selection data into url for correct router history
const openModal = (option: Option) => {
const _searchParams = new URLSearchParams(searchParams.toString());
function setParamsIfDefined(key: string, value: string | number | boolean | null | undefined) {
if (value !== undefined && value !== null) _searchParams.set(key, value.toString());
function setParamsIfDefined(
key: string,
value: string | number | boolean | null | undefined
) {
if (value !== undefined && value !== null)
_searchParams.set(key, value.toString());
}
setParamsIfDefined("dialog", "new");
setParamsIfDefined("eventPage", option.slug);
@@ -82,7 +92,6 @@ export function CreateButton(props: CreateBtnProps) {
<>
{!hasTeams && !platform ? (
<Button
size="sm"
onClick={() =>
CreateDialog
? openModal(options[0])
@@ -91,11 +100,17 @@ export function CreateButton(props: CreateBtnProps) {
: null
}
data-testid="create-button"
StartIcon="plus"
StartIcon={startIcon}
EndIcon={endIcon}
size="sm"
loading={isPending}
variant={disableMobileButton ? "button" : "fab"}
className={classNames(disableMobileButton && "md:min-h-min md:min-w-min", className)}
{...restProps}>
className={classNames(
disableMobileButton && "md:min-h-min md:min-w-min",
className
)}
{...restProps}
>
{buttonText ? buttonText : t("new")}
</Button>
) : (
@@ -103,16 +118,25 @@ export function CreateButton(props: CreateBtnProps) {
<DropdownMenuTrigger asChild>
<Button
variant={disableMobileButton ? "button" : "fab"}
StartIcon="plus"
StartIcon={startIcon}
EndIcon={endIcon}
size="sm"
data-testid="create-button-dropdown"
loading={isPending}
className={classNames(disableMobileButton && "md:min-h-min md:min-w-min", className)}
{...restProps}>
className={classNames(
disableMobileButton && "md:min-h-min md:min-w-min",
className
)}
{...restProps}
>
{buttonText ? buttonText : t("new")}
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent sideOffset={14} align="end" className="scroll-bar max-h-60 overflow-y-auto">
<DropdownMenuContent
sideOffset={14}
align="end"
className="scroll-bar max-h-60 overflow-y-auto"
>
<DropdownMenuLabel>
<div className="w-48 text-left text-xs">{subtitle}</div>
</DropdownMenuLabel>
@@ -121,14 +145,24 @@ export function CreateButton(props: CreateBtnProps) {
<DropdownItem
type="button"
data-testid={`option${option.teamId ? "-team" : ""}-${idx}`}
CustomStartIcon={<Avatar alt={option.label || ""} imageSrc={option.image} size="sm" />}
CustomStartIcon={
<Avatar
alt={option.label || ""}
imageSrc={option.image}
size="sm"
/>
}
onClick={() =>
CreateDialog
? openModal(option)
: createFunction
? createFunction(option.teamId || undefined, option.platform)
? createFunction(
option.teamId || undefined,
option.platform
)
: null
}>
}
>
{" "}
{/*improve this code */}
<span>{option.label}</span>