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.

style(chat): tweak font size and user massage, fix(mentions): weird padding on doc preview (#2901)

Seamus726ba11b3b90
diff --git a/js/app/packages/block-chat/component/Chat.tsx b/js/app/packages/block-chat/component/Chat.tsx
index 26da10ead9..5267c921ca 100644
--- a/js/app/packages/block-chat/component/Chat.tsx
+++ b/js/app/packages/block-chat/component/Chat.tsx
@@ -47,6 +47,9 @@ import { cognitionApiServiceClient } from '@service-cognition/client';
import { createCallback } from '@solid-primitives/rootless';
import { ChatInput } from 'core/component/AI/component/input/ChatInput';
import { createEffect, createSignal, getOwner, Show } from 'solid-js';
+import { SplitToolbarLeft } from '@app/component/split-layout/components/SplitToolbar';
+import { Button } from '@ui/components/Button';
+import ChatDebugIcon from '@icon/regular/chat-text.svg';
export function Chat(props: { data: ChatData }) {
const loadedState = getChatInputStoredState(props.data.chat.id);
@@ -253,14 +256,21 @@ function ChatInner(props: {
isEntityDraggingOver={isDraggingOver}
>
<TopBar />
- <Show when={DEV_MODE_ENV}>
- <button
- class="text-xs px-2 py-0.5 text-secondary hover:text-ink"
- onClick={() => setShowStreamDebug((p) => !p)}
- >
- {showStreamDebug() ? 'Hide' : 'Show'} Stream Debug
- </button>
- </Show>
+ <SplitToolbarLeft>
+ <Show when={DEV_MODE_ENV}>
+ <Button
+ size="icon-sm"
+ class="rounded-xs"
+ onClick={() => setShowStreamDebug((p) => !p)}
+ tooltip={
+ showStreamDebug() ? 'Hide Stream Debug' : 'Show Stream Debug'
+ }
+ >
+ <ChatDebugIcon />
+ {/*{showStreamDebug() ? 'Hide' : 'Show'} Stream Debug*/}
+ </Button>
+ </Show>
+ </SplitToolbarLeft>
<Show when={showStreamDebug()}>
<div class="px-2 py-1 bg-menu border-b border-edge text-ink font-mono text-sm">
<Show when={chat.stream()} fallback={<div>No active stream</div>}>
@@ -273,7 +283,7 @@ function ChatInner(props: {
</Show>
</div>
</Show>
- <div class="size-full flex-1 min-h-0 p-2 relative">
+ <div class="size-full flex-1 min-h-0 px-2 relative">
<div class="absolute inset-0 pointer-events-none" use:droppable />
<div
data-chat-scroll
diff --git a/js/app/packages/core/component/AI/component/message/AssistantMessage.tsx b/js/app/packages/core/component/AI/component/message/AssistantMessage.tsx
index 32ae1190a0..5d404a99f5 100644
--- a/js/app/packages/core/component/AI/component/message/AssistantMessage.tsx
+++ b/js/app/packages/core/component/AI/component/message/AssistantMessage.tsx
@@ -142,7 +142,7 @@ export function AssistantMessage(props: {
>
<Switch>
<Match when={!messageContentIsEmpty(props.message.content)}>
- <div class="chat-markdown-container max-w-full px-2 w-full">
+ <div class="chat-markdown-container max-w-full px-4 w-full">
<Switch>
<Match
when={
@@ -182,7 +182,7 @@ export function AssistantMessage(props: {
</Show>
</div>
<Show when={!props.isStreaming}>
- <div class="flex flex-row w-full justify-start items-center h-[32px] px-2 space-x-2 ">
+ <div class="flex flex-row w-full justify-start items-center h-[32px] px-4 space-x-2 ">
<div class="flex flex-row space-x-2 items-center text-xs text-ink-muted">
<div class="w-fit">
<button
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 bd460ad5b6..e4f2d70056 100644
--- a/js/app/packages/core/component/AI/component/message/ChatMessages.tsx
+++ b/js/app/packages/core/component/AI/component/message/ChatMessages.tsx
@@ -203,7 +203,10 @@ export function ChatMessages(props: ChatMessagesProps) {
return (
<StaticMarkdownContext theme={aiChatTheme}>
- <div class="relative flex flex-col w-full px-2 gap-y-2" ref={messagesRef}>
+ <div
+ class="relative flex flex-col w-full px-2 pt-2 gap-y-6 text-sm"
+ ref={messagesRef}
+ >
<Show
when={isEmptyChat()}
fallback={
@@ -212,7 +215,7 @@ export function ChatMessages(props: ChatMessagesProps) {
{(msg) => (
<div
id={'chat-' + msg.id}
- class="w-full transition-colors duration-300 flex flex-col gap-y-2"
+ class="w-full transition-colors duration-300 flex flex-col gap-y-4"
classList={{
'bg-accent': activeIdSelector(msg.id),
}}
@@ -234,7 +237,7 @@ export function ChatMessages(props: ChatMessagesProps) {
<Show when={isStream() || chat.isWaiting() || lastPair()}>
<div
- class="shrink-0 flex flex-col gap-y-2"
+ class="shrink-0 flex flex-col gap-y-4"
style={{
'min-height': `${parentHeight()}px`,
}}
diff --git a/js/app/packages/core/component/AI/component/message/UserMessage.tsx b/js/app/packages/core/component/AI/component/message/UserMessage.tsx
index 970bf0cd30..95537263a1 100644
--- a/js/app/packages/core/component/AI/component/message/UserMessage.tsx
+++ b/js/app/packages/core/component/AI/component/message/UserMessage.tsx
@@ -79,7 +79,7 @@ export function UserMessage(props: {
return (
<div class="flex flex-col space-y-2 group">
<Show when={quote()}>
- <div class="relative w-full text-xs flex flex-row space-x-2 justify-end items-start text-ink-muted">
+ <div class="relative w-full text-xs flex flex-row space-x-2 items-start text-ink-muted">
<div class="flex flex-row items-center space-x-3">
<QuoteIcon class="w-3 h-3 shrink-0" />
<p>"{quote()?.substring(0, 300)}..."</p>
@@ -87,7 +87,7 @@ export function UserMessage(props: {
</div>
</Show>
<Show when={props.message.attachments.length > 0}>
- <div class="flex flex-col space-y-2 items-end justify-end w-auto px-1 pb-1 pl-4 mb-2">
+ <div class="flex flex-col space-y-2 w-full px-1 pb-1 mb-2">
<For each={imageAttachments()}>
{(attachment) => (
<ImagePreview
@@ -115,21 +115,23 @@ export function UserMessage(props: {
</Show>
<Show when={content()}>
- <div class="flex flex-row justify-end w-auto items-center">
+ <div class="flex flex-row w-full items-center">
<Switch>
<Match when={!isEditing()}>
- <Show when={props.edit}>
- <DeprecatedIconButton
- icon={PencilIcon}
- theme="clear"
- onClick={() => setIsEditing(true)}
- />
- </Show>
- <div class="text-align-right! bg-message sender-message px-3.5 w-auto max-w-[80%] py-1.5 whitespace-pre-line relative">
+ <div class="bg-message sender-message rounded-md px-3 py-1 my-px ring ring-edge-muted whitespace-pre-line relative ml-auto max-w-[calc(100%-8rem)]">
<ChatMessageMarkdown
generating={() => false}
text={content()!}
/>
+ <Show when={props.edit}>
+ <div class="absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity">
+ <DeprecatedIconButton
+ icon={PencilIcon}
+ theme="clear"
+ onClick={() => setIsEditing(true)}
+ />
+ </div>
+ </Show>
</div>
</Match>
<Match when={isEditing()}>
diff --git a/js/app/packages/core/component/DocumentPreview.tsx b/js/app/packages/core/component/DocumentPreview.tsx
index 1c5ed7fd73..a196d0b39c 100644
--- a/js/app/packages/core/component/DocumentPreview.tsx
+++ b/js/app/packages/core/component/DocumentPreview.tsx
@@ -718,7 +718,7 @@ export function PopupPreview(props: {
onMouseEnter={props.mouseEnter}
onMouseLeave={props.mouseLeave}
>
- <Panel active class="py-2">
+ <Panel active>
<Switch>
{/* Loading state */}
<Match when={item().loading}>
@@ -745,7 +745,7 @@ export function PopupPreview(props: {
return (
<div class="w-full flex flex-col">
{/* Header: icon + filename + action buttons */}
- <div class="flex items-center justify-between gap-2 px-3 pt-3 pb-2">
+ <div class="flex items-center justify-between gap-2 p-2">
<div class="flex items-center gap-2 min-w-0">
<ItemEntityIcon size="sm" />
<div class="text-sm font-semibold select-text min-w-0">
diff --git a/js/app/packages/core/component/LexicalMarkdown/styles.css b/js/app/packages/core/component/LexicalMarkdown/styles.css
index bce06065ac..6a7b1a1288 100644
--- a/js/app/packages/core/component/LexicalMarkdown/styles.css
+++ b/js/app/packages/core/component/LexicalMarkdown/styles.css
@@ -22,11 +22,6 @@
}
}
-.sender-message * ::selection {
- background-color: rgb(from white r g b / 0.9);
- color: var(--color-accent);
-}
-
.md-p:empty {
min-height: 1.5em;
}