Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
feat(home): new home view (#3730)
dev-rba4d7e35f5a62
diff --git a/js/app/package.json b/js/app/package.jsonindex 55241aa8fe..ececf7c347 100644--- a/js/app/package.json+++ b/js/app/package.json@@ -34,6 +34,7 @@"@date-fns/tz": "^1.4.1","@floating-ui/dom": "^1.7.4","@fontsource-variable/inter": "^5.2.8",+ "@fontsource-variable/playfair-display": "^5.2.8","@fontsource-variable/roboto-mono": "^5.2.8","@inkibra/tauri-plugins": "git+https://github.com/macro-inc/tauri-plugins.git#26537c8a46bb8424f9cf4021d08aa76aa7cd66ef","@kobalte/core": "^0.13.11",diff --git a/js/app/packages/app/component/app-sidebar/sidebar.tsx b/js/app/packages/app/component/app-sidebar/sidebar.tsxindex eacc5ed9b3..9db2f134a8 100644--- a/js/app/packages/app/component/app-sidebar/sidebar.tsx+++ b/js/app/packages/app/component/app-sidebar/sidebar.tsx@@ -37,6 +37,7 @@ import {DEV_MODE_ENV,ENABLE_APP_STORE_QR_CODE,ENABLE_CALLS,+ ENABLE_HOME_OVERRIDE,ENABLE_NEW_PRICING_OVERRIDE,ENABLE_TEAMS_OVERRIDE,} from '@core/constant/featureFlags';@@ -71,6 +72,7 @@ import { useNotificationSettings } from '@notifications';import BellIcon from '@phosphor/bell.svg';import CaretUpIcon from '@phosphor/caret-up.svg';import DeviceMobileIcon from '@phosphor/device-mobile-speaker.svg';+import HomeIcon from '@phosphor/house.svg';import KeyboardIcon from '@phosphor/keyboard.svg';import PaintBucketIcon from '@phosphor/paint-bucket.svg';import PlayIcon from '@phosphor/play.svg';@@ -93,7 +95,7 @@ import {import { Dynamic } from 'solid-js/web';interface SidebarItem {- id: ListView;+ id: ListView | (string & {});label: string;href: string;icon?: Component<@@ -270,7 +272,7 @@ type SidebarHotkeyDeps = {type OpenWithSplitFn = ReturnType<typeof useSplitLayout>['openWithSplit'];const isComponentEntry =- (id: ListView) =>+ (id: string) =>(entry: SplitContent): boolean =>entry.type === 'component' && entry.id === id;@@ -283,7 +285,7 @@ const isComponentEntry =* and forces a new entry / new split.*/function navigateToSidebarView(args: {- viewId: ListView;+ viewId: SidebarItem['id'];shiftKey: boolean;activeSplit: SplitHandle | undefined;openWithSplit: OpenWithSplitFn;@@ -760,6 +762,15 @@ const CALLS_LINK: SidebarItem = {hotkeyToken: TOKENS.sidebar.goTo.calls,};+const DASHBOARD_LINK: SidebarItem = {+ id: 'home',+ label: 'Home',+ href: '/home',+ icon: HomeIcon,+ hotkey: 'h',+ hotkeyToken: TOKENS.sidebar.goTo.home,+};+export const AppSidebar = (props: AppSidebarProps) => {const analytics = useAnalytics();const layout = useSplitLayout();@@ -768,6 +779,10 @@ export const AppSidebar = (props: AppSidebarProps) => {const notificationSettings = useNotificationSettings();const callCtx = useCallContextOptional();+ const homeViewEnabled = useFeatureFlag('enable-home-view', {+ enabledOverride: ENABLE_HOME_OVERRIDE,+ });+const hasPaidAccess = useHasPaidAccess();/** Persisted dismissal for the Premium upgrade promo card. */@@ -794,14 +809,19 @@ export const AppSidebar = (props: AppSidebarProps) => {const [hotkeyVisible, setHotkeyVisible] = createSignal(false);- const visibleLinks = createMemo(() => {- if (!ENABLE_CALLS()) return SIDEBAR_LINKS;- const idx = SIDEBAR_LINKS.findIndex((l) => l.id === 'channels');- return [- ...SIDEBAR_LINKS.slice(0, idx + 1),- CALLS_LINK,- ...SIDEBAR_LINKS.slice(idx + 1),- ];+ const visibleLinks = createMemo((): SidebarItem[] => {+ let links: SidebarItem[] = [...SIDEBAR_LINKS];++ if (homeViewEnabled().enabled) {+ links = [DASHBOARD_LINK, ...links];+ }++ if (ENABLE_CALLS()) {+ const idx = links.findIndex((l) => l.id === 'channels');+ links = [...links.slice(0, idx + 1), CALLS_LINK, ...links.slice(idx + 1)];+ }++ return links;});const resetHotkeysState = () => {diff --git a/js/app/packages/app/component/home/home-section-boundary.tsx b/js/app/packages/app/component/home/home-section-boundary.tsxnew file mode 100644index 0000000000..de437104dd--- /dev/null+++ b/js/app/packages/app/component/home/home-section-boundary.tsx@@ -0,0 +1,105 @@+import RefreshIcon from '@phosphor/arrow-clockwise.svg';+import WarningIcon from '@phosphor/warning.svg';+import { Button } from '@ui';+import {+ createSignal,+ ErrorBoundary,+ type JSX,+ Show,+ Suspense,+} from 'solid-js';++interface HomeSectionBoundaryProps {+ title: string;+ children: JSX.Element;+ fallback?: JSX.Element;+}++interface HomeSectionErrorProps {+ error: Error;+ reset: () => void;+ title?: string;+}++function HomeSectionError(props: HomeSectionErrorProps) {+ const [showDetails, setShowDetails] = createSignal(false);++ return (+ <div class="rounded-xl border border-edge-muted bg-surface p-4">+ <div class="flex items-start gap-3">+ <div class="flex size-8 shrink-0 items-center justify-center rounded-full bg-failure/10 text-failure [&_svg]:size-4">+ <WarningIcon />+ </div>++ <div class="min-w-0 flex flex-1 flex-col">+ <p class="text-sm font-medium text-ink">+ {props.title+ ? `Failed to load ${props.title}`+ : 'Something went wrong'}+ </p>+ <p class="text-xs leading-5 text-ink-muted">+ We couldn’t load this section. Try again, or view details if the+ issue continues.+ </p>++ <Show when={showDetails()}>+ <p class="mt-2 break-words rounded-lg bg-hover/50 p-2 text-xs leading-5 text-ink-extra-muted">+ {props.error.message}+ </p>+ </Show>++ <div class="mt-2 flex gap-2">+ <Button+ variant="base"+ size="sm"+ depth={2}+ class="w-fit bg-surface"+ onClick={props.reset}+ >+ <RefreshIcon class="size-3.5" />+ Try again+ </Button>+ <Button+ variant="ghost"+ size="sm"+ onClick={() => setShowDetails((value) => !value)}+ class="w-fit"+ >+ {showDetails() ? 'Hide details' : 'Show details'}+ </Button>+ </div>+ </div>+ </div>+ </div>+ );+}++function HomeSectionFallback() {+ return (+ <div class="space-y-3">+ <div class="skeleton-shimmer h-4 w-32 rounded-full bg-ink/10" />+ <div class="space-y-2">+ <div class="skeleton-shimmer h-12 rounded-xl bg-hover/60" />+ <div class="skeleton-shimmer h-12 rounded-xl bg-hover/40" />+ </div>+ </div>+ );+}++export function HomeSectionBoundary(props: HomeSectionBoundaryProps) {+ return (+ <ErrorBoundary+ fallback={(error, reset) => (+ <HomeSectionError+ error={error instanceof Error ? error : new Error(String(error))}+ reset={reset}+ title={props.title}+ />+ )}+ >+ <Suspense fallback={props.fallback ?? <HomeSectionFallback />}>+ {props.children}+ </Suspense>+ </ErrorBoundary>+ );+}diff --git a/js/app/packages/app/component/home/home.tsx b/js/app/packages/app/component/home/home.tsxnew file mode 100644index 0000000000..ecb90ea1e2--- /dev/null+++ b/js/app/packages/app/component/home/home.tsx@@ -0,0 +1,240 @@+import { useAnalytics } from '@app/component/analytics-context';+import { useSplitPanelOrThrow } from '@app/component/split-layout/layoutUtils';+import { ShowFeatureFlag } from '@app/lib/analytics/posthog';+import { useHasPaidAccess } from '@core/auth';+import { buildChatEditor } from '@core/component/AI/component/input/buildChatEditor';+import type { ChatSendInput } from '@core/component/AI/component/input/buildRequest';+import { ChatInput } from '@core/component/AI/component/input/ChatInput';+import {+ ChatInputProvider,+ useChatInputContext,+} from '@core/component/AI/context';+import { useGetChatAttachmentInfo } from '@core/component/AI/signal/attachment';+import { setPendingSendData } from '@core/component/AI/signal/pendingSend';+import { deriveChatName } from '@core/component/AI/util/deriveName';+import { ENABLE_HOME_OVERRIDE } from '@core/constant/featureFlags';+import { PaywallKey, usePaywallState } from '@core/constant/PaywallState';+import { useUserContext } from '@core/context/user';+import { isPaymentError } from '@core/util/handlePaymentError';+import { createRenameDssEntityMutation } from '@macro-entity';+import { invalidateAllSoup } from '@queries/soup/normalized-cache';+import { cognitionApiServiceClient } from '@service-cognition/client';+import { Navigate } from '@solidjs/router';+import { createMemo } from 'solid-js';+import { HomeSectionBoundary } from './home-section-boundary';++const MACRO_LOGO_PATH =+ 'm6.25 4.038-2.242 0.8792v5.8184l-1.756-1.6582-2.242 0.8792v6.6766c0 0.2568 0.106 0.502 0.292 0.6784l2.794 2.6422 2.244-0.879v-5.8184l7.084 6.6974 2.244-0.879v-5.8184l7.086 6.6976 2.24-0.8792v-6.6766c0-0.2568-0.104-0.5022-0.292-0.6784l-8.124-7.6816-2.244 0.879v5.8184z';++function AnimatedHeroLogo(props: { class?: string }) {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 24 24"+ class={props.class}+ display="block"+ >+ <defs>+ <clipPath id="home-hero-logo-fill">+ <rect+ class="home-logo-fill-clip"+ x="0"+ y="0"+ width="24"+ height="24"+ />+ </clipPath>+ </defs>+ <path d={MACRO_LOGO_PATH} fill="currentColor" opacity="0.12" />+ <path+ d={MACRO_LOGO_PATH}+ fill="currentColor"+ clip-path="url(#home-hero-logo-fill)"+ />+ </svg>+ );+}++export function Home() {+ return (+ <ShowFeatureFlag+ key="enable-home-view"+ enabledOverride={ENABLE_HOME_OVERRIDE}+ fallback={<Navigate href="/" />}+ >+ <HomeContent />+ </ShowFeatureFlag>+ );+}++function HomeContent() {+ const user = useUserContext();++ const firstName = createMemo(() => {+ const name = user.author();+ return name.includes('@') ? name.split('@')[0] : name.split(' ')[0];+ });++ const greeting = createMemo(() => {+ const hour = new Date().getHours();+ if (hour < 12) return 'Good Morning';+ if (hour < 18) return 'Good Afternoon';+ return 'Good Evening';+ });++ return (+ <main class="relative h-full overflow-y-auto bg-surface">+ <div class="@container/home size-full px-0 pb-10 p-2 md:p-4">+ <div class="mx-auto h-full flex flex-col justify-center -mt-15 w-full min-w-0 max-w-2xl gap-10">+ <HomeSectionBoundary title="hero">+ <section class="relative">+ <style>{+ /*css*/ `+ @keyframes home-hero-fade-up {+ from { opacity: 0; transform: translateY(8px); }+ to { opacity: 1; transform: translateY(0); }+ }+ @keyframes home-hero-logo-fill {+ from { transform: scaleX(0); }+ to { transform: scaleX(1); }+ }+ .home-hero-stagger > * {+ animation: home-hero-fade-up 250ms ease-out both;+ }+ .home-hero-stagger > *:nth-child(1) { animation-delay: 50ms; }+ .home-hero-stagger > *:nth-child(2) { animation-delay: 120ms; }+ .home-hero-stagger > *:nth-child(3) { animation-delay: 190ms; }+ .home-logo-fill-clip {+ transform-box: fill-box;+ transform-origin: left center;+ animation: home-hero-logo-fill 550ms cubic-bezier(0.2, 0.8, 0.2, 1) 50ms both;+ }+ @media (prefers-reduced-motion: reduce) {+ .home-hero-stagger > *,+ .home-logo-fill-clip {+ animation: none;+ }+ }+ `+ }</style>+ <div class="home-hero-stagger mx-auto flex max-w-3xl flex-col items-center gap-8 px-4 sm:px-0">+ <div class="flex w-full items-center gap-3 justify-center">+ <AnimatedHeroLogo class="size-6 text-accent" />+ <h1 class="relative min-w-0 text-balance text-2xl font-medium font-serif tracking-tight text-ink">+ {greeting()}, <span class="capitalize">{firstName()}</span>+ </h1>+ </div>++ <div class="flex flex-col gap-4 w-full text-left">+ <HomeChatInput />+ </div>+ </div>+ </section>+ </HomeSectionBoundary>+ </div>+ </div>+ </main>+ );+}++const HomeChatInputInner = () => {+ const analytics = useAnalytics();+ const splitPanelContext = useSplitPanelOrThrow();+ const input = useChatInputContext();+ const hasPaid = useHasPaidAccess();++ const { getAttachmentFromMention } = useGetChatAttachmentInfo();++ const editor = buildChatEditor().withMentions({+ onCreate: (mention) => {+ analytics.track('mentions_menu_use', { itemType: 'chat' });+ const attachment = getAttachmentFromMention(mention);+ if (attachment) input.attachments.addAttachment(attachment);+ },+ block: 'chat',+ showOpenTabs: true,+ });++ const renameMutation = createRenameDssEntityMutation();++ const handleSend = async (request: ChatSendInput) => {+ if (!hasPaid()) {+ const { showPaywall } = usePaywallState();+ showPaywall(PaywallKey.CHAT_LIMIT);+ return;+ }++ const backgroundSend = request.metaKey;++ // Create a new persistent chat+ const response = await cognitionApiServiceClient.createChat({});+ if (response.isErr()) {+ if (isPaymentError(response)) {+ const { showPaywall } = usePaywallState();+ showPaywall(PaywallKey.CHAT_LIMIT);+ }+ return;+ }+ const { id: chatId } = response.value;++ // Rename via mutation for optimistic cache updates (history, preview, soup)+ const name = deriveChatName(request.content);+ if (name) {+ renameMutation.mutate({+ entity: { type: 'chat', id: chatId, name: '', ownerId: '' },+ newName: name,+ });+ }++ if (backgroundSend) {+ // Send the message in the background without navigating+ cognitionApiServiceClient.sendStreamChatMessage({+ content: request.content,+ model: request.model,+ chat_id: chatId,+ attachments:+ request.attachments.length > 0 ? request.attachments : undefined,+ toolset: { type: 'all' },+ });+ invalidateAllSoup();+ } else {+ // Store the pending send data for the chat to pick up+ setPendingSendData({+ content: request.content,+ attachments: request.attachments,+ model: request.model,+ });++ // Replace the soup split with the chat split+ splitPanelContext.handle.replace({+ next: { type: 'chat', id: chatId },+ });+ }+ };++ return (+ <div class="w-full max-w-3xl">+ <div class="pointer-events-auto">+ <ChatInput+ variant="tall"+ editor={editor}+ onSend={handleSend}+ onEscape={() => {+ splitPanelContext.panelRef()?.focus();+ return true;+ }}+ isPersistent={true}+ autoFocusOnMount={false}+ />+ </div>+ </div>+ );+};++const HomeChatInput = () => {+ return (+ <ChatInputProvider>+ <HomeChatInputInner />+ </ChatInputProvider>+ );+};diff --git a/js/app/packages/app/component/home/index.ts b/js/app/packages/app/component/home/index.tsnew file mode 100644index 0000000000..e331f58c5b--- /dev/null+++ b/js/app/packages/app/component/home/index.ts@@ -0,0 +1 @@+export { Home } from './home';diff --git a/js/app/packages/app/component/split-layout/componentRegistry.tsx b/js/app/packages/app/component/split-layout/componentRegistry.tsxindex b99f28c27b..0099d8acb2 100644--- a/js/app/packages/app/component/split-layout/componentRegistry.tsx+++ b/js/app/packages/app/component/split-layout/componentRegistry.tsx@@ -1,5 +1,6 @@import { useAnalytics } from '@app/component/analytics-context';import { getViewPreset } from '@app/component/app-sidebar/soup-filter-presets';+import { Home } from '@app/component/home';import type { SetPredicatesInput } from '@app/component/next-soup/filters/filter-store/predicates-store';import type { Query } from '@app/component/next-soup/filters/filter-store/types';import { SoupView } from '@app/component/next-soup/soup-view/soup-view';@@ -101,6 +102,14 @@ registerComponent('unified-list', () => ());/** BEGIN - APP ROUTES */+registerComponent(+ 'home',+ withAuth(() => {+ usePageViewTracking('home');+ return <Home />;+ })+);+registerComponent('inbox',withAuth(() => {diff --git a/js/app/packages/app/component/split-layout/layoutManager.ts b/js/app/packages/app/component/split-layout/layoutManager.tsindex e92943008c..e65d6904f5 100644--- a/js/app/packages/app/component/split-layout/layoutManager.ts+++ b/js/app/packages/app/component/split-layout/layoutManager.ts@@ -123,6 +123,7 @@ export type ReferredFrom =| 'launcher'| 'sidebar'| 'dock'+ | 'home'| 'entity-actions-menu'| 'hotkey'| 'quick-access'diff --git a/js/app/packages/app/index.css b/js/app/packages/app/index.cssindex 03e61b2393..e89043affd 100644--- a/js/app/packages/app/index.css+++ b/js/app/packages/app/index.css@@ -175,7 +175,7 @@/* Font families */--font-sans: "Inter Variable", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";- --font-serif: "Georgia", ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;+ --font-serif: "Playfair Display Variable", ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;--font-mono: "Roboto Mono Variable", monospace;--text-xxs: 0.625rem;@@ -247,6 +247,31 @@}}+@keyframes skeleton-shimmer {+ 100% {+ transform: translateX(100%);+ }+}++.skeleton-shimmer {+ position: relative;+ overflow: hidden;+}++.skeleton-shimmer::after {+ content: '';+ position: absolute;+ inset: 0;+ transform: translateX(-100%);+ background: linear-gradient(+ 90deg,+ transparent,+ oklch(from var(--color-ink) l c h / 0.08),+ transparent+ );+ animation: skeleton-shimmer 1.4s infinite;+}+@keyframes slideIn {from { transform: translateX(calc(100% + 16px)); }to { transform: translateX(0 ); }diff --git a/js/app/packages/app/index.tsx b/js/app/packages/app/index.tsxindex 00469d59ea..5f89260bf5 100644--- a/js/app/packages/app/index.tsx+++ b/js/app/packages/app/index.tsx@@ -1,6 +1,7 @@import './index.css';import '@fontsource-variable/inter';import '@fontsource-variable/roboto-mono';+import '@fontsource-variable/playfair-display';// SolidDevtools retains disposed memos, causes memory leak// import 'solid-devtools';import { initializeLexical } from '@core/component/LexicalMarkdown/init';diff --git a/js/app/packages/core/component/AI/component/input/ChatInput.tsx b/js/app/packages/core/component/AI/component/input/ChatInput.tsxindex 0ce7addca5..34d71e6258 100644--- a/js/app/packages/core/component/AI/component/input/ChatInput.tsx+++ b/js/app/packages/core/component/AI/component/input/ChatInput.tsx@@ -14,7 +14,7 @@ import { handleFileFolderDrop } from '@core/util/upload';import PaperclipIcon from '@phosphor/paperclip.svg';import { createCallback } from '@solid-primitives/rootless';import { Button, cn, Surface, SendButton as UiSendButton } from '@ui';-import { createEffect, createSignal, Show } from 'solid-js';+import { createEffect, createMemo, createSignal, Show } from 'solid-js';import { AttachmentList } from './Attachment';import { ChatAttachMenu } from './ChatAttachMenu';import { useAiDataConsentGate } from './useAiDataConsent';@@ -30,6 +30,7 @@ type ChatInputProps = {};type ChatInputComponentProps = {+ variant?: 'default' | 'tall';editor: EditorConfigBuilder;initialValue?: string;onChange?: (markdown: string) => void;@@ -130,7 +131,7 @@ export function ChatInput(props: ChatInputComponentProps) {attachments.attached().length > 0 || uploadQueue.uploading().length > 0;const LeftButton = () => (- <div ref={setAttachMenuAnchorRef} class="shrink-0">+ <div ref={setAttachMenuAnchorRef} class="shrink-0 flex"><Buttonvariant="ghost"size="icon-sm"@@ -180,6 +181,24 @@ export function ChatInput(props: ChatInputComponentProps) {</div>);+ const Attachments = () => (+ <Show when={hasAttachments()}>+ <div class={cn('px-2 pt-2 w-full', isTallVariant() && 'px-0')}>+ <AttachmentList+ attached={attachments.attached}+ removeAttachment={(id) => {+ attachments.removeAttachment(id);+ }}+ uploading={() =>+ uploadQueue.uploading().map((uploading) => uploading.preview)+ }+ />+ </div>+ </Show>+ );++ const isTallVariant = createMemo(() => props.variant === 'tall');+return (<Surface active={isFocused()} class="rounded-xl" depth={2} solid><div@@ -193,18 +212,8 @@ export function ChatInput(props: ChatInputComponentProps) {ref={containerRef}id="chat-input">- <Show when={hasAttachments()}>- <div class="px-2 pt-2 w-full">- <AttachmentList- attached={attachments.attached}- removeAttachment={(id) => {- attachments.removeAttachment(id);- }}- uploading={() =>- uploadQueue.uploading().map((uploading) => uploading.preview)- }- />- </div>+ <Show when={!isTallVariant()}>+ <Attachments /></Show><Show when={showAttachMenu()}>@@ -220,15 +229,18 @@ export function ChatInput(props: ChatInputComponentProps) {/></Show>- <div class="relative px-2 py-1.5">+ <div+ class={cn('relative px-2 py-1.5', {+ 'flex flex-col px-3 py-2': isTallVariant(),+ })}+ ><divid="chat-input-text-area"class={cn('text-sm sm:text-sm text-ink')}classList={{- 'pl-8': !isMultiline(),- 'pr-12': !isMultiline() && isTouchDevice(),- 'pr-32.5': !isMultiline() && !isTouchDevice(),- 'px-0 pb-8': isMultiline(),+ 'pl-8': !isMultiline() && !isTallVariant(),+ 'pr-12': !isMultiline() && !isTallVariant(),+ 'px-0 pb-8': isMultiline() && !isTallVariant(),}}ref={mdRef}>@@ -242,18 +254,39 @@ export function ChatInput(props: ChatInputComponentProps) {props.autoFocusOnMount !== false}/>+ <Show when={isTallVariant()}>+ <div class="h-4" />+ </Show>+ <Show when={isTallVariant()}>+ <Attachments />+ </Show></div>- <div class="absolute left-2 bottom-1.5">- <LeftButton />- </div>+ <div+ class={cn({+ 'flex justify-between items-center': isTallVariant(),+ })}+ >+ <div+ class={cn(+ !isTallVariant() && 'absolute left-2 top-1/2 -translate-y-1/2'+ )}+ >+ <LeftButton />+ </div>- <div class="absolute right-1.5 bottom-1.5">- <RightControls />+ <div+ class={cn(+ !isTallVariant() &&+ 'absolute right-1.5 top-1/2 -translate-y-1/2'+ )}+ >+ <RightControls />+ </div></div></div>- <ConsentDialog /></div>+ <ConsentDialog /></Surface>);}diff --git a/js/app/packages/core/constant/featureFlags.ts b/js/app/packages/core/constant/featureFlags.tsindex d38503ee65..4d23359dc0 100644--- a/js/app/packages/core/constant/featureFlags.ts+++ b/js/app/packages/core/constant/featureFlags.ts@@ -384,5 +384,7 @@ export const ENABLE_CREATE_PROPERTY = resolveFeatureFlag(false);+export const ENABLE_HOME_OVERRIDE = DEV_MODE_ENV ? true : undefined;+export const ENABLE_NEW_PRICING_OVERRIDE =resolveFeatureFlag('ENABLE_NEW_PRICING', DEV_MODE_ENV) || undefined;diff --git a/js/app/packages/core/hotkey/tokens.ts b/js/app/packages/core/hotkey/tokens.tsindex 147cb0be27..1d46008e93 100644--- a/js/app/packages/core/hotkey/tokens.ts+++ b/js/app/packages/core/hotkey/tokens.ts@@ -86,6 +86,7 @@ export const TOKENS = {sidebar: {goToLeader: 'sidebar.goToLeader',goTo: {+ home: 'sidebar.goTo.home',inbox: 'sidebar.goTo.inbox',search: 'sidebar.goTo.search',agents: 'sidebar.goTo.agents',diff --git a/js/app/packages/entity/mocks/mockEntityData.ts b/js/app/packages/entity/mocks/mockEntityData.tsindex 3f67f87928..64d17c24f2 100644--- a/js/app/packages/entity/mocks/mockEntityData.ts+++ b/js/app/packages/entity/mocks/mockEntityData.ts@@ -278,6 +278,7 @@ const MOCK_CHANNEL_PUBLIC: ChannelEntity = {updatedAt: MOCK_TIMESTAMPS.today,interactedAt: MOCK_TIMESTAMPS.today,latestMessage: {+ messageId: 'message_public_1',content: "Hey everyone! Don't forget about the team meeting at 2pm",senderId: MOCK_USER_IDS.teamMember1,createdAt: MOCK_TIMESTAMPS.today,@@ -295,6 +296,7 @@ const MOCK_CHANNEL_PRIVATE: ChannelEntity = {updatedAt: MOCK_TIMESTAMPS.yesterday,interactedAt: MOCK_TIMESTAMPS.yesterday,latestMessage: {+ messageId: 'message_private_1',content: 'Updated the mockups in Figma',senderId: MOCK_USER_IDS.teamMember2,createdAt: MOCK_TIMESTAMPS.yesterday,@@ -313,6 +315,7 @@ const MOCK_CHANNEL_DIRECT_MESSAGE: ChannelEntity = {updatedAt: MOCK_TIMESTAMPS.today,interactedAt: MOCK_TIMESTAMPS.today,latestMessage: {+ messageId: 'message_dm_1',content: 'Can you review the PR?',senderId: MOCK_USER_IDS.teamMember1,createdAt: MOCK_TIMESTAMPS.today,@@ -330,6 +333,7 @@ const MOCK_CHANNEL_ANNOUNCEMENTS: ChannelEntity = {updatedAt: MOCK_TIMESTAMPS.lastWeek,interactedAt: MOCK_TIMESTAMPS.lastWeek,latestMessage: {+ messageId: 'message_org_1',content: 'Q4 results are in!',senderId: MOCK_USER_IDS.owner,createdAt: MOCK_TIMESTAMPS.lastWeek,@@ -347,6 +351,7 @@ const MOCK_CHANNEL_EMPTY_MESSAGE: ChannelEntity = {updatedAt: MOCK_TIMESTAMPS.today,interactedAt: MOCK_TIMESTAMPS.today,latestMessage: {+ messageId: 'message_attachment_1',content: '',senderId: MOCK_USER_IDS.teamMember2,createdAt: MOCK_TIMESTAMPS.today,diff --git a/js/app/packages/entity/src/types/entity.ts b/js/app/packages/entity/src/types/entity.tsindex 86bba53cc3..528b150aa8 100644--- a/js/app/packages/entity/src/types/entity.ts+++ b/js/app/packages/entity/src/types/entity.ts@@ -22,6 +22,8 @@ export type ChannelEntity = EntityBase & {interactedAt?: DateValue | null;participantIds?: string[];latestMessage?: {+ messageId: string;+ threadId?: string | null;content: string;senderId: string;createdAt: DateValue;diff --git a/js/app/packages/queries/soup/transform-utils.ts b/js/app/packages/queries/soup/transform-utils.tsindex 3a26a9223b..508cceb691 100644--- a/js/app/packages/queries/soup/transform-utils.ts+++ b/js/app/packages/queries/soup/transform-utils.ts@@ -569,6 +569,9 @@ export const mapSoupPageToEntityList: (}if (item.tag === 'channel') {+ const latestMessage =+ item.data.latest_message ?? item.data.latest_non_thread_message;+const out: ChannelEntity = {type: 'channel',id: item.data.channel.id,@@ -580,11 +583,14 @@ export const mapSoupPageToEntityList: (createdAt: item.data.channel.created_at,participantIds: item.data.participants.map((p) => p.user_id),viewedAt: item.data.viewed_at ?? item.data.interacted_at,- latestMessage: item.data.latest_non_thread_message+ interactedAt: item.data.interacted_at,+ latestMessage: latestMessage? {- content: item.data.latest_non_thread_message.content,- senderId: item.data.latest_non_thread_message.sender_id,- createdAt: item.data.latest_non_thread_message.created_at,+ messageId: latestMessage.message_id,+ threadId: latestMessage.thread_id ?? undefined,+ content: latestMessage.content,+ senderId: latestMessage.sender_id,+ createdAt: latestMessage.created_at,}: undefined,};diff --git a/js/bun.lock b/js/bun.lockindex 102287cfcb..d8a2279d66 100644--- a/js/bun.lock+++ b/js/bun.lock@@ -22,6 +22,7 @@"@date-fns/tz": "^1.4.1","@floating-ui/dom": "^1.7.4","@fontsource-variable/inter": "^5.2.8",+ "@fontsource-variable/playfair-display": "^5.2.8","@fontsource-variable/roboto-mono": "^5.2.8","@inkibra/tauri-plugins": "git+https://github.com/macro-inc/tauri-plugins.git#26537c8a46bb8424f9cf4021d08aa76aa7cd66ef","@kobalte/core": "^0.13.11",@@ -740,6 +741,8 @@"@fontsource-variable/inter": ["@fontsource-variable/[email protected]", "", {}, "sha512-kOfP2D+ykbcX/P3IFnokOhVRNoTozo5/JxhAIVYLpea/UBmCQ/YWPBfWIDuBImXX/15KH+eKh4xpEUyS2sQQGQ=="],+ "@fontsource-variable/playfair-display": ["@fontsource-variable/[email protected]", "", {}, "sha512-ZzVIXPOrL85yyOvZYoBzUszIJM+xKkHqni4IYn2CVLaGQQdJR8sBeC8yFNgjxSJ7ludTwta8qpULeOFuk5X75A=="],+"@fontsource-variable/roboto-mono": ["@fontsource-variable/[email protected]", "", {}, "sha512-6M2U3wGIUxYNKRrUoKls8BRRIPDA57T8J0agqwyDkiEHrLEEAqptsxcUl3eTm6tnRNEn6yEm4pCefvtnujebDA=="],"@gerrit0/mini-shiki": ["@gerrit0/[email protected]", "", { "dependencies": { "@shikijs/engine-oniguruma": "^3.23.0", "@shikijs/langs": "^3.23.0", "@shikijs/themes": "^3.23.0", "@shikijs/types": "^3.23.0", "@shikijs/vscode-textmate": "^10.0.2" } }, "sha512-bEMORlG0cqdjVyCEuU0cDQbORWX+kYCeo0kV1lbxF5bt4r7SID2l9bqsxJEM0zndaxpOUT7riCyIVEuqq/Ynxg=="],