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.

feat (ai): empty state (#183)

Eric Hayesfaf95ed00c2a
diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000000..0d962943b4
Binary files /dev/null and b/.DS_Store differ
diff --git a/js/app/packages/app/component/rightbar/Rightbar.tsx b/js/app/packages/app/component/rightbar/Rightbar.tsx
index cd682d33a4..3ba1692833 100644
--- a/js/app/packages/app/component/rightbar/Rightbar.tsx
+++ b/js/app/packages/app/component/rightbar/Rightbar.tsx
@@ -1,5 +1,6 @@
import { globalSplitManager } from '@app/signal/splitLayout';
import { useIsAuthenticated } from '@core/auth';
+import { AiChatEmptyState } from '@core/component/AI/component/AIChatEmptyState';
import { DragDropWrapper } from '@core/component/AI/component/DragDrop';
import { useChatInput } from '@core/component/AI/component/input/useChatInput';
import { ChatMessages } from '@core/component/AI/component/message/ChatMessages';
@@ -31,7 +32,6 @@ import {
useToggleRightPanel,
} from '@core/signal/layout';
import { rightbarChatId, setRightbarChatId } from '@core/signal/rightbar';
-import { useDisplayName } from '@core/user';
import { isErr } from '@core/util/maybeResult';
import ContractIcon from '@icon/regular/arrows-in.svg';
import ExpandIcon from '@icon/regular/arrows-out.svg';
@@ -47,7 +47,6 @@ import {
cognitionWebsocketServiceClient,
} from '@service-cognition/client';
import { createCognitionWebsocketEffect } from '@service-cognition/websocket';
-import { useUserId } from '@service-gql/client';
import { refetchHistory, useHistory } from '@service-storage/history';
import { useOpenInstructionsMd } from 'core/component/AI/util/instructions';
import type { LexicalEditor } from 'lexical';
@@ -322,27 +321,28 @@ export function Rightbar(props: {
props.setState.setModel(model_);
});
- const timeString = () => {
- const now = new Date().getHours();
- if (now < 12) {
- return 'morning';
- } else if (now < 18) {
- return 'afternoon';
- } else {
- return 'evening';
- }
- };
- const userId = useUserId();
- const [name] = useDisplayName(userId());
-
- let greeting = () => {
- const firstName = name().split(' ').at(0);
- if (!firstName || firstName.length === 0 || firstName.includes('@')) {
- return ``;
- } else {
- return `Good ${timeString()} ${firstName}, what can I assist you with?`;
- }
- };
+ // gone for now may want in future - ehayes 11/17/2025
+ // const timeString = () => {
+ // const now = new Date().getHours();
+ // if (now < 12) {
+ // return 'morning';
+ // } else if (now < 18) {
+ // return 'afternoon';
+ // } else {
+ // return 'evening';
+ // }
+ // };
+ // const userId = useUserId();
+ // const [name] = useDisplayName(userId());
+
+ // let greeting = () => {
+ // const firstName = name().split(' ').at(0);
+ // if (!firstName || firstName.length === 0 || firstName.includes('@')) {
+ // return ``;
+ // } else {
+ // return `Good ${timeString()} ${firstName}, what can I assist you with?`;
+ // }
+ // };
const [editor, setEditor] = createSignal<LexicalEditor>();
let borrowedFocus: Element | null = null;
@@ -392,10 +392,10 @@ export function Rightbar(props: {
chatName={props.chatName}
/>
<div class="flex flex-col flex-1 min-h-0 p-2 w-full items-center">
- <Show when={props.isBig && props.messages().length === 0}>
- <h1 class="text-ink-extra-muted/40 text-2xl flex-1 flex flex-col items-center justify-center">
- {greeting()}
- </h1>
+ <Show when={props.messages().length === 0}>
+ <div class="h-full flex flex-col items-center justify-center">
+ <AiChatEmptyState />
+ </div>
</Show>
<Show when={props.messages().length > 0 || !props.isBig}>
<div
diff --git a/js/app/packages/core/component/AI/component/AIChatEmptyState.tsx b/js/app/packages/core/component/AI/component/AIChatEmptyState.tsx
new file mode 100644
index 0000000000..a534eb8c70
--- /dev/null
+++ b/js/app/packages/core/component/AI/component/AIChatEmptyState.tsx
@@ -0,0 +1,52 @@
+import { BrightJoins } from '@core/component/BrightJoins';
+import { useSettingsState } from '@core/constant/SettingsState';
+import { useOpenInstructionsMd } from '../util/instructions';
+
+export function AiChatEmptyState() {
+ const { setActiveTabId, openSettings } = useSettingsState();
+ const openInstructions = useOpenInstructionsMd();
+ console.log('aichat empty state ');
+ return (
+ <div class="relative p-2 border border-edge-muted bg-dialog text-sm flex flex-col gap-2 text-ink">
+ <BrightJoins dots={[true, true, true, true]} />
+ <div class="grid justify-start grid-cols-[max-content_max-content] gap-y-1 grid-template items-center">
+ <span class="p-1 bg-accent text-panel mr-2 text-center">@</span>
+ <span>To attach, files, emails, and channel</span>
+ <span class="p-1 bg-accent text-panel mr-2 text-center">Agent</span>
+ <span>
+ <span>
+ Quick answers to quick quesions with access to any files @ mentioned
+ </span>
+ </span>
+ <span class="p-1 bg-accent text-panel mr-2 text-center">Ask</span>
+ <span>
+ Quick answers to quick quesions with access to any files @ mentioned
+ </span>
+ </div>
+ <div>
+ Change the
+ <span
+ class="font-medium text-accent underline mx-1"
+ onClick={openInstructions}
+ >
+ Instructions
+ </span>
+ to feed AI some basic context on what you do, who you work with, etc
+ </div>
+ <div>
+ Check your AI
+ <span
+ class="font-medium text-accent underline mx-1"
+ onClick={() => {
+ setActiveTabId('AI Memory');
+ openSettings();
+ }}
+ >
+ {' '}
+ Memories
+ </span>
+ that are auto-generated for accuracy and relevance
+ </div>
+ </div>
+ );
+}
diff --git a/js/app/packages/core/component/AI/component/message/ChatMessages.tsx b/js/app/packages/core/component/AI/component/message/ChatMessages.tsx
index 04728304af..727113f1e9 100644
--- a/js/app/packages/core/component/AI/component/message/ChatMessages.tsx
+++ b/js/app/packages/core/component/AI/component/message/ChatMessages.tsx
@@ -299,7 +299,7 @@ export function ChatMessages(props: ChatMessagesProps) {
return (
<StaticMarkdownContext theme={aiChatTheme}>
- <div class="flex flex-col w-full px-2 gap-y-2" ref={messagesRef}>
+ <div class="relative flex flex-col w-full px-2 gap-y-2" ref={messagesRef}>
<For each={allButLastMessagePair()}>
{(msg) => (
<div