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:
31 files changed
+3350
-1887
No files matched your search
@@ -27,7 +27,10 @@ const usePersistedExpansionState = (itemName: string) => {
|
||||
|
||||
const setPersistedExpansion = (expanded: boolean) => {
|
||||
setIsExpanded(expanded);
|
||||
sessionStorage.setItem(`nav-expansion-${itemName}`, JSON.stringify(expanded));
|
||||
sessionStorage.setItem(
|
||||
`nav-expansion-${itemName}`,
|
||||
JSON.stringify(expanded)
|
||||
);
|
||||
};
|
||||
|
||||
return [isExpanded, setPersistedExpansion] as const;
|
||||
@@ -64,8 +67,16 @@ export type NavigationItemType = {
|
||||
}) => boolean;
|
||||
};
|
||||
|
||||
const defaultIsCurrent: NavigationItemType["isCurrent"] = ({ isChild, item, pathname }) => {
|
||||
return isChild ? item.href === pathname : item.href ? pathname?.startsWith(item.href) ?? false : false;
|
||||
const defaultIsCurrent: NavigationItemType["isCurrent"] = ({
|
||||
isChild,
|
||||
item,
|
||||
pathname,
|
||||
}) => {
|
||||
return isChild
|
||||
? item.href === pathname
|
||||
: item.href
|
||||
? pathname?.startsWith(item.href) ?? false
|
||||
: false;
|
||||
};
|
||||
|
||||
export const NavigationItem: React.FC<{
|
||||
@@ -76,9 +87,12 @@ export const NavigationItem: React.FC<{
|
||||
const { item, isChild } = props;
|
||||
const { t, isLocaleReady } = useLocale();
|
||||
const pathname = usePathname();
|
||||
const isCurrent: NavigationItemType["isCurrent"] = item.isCurrent || defaultIsCurrent;
|
||||
const isCurrent: NavigationItemType["isCurrent"] =
|
||||
item.isCurrent || defaultIsCurrent;
|
||||
const current = isCurrent({ isChild: !!isChild, item, pathname });
|
||||
const shouldDisplayNavigationItem = useShouldDisplayNavigationItem(props.item);
|
||||
const shouldDisplayNavigationItem = useShouldDisplayNavigationItem(
|
||||
props.item
|
||||
);
|
||||
const [isExpanded, setIsExpanded] = usePersistedExpansionState(item.name);
|
||||
|
||||
const isTablet = useMediaQuery("(max-width: 1024px)");
|
||||
@@ -88,8 +102,12 @@ export const NavigationItem: React.FC<{
|
||||
|
||||
const hasChildren = item.child && item.child.length > 0;
|
||||
const hasActiveChild =
|
||||
hasChildren && item.child?.some((child) => isCurrent({ isChild: true, item: child, pathname }));
|
||||
const shouldShowChildren = isExpanded || hasActiveChild || isCurrent({ pathname, isChild, item });
|
||||
hasChildren &&
|
||||
item.child?.some((child) =>
|
||||
isCurrent({ isChild: true, item: child, pathname })
|
||||
);
|
||||
const shouldShowChildren =
|
||||
isExpanded || hasActiveChild || isCurrent({ pathname, isChild, item });
|
||||
const shouldShowChevron = hasChildren && !hasActiveChild;
|
||||
const isParentNavigationItem = hasChildren && !isChild;
|
||||
|
||||
@@ -109,8 +127,16 @@ export const NavigationItem: React.FC<{
|
||||
{item.child?.map((childItem) => {
|
||||
const childIsCurrent =
|
||||
typeof childItem.isCurrent === "function"
|
||||
? childItem.isCurrent({ isChild: true, item: childItem, pathname })
|
||||
: defaultIsCurrent({ isChild: true, item: childItem, pathname });
|
||||
? childItem.isCurrent({
|
||||
isChild: true,
|
||||
item: childItem,
|
||||
pathname,
|
||||
})
|
||||
: defaultIsCurrent({
|
||||
isChild: true,
|
||||
item: childItem,
|
||||
pathname,
|
||||
});
|
||||
return (
|
||||
<Link
|
||||
key={childItem.name}
|
||||
@@ -125,7 +151,8 @@ export const NavigationItem: React.FC<{
|
||||
childIsCurrent
|
||||
? "bg-emphasis text-white"
|
||||
: "hover:bg-emphasis text-mute hover:text-emphasis"
|
||||
)}>
|
||||
)}
|
||||
>
|
||||
{t(childItem.name)}
|
||||
</Link>
|
||||
);
|
||||
@@ -136,7 +163,8 @@ export const NavigationItem: React.FC<{
|
||||
t(item.name)
|
||||
)
|
||||
}
|
||||
className="lg:hidden">
|
||||
className="lg:hidden"
|
||||
>
|
||||
<button
|
||||
data-test-id={item.name}
|
||||
aria-label={t(item.name)}
|
||||
@@ -155,7 +183,8 @@ export const NavigationItem: React.FC<{
|
||||
isLocaleReady
|
||||
? "hover:bg-subtle todesktop:[&[aria-current='page']]:bg-emphasis todesktop:hover:bg-transparent hover:text-emphasis"
|
||||
: ""
|
||||
)}>
|
||||
)}
|
||||
>
|
||||
{item.icon && (
|
||||
<Icon
|
||||
name={item.isLoading ? "rotate-cw" : item.icon}
|
||||
@@ -169,7 +198,8 @@ export const NavigationItem: React.FC<{
|
||||
{isLocaleReady ? (
|
||||
<span
|
||||
className="hidden w-full justify-between truncate text-ellipsis lg:flex"
|
||||
data-testid={`${item.name}-test`}>
|
||||
data-testid={`${item.name}-test`}
|
||||
>
|
||||
{t(item.name)}
|
||||
{item.badge && item.badge}
|
||||
</span>
|
||||
@@ -177,7 +207,10 @@ export const NavigationItem: React.FC<{
|
||||
<SkeletonText className="h-[20px] w-full" />
|
||||
)}
|
||||
{shouldShowChevron && (
|
||||
<Icon name={isExpanded ? "chevron-up" : "chevron-down"} className="ml-auto h-4 w-4" />
|
||||
<Icon
|
||||
name={isExpanded ? "chevron-up" : "chevron-down"}
|
||||
className="ml-auto h-4 w-4"
|
||||
/>
|
||||
)}
|
||||
</button>
|
||||
</Tooltip>
|
||||
@@ -196,14 +229,17 @@ export const NavigationItem: React.FC<{
|
||||
: `[&[aria-current='page']]:bg-emphasis`,
|
||||
isChild
|
||||
? `[&[aria-current='page']]:text-emphasis [&[aria-current='page']]:bg-emphasis hidden h-8 pl-16 lg:flex lg:pl-11 ${
|
||||
props.index === 0 ? "mt-0" : "mt-1 hover:mt-1 [&[aria-current='page']]:mt-1"
|
||||
props.index === 0
|
||||
? "mt-0"
|
||||
: "mt-1 hover:mt-1 [&[aria-current='page']]:mt-1"
|
||||
}`
|
||||
: "[&[aria-current='page']]:text-emphasis mt-0.5 text-sm",
|
||||
isLocaleReady
|
||||
? "hover:bg-subtle todesktop:[&[aria-current='page']]:bg-emphasis todesktop:hover:bg-transparent hover:text-emphasis"
|
||||
: ""
|
||||
)}
|
||||
aria-current={current ? "page" : undefined}>
|
||||
aria-current={current ? "page" : undefined}
|
||||
>
|
||||
{item.icon && (
|
||||
<Icon
|
||||
name={item.isLoading ? "rotate-cw" : item.icon}
|
||||
@@ -218,24 +254,22 @@ export const NavigationItem: React.FC<{
|
||||
{isLocaleReady ? (
|
||||
<span
|
||||
className="hidden w-full justify-between truncate text-ellipsis lg:flex"
|
||||
data-testid={`${item.name}-test`}>
|
||||
data-testid={`${item.name}-test`}
|
||||
>
|
||||
{t(item.name)}
|
||||
{item.badge && item.badge}
|
||||
</span>
|
||||
) : (
|
||||
<SkeletonText className="h-[20px] w-full" />
|
||||
)}
|
||||
{item.name === "workflows" && (
|
||||
<Badge startIcon="sparkles" variant="purple">
|
||||
Cal.ai
|
||||
</Badge>
|
||||
)}
|
||||
</Link>
|
||||
</Tooltip>
|
||||
)}
|
||||
{item.child &&
|
||||
shouldShowChildren &&
|
||||
item.child.map((item, index) => <NavigationItem index={index} key={item.name} item={item} isChild />)}
|
||||
item.child.map((item, index) => (
|
||||
<NavigationItem index={index} key={item.name} item={item} isChild />
|
||||
))}
|
||||
</Fragment>
|
||||
);
|
||||
};
|
||||
@@ -247,9 +281,12 @@ export const MobileNavigationItem: React.FC<{
|
||||
const { item, isChild } = props;
|
||||
const pathname = usePathname();
|
||||
const { t, isLocaleReady } = useLocale();
|
||||
const isCurrent: NavigationItemType["isCurrent"] = item.isCurrent || defaultIsCurrent;
|
||||
const isCurrent: NavigationItemType["isCurrent"] =
|
||||
item.isCurrent || defaultIsCurrent;
|
||||
const current = isCurrent({ isChild: !!isChild, item, pathname });
|
||||
const shouldDisplayNavigationItem = useShouldDisplayNavigationItem(props.item);
|
||||
const shouldDisplayNavigationItem = useShouldDisplayNavigationItem(
|
||||
props.item
|
||||
);
|
||||
|
||||
if (!shouldDisplayNavigationItem) return null;
|
||||
return (
|
||||
@@ -258,7 +295,8 @@ export const MobileNavigationItem: React.FC<{
|
||||
href={item.href}
|
||||
target={item.target}
|
||||
className="[&[aria-current='page']]:text-emphasis hover:text-default text-muted bg-transparent! relative my-2 min-w-0 flex-1 overflow-hidden rounded-md p-1 text-center text-xs font-medium focus:z-10 sm:text-sm"
|
||||
aria-current={current ? "page" : undefined}>
|
||||
aria-current={current ? "page" : undefined}
|
||||
>
|
||||
{item.badge && <div className="absolute right-1 top-1">{item.badge}</div>}
|
||||
{item.icon && (
|
||||
<Icon
|
||||
@@ -268,7 +306,11 @@ export const MobileNavigationItem: React.FC<{
|
||||
aria-current={current ? "page" : undefined}
|
||||
/>
|
||||
)}
|
||||
{isLocaleReady ? <span className="block truncate">{t(item.name)}</span> : <SkeletonText />}
|
||||
{isLocaleReady ? (
|
||||
<span className="block truncate">{t(item.name)}</span>
|
||||
) : (
|
||||
<SkeletonText />
|
||||
)}
|
||||
</Link>
|
||||
);
|
||||
};
|
||||
@@ -279,7 +321,9 @@ export const MobileNavigationMoreItem: React.FC<{
|
||||
}> = (props) => {
|
||||
const { item } = props;
|
||||
const { t, isLocaleReady } = useLocale();
|
||||
const shouldDisplayNavigationItem = useShouldDisplayNavigationItem(props.item);
|
||||
const shouldDisplayNavigationItem = useShouldDisplayNavigationItem(
|
||||
props.item
|
||||
);
|
||||
const [isExpanded, setIsExpanded] = usePersistedExpansionState(item.name);
|
||||
|
||||
if (!shouldDisplayNavigationItem) return null;
|
||||
@@ -292,14 +336,22 @@ export const MobileNavigationMoreItem: React.FC<{
|
||||
<>
|
||||
<button
|
||||
onClick={() => setIsExpanded(!isExpanded)}
|
||||
className="hover:bg-subtle flex w-full items-center justify-between p-5 text-left transition">
|
||||
className="hover:bg-subtle flex w-full items-center justify-between p-5 text-left transition"
|
||||
>
|
||||
<span className="text-default flex items-center font-semibold">
|
||||
{item.icon && (
|
||||
<Icon name={item.icon} className="h-5 w-5 shrink-0 ltr:mr-3 rtl:ml-3" aria-hidden="true" />
|
||||
<Icon
|
||||
name={item.icon}
|
||||
className="h-5 w-5 shrink-0 ltr:mr-3 rtl:ml-3"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
)}
|
||||
{isLocaleReady ? t(item.name) : <SkeletonText />}
|
||||
</span>
|
||||
<Icon name={isExpanded ? "chevron-up" : "chevron-down"} className="text-subtle h-5 w-5" />
|
||||
<Icon
|
||||
name={isExpanded ? "chevron-up" : "chevron-down"}
|
||||
className="text-subtle h-5 w-5"
|
||||
/>
|
||||
</button>
|
||||
{isExpanded && item.child && (
|
||||
<ul className="bg-subtle">
|
||||
@@ -307,7 +359,8 @@ export const MobileNavigationMoreItem: React.FC<{
|
||||
<li key={childItem.name} className="border-subtle border-t">
|
||||
<Link
|
||||
href={childItem.href}
|
||||
className="hover:bg-cal-muted flex items-center p-4 pl-12 transition">
|
||||
className="hover:bg-cal-muted flex items-center p-4 pl-12 transition"
|
||||
>
|
||||
<span className="text-default font-medium">
|
||||
{isLocaleReady ? t(childItem.name) : <SkeletonText />}
|
||||
</span>
|
||||
@@ -318,10 +371,17 @@ export const MobileNavigationMoreItem: React.FC<{
|
||||
)}
|
||||
</>
|
||||
) : (
|
||||
<Link href={item.href} className="hover:bg-subtle flex items-center justify-between p-5 transition">
|
||||
<Link
|
||||
href={item.href}
|
||||
className="hover:bg-subtle flex items-center justify-between p-5 transition"
|
||||
>
|
||||
<span className="text-default flex items-center font-semibold ">
|
||||
{item.icon && (
|
||||
<Icon name={item.icon} className="h-5 w-5 shrink-0 ltr:mr-3 rtl:ml-3" aria-hidden="true" />
|
||||
<Icon
|
||||
name={item.icon}
|
||||
className="h-5 w-5 shrink-0 ltr:mr-3 rtl:ml-3"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
)}
|
||||
{isLocaleReady ? t(item.name) : <SkeletonText />}
|
||||
</span>
|
||||
|
||||
Reference in new issue
Block a user