Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(ui): scroll bars, border radius, panels (#3311)

Fake-Userfb92ceab27bf
diff --git a/js/app/packages/app/component/FatalError.tsx b/js/app/packages/app/component/FatalError.tsx
index 58349bbe9a..99da9087f2 100644
--- a/js/app/packages/app/component/FatalError.tsx
+++ b/js/app/packages/app/component/FatalError.tsx
@@ -16,7 +16,7 @@ export function FatalError(props: FatalErrorProps) {
return (
<Dialog open position="center" class="w-120">
- <Surface active depth={2}>
+ <Surface active depth={2} class="rounded-xl">
<div class="p-6 sm:p-8 font-sans">
<div class="text-center">
<h1 class="text-ink text-lg/7 font-semibold mb-4">
diff --git a/js/app/packages/app/component/Launcher.tsx b/js/app/packages/app/component/Launcher.tsx
index 2027c3a93e..2d4d9126b4 100644
--- a/js/app/packages/app/component/Launcher.tsx
+++ b/js/app/packages/app/component/Launcher.tsx
@@ -669,7 +669,7 @@ export const LauncherInner = (props: LauncherInnerProps) => {
};
return (
- <div class="bg-surface ring-1 ring-edge-muted rounded-sm">
+ <div class="bg-surface ring-1 ring-edge-muted rounded-xl">
<div class="flex items-center justify-between p-2 px-6 border-b border-edge-muted">
<h1 class="font-bold text-ink-muted">Create New</h1>
<p class="gap-2 text-ink-extra-muted text-xs items-center hidden touch:hidden md:flex">
diff --git a/js/app/packages/app/component/app-sidebar/invite-modal.tsx b/js/app/packages/app/component/app-sidebar/invite-modal.tsx
index 235ca28ebd..7c681f2c27 100644
--- a/js/app/packages/app/component/app-sidebar/invite-modal.tsx
+++ b/js/app/packages/app/component/app-sidebar/invite-modal.tsx
@@ -67,7 +67,7 @@ export const InviteModal = () => {
return (
<Dialog open={inviteModalOpen()} onOpenChange={(o) => !o && handleClose()}>
- <Panel depth={2} active class="max-h-[75vh] text-ink">
+ <Panel depth={2} active class="max-h-[75vh] text-ink rounded-xl">
<Panel.Header class="px-2 gap-1">
<Dialog.CloseButton as={Button} variant="ghost" size="icon-sm">
<CloseIcon />
diff --git a/js/app/packages/app/component/bulk-edit-entity/BulkEditEntityModal.tsx b/js/app/packages/app/component/bulk-edit-entity/BulkEditEntityModal.tsx
index 3ef5794a94..865290f122 100644
--- a/js/app/packages/app/component/bulk-edit-entity/BulkEditEntityModal.tsx
+++ b/js/app/packages/app/component/bulk-edit-entity/BulkEditEntityModal.tsx
@@ -43,7 +43,7 @@ const BulkEditEntityModalContent = (props: {
props.setIsOpen(open);
}}
>
- <Surface depth={2} active>
+ <Surface depth={2} active class="rounded-xl">
<div class="*:max-h-[75vh]">
<div class="flex flex-col text-ink">
<Show when={props.view === 'rename'}>
diff --git a/js/app/packages/app/component/command/CommandMenu.tsx b/js/app/packages/app/component/command/CommandMenu.tsx
index 1355e8852b..7419fba67c 100644
--- a/js/app/packages/app/component/command/CommandMenu.tsx
+++ b/js/app/packages/app/component/command/CommandMenu.tsx
@@ -456,7 +456,7 @@ export function CommandMenuInner(props: {
return (
<Panel
- class={cn('max-h-[75vh]', props.class)}
+ class={cn('max-h-[75vh] rounded-xl', props.class)}
ref={setCommandMenuRef}
depth={props.depth}
active
diff --git a/js/app/packages/app/component/macro-mcp-setup-modal/MacroMcpSetupModal.tsx b/js/app/packages/app/component/macro-mcp-setup-modal/MacroMcpSetupModal.tsx
index 80bd4d85b6..9df3ffe13a 100644
--- a/js/app/packages/app/component/macro-mcp-setup-modal/MacroMcpSetupModal.tsx
+++ b/js/app/packages/app/component/macro-mcp-setup-modal/MacroMcpSetupModal.tsx
@@ -26,7 +26,7 @@ export function MacroMcpSetupModal() {
onOpenChange={setMacroMcpSetupOpen}
class="w-190"
>
- <Surface depth={2} active>
+ <Surface depth={2} active class="rounded-xl">
<div class="*:max-h-[75vh]">
<AiChatEmptyState />
</div>
diff --git a/js/app/packages/app/component/next-soup/soup-view/NewCallButton.tsx b/js/app/packages/app/component/next-soup/soup-view/NewCallButton.tsx
index 17f75fbc4c..ee086a877f 100644
--- a/js/app/packages/app/component/next-soup/soup-view/NewCallButton.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/NewCallButton.tsx
@@ -97,7 +97,7 @@ export function NewCallButton() {
}}
class="w-lg"
>
- <Surface depth={2} active>
+ <Surface depth={2} active class="rounded-xl">
<div class="*:max-h-[75vh]">
<div class="flex flex-col text-ink">
<div class="shrink-0 flex flex-row items-center px-2 gap-1 border-b border-b-edge-muted h-10">
diff --git a/js/app/packages/app/component/paywall/Paywall.tsx b/js/app/packages/app/component/paywall/Paywall.tsx
index 78e505cd6f..021fa5fb06 100644
--- a/js/app/packages/app/component/paywall/Paywall.tsx
+++ b/js/app/packages/app/component/paywall/Paywall.tsx
@@ -61,7 +61,7 @@ export function Paywall() {
position="center"
class="w-225"
>
- <Surface active depth={2}>
+ <Surface active depth={2} class="rounded-xl">
<div
class="*:max-h-[85vh] font-sans"
ref={paywallContentEl}
diff --git a/js/app/packages/app/component/property-edit-modal/PropertyEditorModal.tsx b/js/app/packages/app/component/property-edit-modal/PropertyEditorModal.tsx
index 9156851ee3..9d37ae5d21 100644
--- a/js/app/packages/app/component/property-edit-modal/PropertyEditorModal.tsx
+++ b/js/app/packages/app/component/property-edit-modal/PropertyEditorModal.tsx
@@ -149,7 +149,7 @@ export function PropertyEditorModal() {
onOpenChange={togglePropertyEditor}
contentRef={mergeRefs(attach, setDialogRef)}
>
- <Surface depth={2} active>
+ <Surface depth={2} active class="rounded-xl">
<div class="*:max-h-[75vh]">
<div class="flex flex-col max-h-108 overflow-hidden text-sm">
<div class="flex items-center gap-2 bg-surface px-2 h-10 border-b border-edge-muted shrink-0">
diff --git a/js/app/packages/app/component/settings/Account.tsx b/js/app/packages/app/component/settings/Account.tsx
index b2de762b6c..bc578a02fe 100644
--- a/js/app/packages/app/component/settings/Account.tsx
+++ b/js/app/packages/app/component/settings/Account.tsx
@@ -440,7 +440,7 @@ export function Account() {
position="center"
class="w-120"
>
- <Panel active depth={2}>
+ <Panel active depth={2} class="rounded-xl">
<Panel.Header class="px-6">
<Dialog.Title class="text-ink text-sm font-semibold">
Delete Account
@@ -471,7 +471,7 @@ export function Account() {
position="center"
class="w-120"
>
- <Panel active depth={2}>
+ <Panel active depth={2} class="rounded-xl">
<Panel.Header class="px-6">
<Dialog.Title class="text-ink text-sm font-semibold">
Are you absolutely sure?
diff --git a/js/app/packages/app/component/settings/Team.tsx b/js/app/packages/app/component/settings/Team.tsx
index 1165dbd5fa..90e2aed73f 100644
--- a/js/app/packages/app/component/settings/Team.tsx
+++ b/js/app/packages/app/component/settings/Team.tsx
@@ -1,4 +1,6 @@
+import { CustomScrollbar } from '@core/component/CustomScrollbar';
import { UserIcon } from '@core/component/UserIcon';
+import { VList } from 'virtua/solid';
import PlusIcon from '@icon/regular/plus.svg';
import UsersIcon from '@icon/regular/users.svg';
import TrashIcon from '@icon/regular/trash.svg';
@@ -280,6 +282,7 @@ function MemberRow(props: {
member: TeamMember;
isOwner: boolean;
isCurrentUser: boolean;
+ isLast?: boolean;
onRemove: () => void;
onRoleChange: (role: TeamRole) => void;
}) {
@@ -287,7 +290,11 @@ function MemberRow(props: {
const isMemberOwner = () => props.member.role === TeamRole.owner;
return (
- <div class="flex items-center justify-between py-2 px-6 border-b border-edge-muted last:border-b-0 gap-2">
+ <div
+ class="flex items-center justify-between py-2 px-6 gap-2 bg-surface hover:bg-hover"
+ classList={{ 'border-b': !props.isLast }}
+ style={{ 'border-color': 'var(--b3)' }}
+ >
<div class="flex items-center gap-3 min-w-0 flex-1">
<div class="shrink-0">
<UserIcon id={props.member.user_id} isDeleted={false} size="lg" />
@@ -574,7 +581,7 @@ function CreateTeamDialog(props: { open: boolean; onClose: () => void }) {
teamNameInputRef?.focus();
}}
>
- <Panel depth={2} active class="max-h-[75vh] text-ink">
+ <Panel depth={2} active class="max-h-[75vh] text-ink rounded-xl">
<Panel.Header class="px-2 gap-1">
<Dialog.CloseButton as={Button} variant="ghost" size="icon-sm">
<XIcon />
@@ -744,6 +751,18 @@ function TeamManagement(props: {
string | undefined
>(undefined);
+ const [memberListWrapperRef, setMemberListWrapperRef] =
+ createSignal<HTMLDivElement>();
+ const memberListScrollContainer = () => {
+ const el = memberListWrapperRef();
+ if (!el) return undefined;
+ return (
+ (el.querySelector(
+ '[data-team-members-list-container]'
+ ) as HTMLElement | null) ?? undefined
+ );
+ };
+
const hasValidInvites = () => {
const inv = invites();
const hasNonEmptyEmail = inv.some((i) => i.email.trim() !== '');
@@ -897,7 +916,8 @@ function TeamManagement(props: {
</Show>
</Panel.Header>
- <Panel.Body scroll>
+ <Panel.Body>
+ <div class="flex h-full flex-col">
<div class="flex items-center px-2 h-15.25 border-b border-edge-muted shrink-0">
<div class="flex items-center justify-between w-full border border-edge rounded-sm px-4 py-2">
<span class="text-sm text-ink-muted">Name</span>
@@ -952,21 +972,33 @@ function TeamManagement(props: {
</div>
</div>
- <div class="flex flex-col">
- <section class="flex flex-col">
+ <div class="relative min-h-0 flex-1">
<Show
when={!teamQuery.isLoading}
fallback={
<div class="animate-pulse bg-ink-extra-muted rounded h-16" />
}
>
- <div>
- <For each={members()}>
- {(member) => (
+ <div
+ ref={setMemberListWrapperRef}
+ class="relative h-full min-h-0"
+ >
+ <VList
+ data={members()}
+ class="h-full scrollbar-hidden"
+ style={{
+ height: '100%',
+ width: '100%',
+ }}
+ bufferSize={500}
+ data-team-members-list-container
+ >
+ {(member, index) => (
<MemberRow
member={member}
isOwner={isOwner()}
isCurrentUser={member.user_id === userId()}
+ isLast={index() === members().length - 1}
onRemove={() => setShowRemoveModal(member)}
onRoleChange={(newRole) => {
if (!props.teamId) return;
@@ -981,13 +1013,14 @@ function TeamManagement(props: {
}}
/>
)}
- </For>
+ </VList>
+ <CustomScrollbar scrollContainer={memberListScrollContainer} />
</div>
</Show>
- </section>
+ </div>
<Show when={isOwner() && (invitesQuery.data?.invites?.length ?? 0) > 0}>
- <section class="px-6 py-4 border-t border-edge-muted">
+ <section class="px-6 py-4 border-t border-edge-muted shrink-0">
<h3 class="text-sm font-medium mb-2">Pending Invites</h3>
<div class="border border-edge rounded-sm px-3">
<For each={invitesQuery.data?.invites ?? []}>
@@ -1002,14 +1035,14 @@ function TeamManagement(props: {
</div>
</section>
</Show>
- </div>
+ </div>
</Panel.Body>
<Dialog
open={showDeleteTeamModal()}
onOpenChange={handleDeleteTeamModalClose}
>
- <Panel depth={2} active class="max-h-[75vh] text-ink">
+ <Panel depth={2} active class="max-h-[75vh] text-ink rounded-xl">
<Panel.Header class="px-2 gap-1">
<Dialog.CloseButton
as={Button}
@@ -1073,7 +1106,7 @@ function TeamManagement(props: {
open={!!showRemoveModal()}
onOpenChange={() => setShowRemoveModal(null)}
>
- <Panel depth={2} active class="max-h-[75vh] text-ink">
+ <Panel depth={2} active class="max-h-[75vh] text-ink rounded-xl">
<Panel.Header class="px-2 gap-1">
<Dialog.CloseButton
as={Button}
@@ -1122,7 +1155,7 @@ function TeamManagement(props: {
open={!!showCancelInviteModal()}
onOpenChange={() => setShowCancelInviteModal(null)}
>
- <Panel depth={2} active class="max-h-[75vh] text-ink">
+ <Panel depth={2} active class="max-h-[75vh] text-ink rounded-xl">
<Panel.Header class="px-2 gap-1">
<Dialog.CloseButton
as={Button}
@@ -1174,7 +1207,7 @@ function TeamManagement(props: {
open={showInviteModal()}
onOpenChange={handleInviteModalClose}
>
- <Panel depth={2} active class="max-h-[75vh] text-ink">
+ <Panel depth={2} active class="max-h-[75vh] text-ink rounded-xl">
<Panel.Header class="px-2 gap-1">
<Dialog.CloseButton
as={Button}
diff --git a/js/app/packages/app/component/split-layout/components/PopoverSplitRenderer.tsx b/js/app/packages/app/component/split-layout/components/PopoverSplitRenderer.tsx
index cefe448ae4..58dc36396d 100644
--- a/js/app/packages/app/component/split-layout/components/PopoverSplitRenderer.tsx
+++ b/js/app/packages/app/component/split-layout/components/PopoverSplitRenderer.tsx
@@ -130,7 +130,7 @@ function PopoverSplitModal(props: {
bindHotKeyDom(r);
}}
>
- <Surface depth={2} active>
+ <Surface depth={2} active class="rounded-xl">
<div class="*:max-h-[75vh]">
<SplitPanelContext.Provider value={stubPanelContext}>
<SoupContextProvider>
diff --git a/js/app/packages/app/component/split-layout/components/SplitContainer.tsx b/js/app/packages/app/component/split-layout/components/SplitContainer.tsx
index b96da263c8..783b32a363 100644
--- a/js/app/packages/app/component/split-layout/components/SplitContainer.tsx
+++ b/js/app/packages/app/component/split-layout/components/SplitContainer.tsx
@@ -85,7 +85,7 @@ export function SplitContainer(
when={!isMobile()}
fallback={
<Layer depth={1}>
- <div class="flex flex-col min-h-0 size-full bg-surface overflow-hidden">
+ <div class="flex flex-col min-h-0 size-full bg-surface overflow-hidden rounded-xl">
<SplitHeader ref={setHeaderRef} />
<SplitToolbar ref={setToolbarRef} />
<div class="@container/split size-full overflow-hidden relative">
@@ -102,8 +102,9 @@ export function SplitContainer(
!panel.handle.isSpotLight()
}
depth={1}
+ class="rounded-xl"
>
- <div class="flex flex-col min-h-0 size-full bg-surface overflow-hidden">
+ <div class="flex flex-col min-h-0 size-full bg-surface overflow-hidden rounded-xl">
<SplitHeader ref={setHeaderRef} />
<SplitToolbar ref={setToolbarRef} />
<div class="@container/split size-full overflow-hidden relative">
diff --git a/js/app/packages/block-automation/component/AutomationComposer.tsx b/js/app/packages/block-automation/component/AutomationComposer.tsx
index 3dc8045d61..74e7c8e42a 100644
--- a/js/app/packages/block-automation/component/AutomationComposer.tsx
+++ b/js/app/packages/block-automation/component/AutomationComposer.tsx
@@ -140,7 +140,7 @@ export function AutomationComposer() {
open={automationComposerOpen()}
onOpenChange={(open) => setAutomationComposerOpen(open, false)}
>
- <Surface depth={2} active>
+ <Surface depth={2} active class="rounded-xl">
<div class="*:max-h-[75vh]">
<div class="flex cursor-default flex-col text-ink">
<div class="flex items-center justify-between border-b border-edge-muted px-3 py-2">
diff --git a/js/app/packages/block-channel/component/NewChannelBlockAdapter.tsx b/js/app/packages/block-channel/component/NewChannelBlockAdapter.tsx
index 69fe6774e9..0f410375b2 100644
--- a/js/app/packages/block-channel/component/NewChannelBlockAdapter.tsx
+++ b/js/app/packages/block-channel/component/NewChannelBlockAdapter.tsx
@@ -269,7 +269,7 @@ export function NewChannelBlockAdapter(props: BlockChannelProps) {
pendingJoinCall={pendingJoinCall}
onHandled={() => setPendingJoinCall(false)}
/>
- <div class="h-full flex flex-col px-2 mobile:px-0">
+ <div class="h-full flex flex-col">
<Switch>
<Match when={activeTab() === 'messages'}>
<NewChannel
diff --git a/js/app/packages/block-project/component/ProjectCreateMenu.tsx b/js/app/packages/block-project/component/ProjectCreateMenu.tsx
index 02f2b4c270..6492571acb 100644
--- a/js/app/packages/block-project/component/ProjectCreateMenu.tsx
+++ b/js/app/packages/block-project/component/ProjectCreateMenu.tsx
@@ -220,7 +220,7 @@ function ProjectCreateDialog(props: {
return (
<Dialog open={props.open} onOpenChange={(o) => !o && props.onClose()}>
- <Surface depth={2} active>
+ <Surface depth={2} active class="rounded-xl">
<div class="*:max-h-[75vh]">
<div class="p-2">
<Dialog.Title class="text-md font-semibold text-ink pb-3">
diff --git a/js/app/packages/channel/Attachments/AttachmentEntityList.tsx b/js/app/packages/channel/Attachments/AttachmentEntityList.tsx
index 89f1503c2a..18f6339a15 100644
--- a/js/app/packages/channel/Attachments/AttachmentEntityList.tsx
+++ b/js/app/packages/channel/Attachments/AttachmentEntityList.tsx
@@ -20,12 +20,8 @@ export function AttachmentEntityList(props: {
const hasDocuments = () => props.rows.length > 0;
return (
- <AttachmentSection
- label="Documents"
- class="flex flex-1 min-h-0 flex-col md:flex-none"
- contentClass="flex flex-1 min-h-0 flex-col"
- >
- <div class="flex flex-1 min-h-0 flex-col">
+ <AttachmentSection label="Documents">
+ <div class="grid p-3">
<Show when={!hasDocuments()}>
<div class="py-3 text-sm text-ink-faint">
No documents in this channel yet.
@@ -33,25 +29,23 @@ export function AttachmentEntityList(props: {
</Show>
<Show when={hasDocuments()}>
- <div class="min-h-0 h-full overflow-y-auto md:h-105">
- <For each={props.rows}>
- {(row) => (
- <AttachmentEntityRow
- entity={row.entity}
- timestamp={row.timestamp}
- senderId={row.senderId}
- onClick={row.onClick}
- />
- )}
- </For>
-
- <Show when={props.hasNextPage}>
- <LoadMoreButton
- onLoadMore={props.onLoadMore}
- isFetching={() => props.isFetchingNextPage}
+ <For each={props.rows}>
+ {(row) => (
+ <AttachmentEntityRow
+ entity={row.entity}
+ timestamp={row.timestamp}
+ senderId={row.senderId}
+ onClick={row.onClick}
/>
- </Show>
- </div>
+ )}
+ </For>
+
+ <Show when={props.hasNextPage}>
+ <LoadMoreButton
+ onLoadMore={props.onLoadMore}
+ isFetching={() => props.isFetchingNextPage}
+ />
+ </Show>
</Show>
</div>
</AttachmentSection>
diff --git a/js/app/packages/channel/Attachments/ChannelAttachmentsTab.tsx b/js/app/packages/channel/Attachments/ChannelAttachmentsTab.tsx
index 83d880c61f..b84fb1a3f0 100644
--- a/js/app/packages/channel/Attachments/ChannelAttachmentsTab.tsx
+++ b/js/app/packages/channel/Attachments/ChannelAttachmentsTab.tsx
@@ -1,19 +1,24 @@
import { Suspense } from 'solid-js';
import { ChannelAttachmentEntitySection } from './ChannelAttachmentEntitySection';
import { ChannelAttachmentMediaSection } from './ChannelAttachmentMediaSection';
-import {
- AttachmentEntityListSkeleton,
- MediaGallerySkeleton,
-} from './Skeletons';
export function ChannelAttachmentsTab(props: { channelId: string }) {
return (
- <div class="relative flex-1 min-h-0 overflow-y-auto">
- <div class="macro-message-width macro-message-padding mx-auto flex size-full min-h-0 flex-col gap-6 py-4">
- <Suspense fallback={<MediaGallerySkeleton />}>
+ <div class="relative flex-1 min-h-0 h-full overflow-hidden flex justify-center p-2">
+ <div
+ class="macro-message-width size-full"
+ style={{
+ 'grid-template-rows': 'minmax(0, 1fr) minmax(0, 1fr)',
+ 'grid-template-columns': '1fr',
+ overflow: 'hidden',
+ display: 'grid',
+ gap: '8px',
+ }}
+ >
+ <Suspense>
<ChannelAttachmentMediaSection channelId={props.channelId} />
</Suspense>
- <Suspense fallback={<AttachmentEntityListSkeleton />}>
+ <Suspense>
<ChannelAttachmentEntitySection channelId={props.channelId} />
</Suspense>
</div>
diff --git a/js/app/packages/channel/Attachments/MediaGallery.tsx b/js/app/packages/channel/Attachments/MediaGallery.tsx
index 147b728517..e3cceb66d1 100644
--- a/js/app/packages/channel/Attachments/MediaGallery.tsx
+++ b/js/app/packages/channel/Attachments/MediaGallery.tsx
@@ -1,9 +1,7 @@
import { MediaGrid } from '@channel/Media/MediaGrid';
import { MediaViewerDialog } from '@channel/Media/MediaViewerDialog';
import type { MediaItem } from '@channel/Media/media-items';
-import ChevronDownIcon from '@icon/regular/caret-down.svg';
-import { createSignal, createUniqueId, onCleanup, Show } from 'solid-js';
-import { itemsPerRow, THUMB_SIZE } from './attachment-utils';
+import { createSignal, Show } from 'solid-js';
import { AttachmentSection, LoadMoreButton } from './SectionHeader';
export function MediaGallery(props: {
@@ -12,49 +10,14 @@ export function MediaGallery(props: {
isFetchingNextPage: boolean;
onLoadMore: () => void;
}) {
- const galleryId = createUniqueId();
- const [expanded, setExpanded] = createSignal(false);
- const [containerWidth, setContainerWidth] = createSignal(0);
const [lightboxIndex, setLightboxIndex] = createSignal(0);
const [viewerOpen, setViewerOpen] = createSignal(false);
- const observeGrid = (el: HTMLDivElement) => {
- const observer = new ResizeObserver((entries) => {
- const entry = entries[0];
- if (entry) setContainerWidth(entry.contentRect.width);
- });
- observer.observe(el);
- onCleanup(() => observer.disconnect());
- };
-
- const rowLimit = () => itemsPerRow(containerWidth());
const hasMedia = () => props.items.length > 0;
- const hiddenCount = () => Math.max(0, props.items.length - rowLimit());
- const collapsedMaxHeight = () => THUMB_SIZE;
return (
- <AttachmentSection
- label="Photos and videos"
- action={
- <Show when={hiddenCount() > 0}>
- <button
- type="button"
- class="flex items-center gap-1 text-xs font-medium text-ink-muted/70 hover:text-ink-muted transition-colors"
- aria-controls={galleryId}
- aria-expanded={expanded()}
- onClick={() => setExpanded((prev) => !prev)}
- >
- {expanded() ? 'Show less' : 'See all'}
- <ChevronDownIcon
- aria-hidden="true"
- class="size-3 transition-transform"
- classList={{ 'rotate-180': expanded() }}
- />
- </button>
- </Show>
- }
- >
- <div class="flex flex-col">
+ <AttachmentSection label="Photos and videos">
+ <div class="grid p-3">
<Show when={!hasMedia()}>
<div class="py-3 text-sm text-ink-faint">
No photos or videos in this channel yet.
@@ -64,14 +27,8 @@ export function MediaGallery(props: {
<Show when={hasMedia()}>
<div>
<div
- id={galleryId}
aria-label="Photos and videos gallery"
- data-expanded={expanded() ? 'true' : 'false'}
- class="flex flex-row flex-wrap gap-1.5 overflow-hidden transition-[max-height] duration-200"
- style={{
- 'max-height': expanded() ? 'none' : `${collapsedMaxHeight()}px`,
- }}
- ref={observeGrid}
+ class="flex flex-row flex-wrap gap-1.5"
>
<MediaGrid
items={props.items}
@@ -92,7 +49,7 @@ export function MediaGallery(props: {
</div>
</Show>
- <Show when={expanded() && props.hasNextPage}>
+ <Show when={props.hasNextPage}>
<LoadMoreButton
onLoadMore={props.onLoadMore}
isFetching={() => props.isFetchingNextPage}
diff --git a/js/app/packages/channel/Attachments/SectionHeader.tsx b/js/app/packages/channel/Attachments/SectionHeader.tsx
index fca0da47b6..7df2fcde0b 100644
--- a/js/app/packages/channel/Attachments/SectionHeader.tsx
+++ b/js/app/packages/channel/Attachments/SectionHeader.tsx
@@ -15,7 +15,7 @@ export function AttachmentSection(props: {
<h3 class="text-sm font-medium text-ink">{props.label}</h3>
<div class="shrink-0">{props.action}</div>
</Panel.Header>
- <Panel.Body class={cn('p-3', props.contentClass)}>
+ <Panel.Body scroll class={props.contentClass}>
{props.children}
</Panel.Body>
</Panel>
diff --git a/js/app/packages/channel/Attachments/Skeletons.tsx b/js/app/packages/channel/Attachments/Skeletons.tsx
deleted file mode 100644
index 1adf6c3c1b..0000000000
--- a/js/app/packages/channel/Attachments/Skeletons.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-import { For } from 'solid-js';
-import { AttachmentSection } from './SectionHeader';
-
-export function ThumbnailSkeleton() {
- return (
- <div class="size-23 rounded-2xl border border-edge bg-edge animate-pulse" />
- );
-}
-
-export function DocumentRowSkeleton() {
- return (
- <div class="flex items-center gap-2 min-h-10 px-2">
- <div class="size-4 rounded bg-edge animate-pulse shrink-0" />
- <div class="h-3.5 rounded bg-edge animate-pulse w-48" />
- <div class="flex-1" />
- <div class="h-3 w-16 rounded bg-edge animate-pulse shrink-0" />
- <div class="h-3 w-12 rounded bg-edge animate-pulse shrink-0" />
- </div>
- );
-}
-
-const MEDIA_SKELETON_COUNT = 6;
-const DOCUMENT_SKELETON_COUNT = 6;
-
-export function MediaGallerySkeleton() {
- return (
- <AttachmentSection label="Photos and videos">
- <div class="flex flex-row flex-wrap gap-1.5">
- <For each={Array.from({ length: MEDIA_SKELETON_COUNT })}>
- {() => <ThumbnailSkeleton />}
- </For>
- </div>
- </AttachmentSection>
- );
-}
-
-export function AttachmentEntityListSkeleton() {
- return (
- <AttachmentSection label="Documents">
- <For each={Array.from({ length: DOCUMENT_SKELETON_COUNT })}>
- {() => <DocumentRowSkeleton />}
- </For>
- </AttachmentSection>
- );
-}
diff --git a/js/app/packages/channel/Channel/ThreadList.tsx b/js/app/packages/channel/Channel/ThreadList.tsx
index 8ac7f99e93..bfd20a292f 100644
--- a/js/app/packages/channel/Channel/ThreadList.tsx
+++ b/js/app/packages/channel/Channel/ThreadList.tsx
@@ -1,3 +1,4 @@
+import { CustomScrollbar } from '@core/component/CustomScrollbar';
import {
createScrollIntentTracker,
type ScrollDirection,
@@ -100,6 +101,7 @@ export function ThreadList(props: ThreadListProps) {
const [virtualHandle, setVirtualHandle] = createSignal<VirtualizerHandle>();
const [isNearBottom, setIsNearBottom] = createSignal(true);
const [didInitialScroll, setDidInitialScroll] = createSignal(false);
+ const [scrollEl, setScrollEl] = createSignal<HTMLDivElement>();
let scrollRef: HTMLDivElement | undefined;
let nearTopFired = false;
@@ -394,40 +396,47 @@ export function ThreadList(props: ThreadListProps) {
};
return (
- <div
- ref={scrollRef}
- data-channel-scroll
- {...scrollIntent.handlers}
- style={{
- width: '100%',
- 'overflow-y': 'auto',
- 'overflow-anchor': 'none',
- height: '100%',
- display: 'flex',
- 'flex-direction': 'column',
- }}
- >
- <div style="flex-grow: 1" />
- <Virtualizer
- ref={(ref) => {
- if (!ref) return;
- setVirtualHandle(ref);
- if (props.onNavigationReady) {
- props.onNavigationReady(createNavigation(ref));
- }
- resetInitialScroll();
- scrollOnMount(ref);
+ <>
+ <div
+ ref={(el) => {
+ scrollRef = el;
+ setScrollEl(el);
+ }}
+ data-channel-scroll
+ class="scrollbar-hidden"
+ {...scrollIntent.handlers}
+ style={{
+ width: '100%',
+ 'overflow-y': 'auto',
+ 'overflow-anchor': 'none',
+ height: '100%',
+ display: 'flex',
+ 'flex-direction': 'column',
}}
- scrollRef={scrollRef}
- itemSize={BASE_ITEM_SIZE}
- bufferSize={BASE_BUFFER_SIZE}
- data={props.keys()}
- onScroll={handleScroll}
- onScrollEnd={handleScrollEnd}
- shift={props.shift?.() ?? false}
>
- {(key) => props.children({ id: key })}
- </Virtualizer>
- </div>
+ <div style="flex-grow: 1" />
+ <Virtualizer
+ ref={(ref) => {
+ if (!ref) return;
+ setVirtualHandle(ref);
+ if (props.onNavigationReady) {
+ props.onNavigationReady(createNavigation(ref));
+ }
+ resetInitialScroll();
+ scrollOnMount(ref);
+ }}
+ scrollRef={scrollRef}
+ itemSize={BASE_ITEM_SIZE}
+ bufferSize={BASE_BUFFER_SIZE}
+ data={props.keys()}
+ onScroll={handleScroll}
+ onScrollEnd={handleScrollEnd}
+ shift={props.shift?.() ?? false}
+ >
+ {(key) => props.children({ id: key })}
+ </Virtualizer>
+ </div>
+ <CustomScrollbar scrollContainer={scrollEl} />
+ </>
);
}
diff --git a/js/app/packages/channel/Participants/ChannelParticipantsTab.tsx b/js/app/packages/channel/Participants/ChannelParticipantsTab.tsx
index 35510f75da..47c208d2a5 100644
--- a/js/app/packages/channel/Participants/ChannelParticipantsTab.tsx
+++ b/js/app/packages/channel/Participants/ChannelParticipantsTab.tsx
@@ -10,32 +10,12 @@ import {
} from '@queries/channel/participants';
import { commsServiceClient } from '@service-comms/client';
import { ChannelType } from '@service-comms/generated/models/channelType';
-import { cn } from '@ui';
+import { Panel } from '@ui';
import { createSignal, Show } from 'solid-js';
import { ParticipantsAddPanel } from './ParticipantsAddPanel';
import { ParticipantsList } from './ParticipantsList';
import { ParticipantsSearchInput } from './ParticipantsSearchInput';
-function ParticipantsSection(props: {
- title: string;
- children: import('solid-js').JSX.Element;
- class?: string;
- contentClass?: string;
-}) {
- return (
- <div
- class={cn(
- 'rounded-sm border border-edge-muted bg-surface py-3',
- props.class
- )}
- >
- <div class="px-3 pb-3 text-sm font-medium text-ink">{props.title}</div>
- <div class="border-b border-edge-muted" />
- <div class={cn('px-3 pt-3', props.contentClass)}>{props.children}</div>
- </div>
- );
-}
-
export function ChannelParticipantsTab(props: { channelId: string }) {
const { replaceOrInsertSplit } = useSplitLayout();
const userId = useUserId();
@@ -96,36 +76,41 @@ export function ChannelParticipantsTab(props: { channelId: string }) {
};
return (
- <div class="relative flex-1 min-h-0 overflow-hidden">
- <div class="macro-message-width macro-message-padding mx-auto flex size-full min-h-0 flex-col gap-6 py-4">
- <Show when={canAddParticipants()}>
- <ParticipantsSection title="Add participants">
- <ParticipantsAddPanel
- participants={participants}
- onAddParticipants={addParticipants}
- />
- </ParticipantsSection>
- </Show>
- <ParticipantsSection
- title="Participants"
- class="flex flex-1 min-h-0 flex-col md:flex-none"
- contentClass="flex flex-1 min-h-0 flex-col"
- >
- <ParticipantsSearchInput
- value={searchQuery()}
- onInput={setSearchQuery}
- />
- <div class="min-h-0 flex-1 pt-2">
- <ParticipantsList
- participants={filteredParticipants}
- searchQuery={searchQuery}
- currentUserId={userId() ?? undefined}
- editable={canManageParticipants()}
- onParticipantClick={openDirectMessage}
- onRemoveParticipant={removeParticipant}
+ <div class="h-full overflow-hidden flex justify-center p-2">
+ <div class="max-w-200 size-full">
+ <Panel depth={2} class="h-full overflow-hidden text-ink">
+ <Panel.Header class="px-6">
+ <div class="text-sm font-semibold">Participants</div>
+ </Panel.Header>
+ <Panel.Toolbar class="h-15.25 px-2">
+ <ParticipantsSearchInput
+ value={searchQuery()}
+ onInput={setSearchQuery}
/>
- </div>
- </ParticipantsSection>
+ </Panel.Toolbar>
+ <Panel.Body>
+ <div class="flex h-full flex-col">
+ <Show when={canAddParticipants()}>
+ <div class="px-6 py-3 border-b border-edge-muted shrink-0">
+ <ParticipantsAddPanel
+ participants={participants}
+ onAddParticipants={addParticipants}
+ />
+ </div>
+ </Show>
+ <div class="relative min-h-0 flex-1">
+ <ParticipantsList
+ participants={filteredParticipants}
+ searchQuery={searchQuery}
+ currentUserId={userId() ?? undefined}
+ editable={canManageParticipants()}
+ onParticipantClick={openDirectMessage}
+ onRemoveParticipant={removeParticipant}
+ />
+ </div>
+ </div>
+ </Panel.Body>
+ </Panel>
</div>
</div>
);
diff --git a/js/app/packages/channel/Participants/ParticipantsList.tsx b/js/app/packages/channel/Participants/ParticipantsList.tsx
index efb2cef528..4b11b3e902 100644
--- a/js/app/packages/channel/Participants/ParticipantsList.tsx
+++ b/js/app/packages/channel/Participants/ParticipantsList.tsx
@@ -1,5 +1,6 @@
+import { CustomScrollbar } from '@core/component/CustomScrollbar';
import type { ChannelParticipant } from '@queries/channel/types';
-import { type Accessor, Show } from 'solid-js';
+import { type Accessor, createSignal, Show } from 'solid-js';
import { VList } from 'virtua/solid';
import { ParticipantsEmptyState } from './ParticipantsEmptyState';
import { ParticipantsListItem } from './ParticipantsListItem';
@@ -12,31 +13,46 @@ export function ParticipantsList(props: {
onParticipantClick: (participantId: string) => void | Promise<void>;
onRemoveParticipant: (participantId: string) => void;
}) {
+ const [listWrapperRef, setListWrapperRef] = createSignal<HTMLDivElement>();
+
+ const scrollContainer = () => {
+ const el = listWrapperRef();
+ if (!el) return undefined;
+ return (
+ (el.querySelector(
+ '[data-participants-list-container]'
+ ) as HTMLElement | null) ?? undefined
+ );
+ };
+
return (
<Show
when={props.participants().length > 0}
fallback={<ParticipantsEmptyState searchQuery={props.searchQuery()} />}
>
- <div class="min-h-0 h-full overflow-hidden md:h-105">
+ <div ref={setListWrapperRef} class="relative h-full min-h-0">
<VList
data={props.participants()}
- class="h-full"
+ class="h-full scrollbar-hidden"
style={{
height: '100%',
width: '100%',
}}
bufferSize={500}
+ data-participants-list-container
>
- {(participant) => (
+ {(participant, index) => (
<ParticipantsListItem
participant={participant}
currentUserId={props.currentUserId}
editable={props.editable}
+ isLast={index() === props.participants().length - 1}
onClick={() => props.onParticipantClick(participant.user_id)}
onRemove={() => props.onRemoveParticipant(participant.user_id)}
/>
)}
</VList>
+ <CustomScrollbar scrollContainer={scrollContainer} />
</div>
</Show>
);
diff --git a/js/app/packages/channel/Participants/ParticipantsListItem.tsx b/js/app/packages/channel/Participants/ParticipantsListItem.tsx
index 9a9e93f797..05c04bff38 100644
--- a/js/app/packages/channel/Participants/ParticipantsListItem.tsx
+++ b/js/app/packages/channel/Participants/ParticipantsListItem.tsx
@@ -4,11 +4,13 @@ import { useSplitNavigationHandler } from '@core/util/useSplitNavigationHandler'
import IconX from '@icon/regular/x.svg';
import type { ChannelParticipant } from '@queries/channel/types';
import { Button } from '@ui';
+import { Show } from 'solid-js';
export function ParticipantsListItem(props: {
participant: ChannelParticipant;
currentUserId?: string;
editable: boolean;
+ isLast?: boolean;
onClick: () => void | Promise<void>;
onRemove: () => void;
}) {
@@ -24,42 +26,52 @@ export function ParticipantsListItem(props: {
);
return (
- <div class="flex items-center gap-2 min-h-10 p-2 text-sm w-full border-b border-edge-muted last:border-b-0 hover:bg-hover">
+ <div
+ class="flex items-center justify-between gap-2 py-2 px-6 text-sm w-full bg-surface hover:bg-hover"
+ classList={{ 'border-b': !props.isLast }}
+ style={{ 'border-color': 'var(--b3)' }}
+ >
<button
{...navigationHandlers}
type="button"
- class="flex min-w-0 flex-1 items-center gap-2 rounded-xs px-2 py-1 text-left focus:outline-none"
+ class="flex min-w-0 flex-1 items-center gap-3 rounded-xs text-left focus:outline-none"
>
- <div class="shrink-0 flex items-center">
+ <div class="shrink-0">
<UserIcon
id={props.participant.user_id}
- size="sm"
+ size="lg"
isDeleted={false}
/>
</div>
- <span class="ph-no-capture font-semibold truncate flex-1 text-ink">
- {idToEmail(props.participant.user_id)}
- </span>
+ <div class="min-w-0 flex-1">
+ <div class="ph-no-capture text-sm font-medium text-ink truncate">
+ {idToEmail(props.participant.user_id)}
+ </div>
+ <div class="text-xs text-ink-muted capitalize">
+ {props.participant.role}
+ </div>
+ </div>
</button>
- <span class="text-xs font-mono text-ink-extra-muted uppercase font-light shrink-0">
- {props.participant.role}
- </span>
- <div class="shrink-0">
- <Button
- label={canRemove ? 'Remove participant' : 'Cannot remove participant'}
- variant="ghost"
- size="icon-sm"
- disabled={!canRemove}
- onClick={(event) => {
- event.preventDefault();
- event.stopPropagation();
- if (!canRemove) return;
- props.onRemove();
- }}
- >
- <IconX />
- </Button>
- </div>
+ <Show when={props.editable}>
+ <div class="shrink-0">
+ <Button
+ label={
+ canRemove ? 'Remove participant' : 'Cannot remove participant'
+ }
+ variant="ghost"
+ size="icon-sm"
+ disabled={!canRemove}
+ onClick={(event) => {
+ event.preventDefault();
+ event.stopPropagation();
+ if (!canRemove) return;
+ props.onRemove();
+ }}
+ >
+ <IconX />
+ </Button>
+ </div>
+ </Show>
</div>
);
}
diff --git a/js/app/packages/channel/Participants/ParticipantsSearchInput.tsx b/js/app/packages/channel/Participants/ParticipantsSearchInput.tsx
index dfb67d16de..419c520041 100644
--- a/js/app/packages/channel/Participants/ParticipantsSearchInput.tsx
+++ b/js/app/packages/channel/Participants/ParticipantsSearchInput.tsx
@@ -1,13 +1,19 @@
+import MagnifyingGlassIcon from '@icon/regular/magnifying-glass.svg';
+
export function ParticipantsSearchInput(props: {
value: string;
onInput: (value: string) => void;
}) {
return (
- <input
- value={props.value}
- onInput={(event) => props.onInput(event.currentTarget.value)}
- placeholder="Search participants"
- class="h-10 w-full rounded-sm border border-edge-muted bg-surface px-3 text-sm text-ink placeholder:text-ink-muted focus:outline-none"
- />
+ <div class="flex items-center gap-2 w-full border border-edge rounded-sm px-4 py-2">
+ <MagnifyingGlassIcon class="size-4 text-ink-muted shrink-0" />
+ <input
+ type="text"
+ value={props.value}
+ onInput={(event) => props.onInput(event.currentTarget.value)}
+ placeholder="Search"
+ class="flex-1 min-w-0 text-sm bg-surface border-none outline-none text-ink placeholder:text-ink-placeholder"
+ />
+ </div>
);
}
diff --git a/js/app/packages/core/component/AI/component/input/useAiDataConsent.tsx b/js/app/packages/core/component/AI/component/input/useAiDataConsent.tsx
index d88fcc83cd..040f79898d 100644
--- a/js/app/packages/core/component/AI/component/input/useAiDataConsent.tsx
+++ b/js/app/packages/core/component/AI/component/input/useAiDataConsent.tsx
@@ -37,7 +37,7 @@ export function useAiDataConsentGate() {
onOpenChange={(isOpen) => !isOpen && denyConsent()}
class="w-120"
>
- <Surface depth={2} active>
+ <Surface depth={2} active class="rounded-xl">
<div class="*:max-h-[75vh]">
<div class="flex flex-row items-center justify-between px-2 h-10 gap-2 border-b border-b-edge-muted">
<div class="flex flex-row items-center gap-2">
diff --git a/js/app/packages/core/component/Properties/component/modal/CreatePropertyModal.tsx b/js/app/packages/core/component/Properties/component/modal/CreatePropertyModal.tsx
index 19f2c97994..aa439d5523 100644
--- a/js/app/packages/core/component/Properties/component/modal/CreatePropertyModal.tsx
+++ b/js/app/packages/core/component/Properties/component/modal/CreatePropertyModal.tsx
@@ -410,7 +410,7 @@ export const CreatePropertyModal: Component<CreatePropertyModalProps> = (
if (!open) props.onClose();
}}
>
- <Surface depth={2} class="*:max-h-[75vh]">
+ <Surface depth={2} class="*:max-h-[75vh] rounded-xl">
<div class="flex flex-col text-sm">
<div class="flex items-center justify-between gap-2 bg-surface px-2 h-10 border-b border-edge-muted shrink-0">
<Dialog.Title class="pl-2 text-sm font-medium">
diff --git a/js/app/packages/core/component/Properties/component/modal/SelectPropertyModal.tsx b/js/app/packages/core/component/Properties/component/modal/SelectPropertyModal.tsx
index 4269c77c4d..199ed987c8 100644
--- a/js/app/packages/core/component/Properties/component/modal/SelectPropertyModal.tsx
+++ b/js/app/packages/core/component/Properties/component/modal/SelectPropertyModal.tsx
@@ -156,7 +156,7 @@ export function SelectPropertyModal(props: PropertySelectorProps) {
}}
contentRef={setDialogRef}
>
- <Surface depth={2} class="*:max-h-[75vh]">
+ <Surface depth={2} class="*:max-h-[75vh] rounded-xl">
<div class="flex flex-col text-sm">
<div class="flex items-center gap-2 bg-surface px-2 h-10 border-b border-edge-muted shrink-0">
<span class="pl-2 pointer-events-none text-ink-extra-muted">❯</span>
diff --git a/js/app/packages/core/component/Properties/component/panel/PropertyLabel.tsx b/js/app/packages/core/component/Properties/component/panel/PropertyLabel.tsx
index f66243e591..6a0f6f9861 100644
--- a/js/app/packages/core/component/Properties/component/panel/PropertyLabel.tsx
+++ b/js/app/packages/core/component/Properties/component/panel/PropertyLabel.tsx
@@ -154,7 +154,7 @@ export const PropertyLabel: Component<PropertyLabelProps> = (props) => {
open={deleteConfirmVisible()}
onOpenChange={setDeleteConfirmVisible}
>
- <Surface depth={2} active>
+ <Surface depth={2} active class="rounded-xl">
<div class="*:max-h-[75vh]">
<div class="flex flex-col overflow-hidden text-sm">
<div class="flex items-center justify-between gap-2 bg-surface px-2 h-10 border-b border-edge-muted shrink-0">
diff --git a/js/app/packages/ui/components/Surface.tsx b/js/app/packages/ui/components/Surface.tsx
index 9c6fd56f3f..eafd4148f8 100644
--- a/js/app/packages/ui/components/Surface.tsx
+++ b/js/app/packages/ui/components/Surface.tsx
@@ -30,7 +30,7 @@ export function Surface(props: SurfaceProps) {
...local.style,
}}
class={cn(
- 'relative rounded-xl overflow-clip min-h-0 size-full',
+ 'relative rounded-md overflow-clip min-h-0 size-full',
"after:content-[''] after:absolute after:inset-0 after:pointer-events-none after:rounded-[inherit] after:z-10",
'after:shadow-[inset_0_0_4px_var(--color-shadow)]',
local.class,