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.

chore(dx): update local bun check scripts to match ci, style(comments): change comment thread styles, fix busted user icons (#3137)

Seamus10cf25718157
diff --git a/js/app/packages/app/index.css b/js/app/packages/app/index.css
index 8a0887e77b..499ebec420 100644
--- a/js/app/packages/app/index.css
+++ b/js/app/packages/app/index.css
@@ -90,7 +90,7 @@
--color-dialog: var(--b0); /* dialog, e.g. dialog background */
--color-input: var(--b0); /* input, e.g. chat/channel input */
--color-button: var(--b0); /* dialog, e.g. dialog background */
- --color-shadow: oklch(calc(var(--b0l) - 0.01 ) var(--b0c) var(--b0h) / 0.2);
+ --color-drop-shadow: oklch(calc(var(--b0l) - 0.01 ) var(--b0c) var(--b0h) / 0.4);
--color-message: color-mix(in oklch, var(--b1) 50%, var(--b2)); /* message background */
--color-hover: var(--b2); /* hover, e.g. hover state for buttons/items */
--color-active: var(--b1); /* elements that are selected or activated */
diff --git a/js/app/packages/core/comments/MessageTopRow.tsx b/js/app/packages/core/comments/MessageTopRow.tsx
index 29cc264b07..3c02addace 100644
--- a/js/app/packages/core/comments/MessageTopRow.tsx
+++ b/js/app/packages/core/comments/MessageTopRow.tsx
@@ -70,7 +70,7 @@ export function MessageRowUI(
};
return (
<div
- class="flex w-full items-start justify-between group relative font-mono"
+ class="flex w-full items-start justify-between group relative text-ink-extra-muted"
classList={{
'mb-3': !props.hideBottomMargin,
}}
@@ -85,14 +85,12 @@ export function MessageRowUI(
<div
class={`size-4 relative flex items-center justify-center shrink-0 rounded-xs`}
>
- <div class="absolute">
- <UserIcon
- size="sm"
- suppressClick={true}
- id={props.authorId}
- isDeleted={false}
- />
- </div>
+ <UserIcon
+ size="sm"
+ suppressClick={true}
+ id={props.authorId}
+ isDeleted={false}
+ />
</div>
)}
<div class="text-xs text-ink truncate grow">{displayName()}</div>
diff --git a/js/app/packages/core/comments/MinimizedThreads.tsx b/js/app/packages/core/comments/MinimizedThreads.tsx
index 04fbeb9e6a..2c40b0bf13 100644
--- a/js/app/packages/core/comments/MinimizedThreads.tsx
+++ b/js/app/packages/core/comments/MinimizedThreads.tsx
@@ -1,5 +1,5 @@
import ChatTeardrop from '@icon/regular/chat-teardrop.svg';
-import { cn } from '@ui';
+import { cn, Layer } from '@ui';
import type { EditorThemeClasses } from 'lexical';
import {
createEffect,
@@ -94,30 +94,32 @@ export function MinimizedThread(props: {
isActive={props.isActive}
transition={false}
>
- <div
- class={cn(
- 'flex flex-row justify-between p-0.5 gap-1 transition-transform items-center text-ink-muted border-edge border relative overflow-clip rounded-sm pointer-events-auto',
- props.isActive && '-translate-x-4'
- )}
- onClick={clickHandler}
- >
+ <Layer depth={2}>
<div
class={cn(
- 'size-6 flex items-center justify-center rounded-xs',
- props.isActive
- ? 'bg-comment text-page'
- : 'bg-comment-bg text-comment-fg'
+ 'flex flex-row justify-between p-0.5 gap-1 bg-panel transition-transform shadow-md shadow-drop-shadow items-center text-ink-muted ring-edge ring relative overflow-clip rounded-sm pointer-events-auto',
+ props.isActive && '-translate-x-4'
)}
+ onClick={clickHandler}
>
- <ChatTeardrop
- class="size-5 pointer-events-auto"
- onClick={clickHandler}
- />
+ <div
+ class={cn(
+ 'size-6 flex items-center justify-center rounded-xs',
+ props.isActive
+ ? 'bg-comment text-page'
+ : 'bg-comment-bg text-comment-fg'
+ )}
+ >
+ <ChatTeardrop
+ class="size-5 pointer-events-auto"
+ onClick={clickHandler}
+ />
+ </div>
+ <div class="flex items-center px-1 h-6 pointer-events-none">
+ <span class="text-xs text-center">{commentCount()}</span>
+ </div>
</div>
- <div class="flex items-center px-1 h-6 pointer-events-none">
- <span class="text-xs text-center">{commentCount()}</span>
- </div>
- </div>
+ </Layer>
</MeasureContainer>
</Show>
);
diff --git a/js/app/packages/core/comments/Thread.tsx b/js/app/packages/core/comments/Thread.tsx
index 0b47786353..cc0d4fc513 100644
--- a/js/app/packages/core/comments/Thread.tsx
+++ b/js/app/packages/core/comments/Thread.tsx
@@ -1,6 +1,7 @@
import { StaticMarkdownContext } from '@core/component/LexicalMarkdown/component/core/StaticMarkdown';
import { createTheme } from '@core/component/LexicalMarkdown/theme';
import type { UserMentionRecord } from '@core/component/LexicalMarkdown/utils/mentionsUtils';
+import { Layer } from '@ui';
import type { EditorThemeClasses } from 'lexical';
import {
type Accessor,
@@ -197,120 +198,122 @@ export function Thread(props: {
forceWidth={props.width}
transition={false}
>
- <div
- // note: pdf-pointer-event-reset is a strange one-off class that mostly normalizes
- // pointer-events: none vs. all inside the .pdfOverlayInner div.
- class="shrink-0 bg-panel p-2 ring-1 ring-edge-muted rounded-sm portal-scope pointer-events-auto pdf-pointer-event-reset"
- classList={{
- 'transition-transform duration-100': true,
- '-translate-x-8': props.isActive,
- }}
- style={{
- width: props.width ? `${props.width}px` : 'auto',
- }}
- ref={props.ref}
- >
- <Show
- when={!props.comment.isNew}
- fallback={
- <EditInput
- textValue={''}
- handleCancel={() => {}}
- onSend={(content: string) => {
- if (content.trim() === '') return;
- // NOTE: we need the server to return the thread id first
- commentOperations.createComment({
- threadId: props.comment.threadId,
- text: content,
- mentions: getAndClearCommentMentions(mentionsSignal),
- });
- }}
- isNewThread
- />
- }
+ <Layer depth={2}>
+ <div
+ // note: pdf-pointer-event-reset is a strange one-off class that mostly normalizes
+ // pointer-events: none vs. all inside the .pdfOverlayInner div.
+ class="shrink-0 bg-panel p-2 ring ring-edge shadow-md rounded-sm shadow-drop-shadow portal-scope pointer-events-auto pdf-pointer-event-reset"
+ classList={{
+ 'transition-transform duration-100': true,
+ '-translate-x-8': props.isActive,
+ }}
+ style={{
+ width: props.width ? `${props.width}px` : 'auto',
+ }}
+ ref={props.ref}
>
- <div
- on:click={() => {
- dispatch({ action: 'soft', editing: false });
- }}
- >
- <Comment
- comment={props.comment}
- isOwned={ownedComment(props.comment.id)}
- isActive={props.isActive}
- isThreaded={replyIds().length > 0}
- >
- <Show when={replyIds().length > 0 && lastReplyId()}>
- <Show when={collapsedCount() > 0}>
- <button
- class="text-xs text-ink-extra-muted font-mono hover:bg-hover hover-transition-bg text-left ml-5 p-1 mb-2"
- on:click={() => {
- batch(() => {
- setActiveThread(props.comment.threadId);
- setAllRepliesVisible(true);
- });
- }}
- >
- {`Show [ ${collapsedCount()} ] ${collapsedCount() > 1 ? 'replies' : 'reply'}`}
- </button>
- </Show>
- </Show>
- </Comment>
- {
- <For each={replyIds()}>
- {(replyId) => {
- const hide = () =>
- collapseRepliesList() && replyId !== lastReplyId();
- return (
- <CommentReply
- hide={hide()}
- replyId={replyId}
- isOwned={ownedComment(replyId)}
- isActive={props.isActive}
- threadId={props.comment.threadId}
- isThreaded={replyId !== lastReplyId()}
- deleteReply={() =>
- commentOperations.deleteComment({
- commentId: replyId,
- })
- }
- updateReply={(content) => {
- Promise.all([
- commentOperations.updateComment(replyId, {
- text: content,
- threadId: props.comment.threadId,
- mentions:
- getAndClearCommentMentions(mentionsSignal),
- }),
- ]);
- }}
- />
- );
+ <Show
+ when={!props.comment.isNew}
+ fallback={
+ <EditInput
+ textValue={''}
+ handleCancel={() => {}}
+ onSend={(content: string) => {
+ if (content.trim() === '') return;
+ // NOTE: we need the server to return the thread id first
+ commentOperations.createComment({
+ threadId: props.comment.threadId,
+ text: content,
+ mentions: getAndClearCommentMentions(mentionsSignal),
+ });
}}
- </For>
+ isNewThread
+ />
}
- </div>
- <Show when={showNewReplyInput()}>
- <NewReplyInput
- textValue={textValue()}
- setTextValue={(val) => dispatch({ action: 'text', val })}
- createReply={(content) => {
- if (content.trim() === '') return;
- dispatch({ action: 'hard', editing: false });
- commentOperations.createComment({
- threadId: props.comment.threadId,
- text: content,
- mentions: getAndClearCommentMentions(mentionsSignal),
- });
+ >
+ <div
+ on:click={() => {
+ dispatch({ action: 'soft', editing: false });
}}
- isEditing={isEditingNewReply()}
- setEditing={(editing) =>
- dispatch({ action: 'hard', editing })
+ >
+ <Comment
+ comment={props.comment}
+ isOwned={ownedComment(props.comment.id)}
+ isActive={props.isActive}
+ isThreaded={replyIds().length > 0}
+ >
+ <Show when={replyIds().length > 0 && lastReplyId()}>
+ <Show when={collapsedCount() > 0}>
+ <button
+ class="text-xs text-ink-extra-muted hover:bg-hover hover:ring hover:ring-edge-muted text-left ml-5 rounded p-1 px-2 mb-2"
+ on:click={() => {
+ batch(() => {
+ setActiveThread(props.comment.threadId);
+ setAllRepliesVisible(true);
+ });
+ }}
+ >
+ {`Show ${collapsedCount()} ${collapsedCount() > 1 ? 'replies' : 'reply'}`}
+ </button>
+ </Show>
+ </Show>
+ </Comment>
+ {
+ <For each={replyIds()}>
+ {(replyId) => {
+ const hide = () =>
+ collapseRepliesList() && replyId !== lastReplyId();
+ return (
+ <CommentReply
+ hide={hide()}
+ replyId={replyId}
+ isOwned={ownedComment(replyId)}
+ isActive={props.isActive}
+ threadId={props.comment.threadId}
+ isThreaded={replyId !== lastReplyId()}
+ deleteReply={() =>
+ commentOperations.deleteComment({
+ commentId: replyId,
+ })
+ }
+ updateReply={(content) => {
+ Promise.all([
+ commentOperations.updateComment(replyId, {
+ text: content,
+ threadId: props.comment.threadId,
+ mentions:
+ getAndClearCommentMentions(mentionsSignal),
+ }),
+ ]);
+ }}
+ />
+ );
+ }}
+ </For>
}
- />
+ </div>
+ <Show when={showNewReplyInput()}>
+ <NewReplyInput
+ textValue={textValue()}
+ setTextValue={(val) => dispatch({ action: 'text', val })}
+ createReply={(content) => {
+ if (content.trim() === '') return;
+ dispatch({ action: 'hard', editing: false });
+ commentOperations.createComment({
+ threadId: props.comment.threadId,
+ text: content,
+ mentions: getAndClearCommentMentions(mentionsSignal),
+ });
+ }}
+ isEditing={isEditingNewReply()}
+ setEditing={(editing) =>
+ dispatch({ action: 'hard', editing })
+ }
+ />
+ </Show>
</Show>
- </Show>
- </div>
+ </div>
+ </Layer>
</MeasureContainer>
</StaticMarkdownContext>
</ThreadContext.Provider>
diff --git a/js/app/packages/core/component/Properties/component/propertyValue/EntityIcon.tsx b/js/app/packages/core/component/Properties/component/propertyValue/EntityIcon.tsx
index eeb60ed983..41388dbbed 100644
--- a/js/app/packages/core/component/Properties/component/propertyValue/EntityIcon.tsx
+++ b/js/app/packages/core/component/Properties/component/propertyValue/EntityIcon.tsx
@@ -30,7 +30,7 @@ export const EntityIcon: Component<EntityValueDisplayProps> = (props) => {
const content = (
<div class="flex items-center gap-2">
- <div class="shrink-0">{icon()}</div>
+ <div class="shrink-0 flex items-center">{icon()}</div>
<span class="truncate">{name()}</span>
</div>
);
diff --git a/js/package.json b/js/package.json
index b3b91d2a16..a10a314f17 100644
--- a/js/package.json
+++ b/js/package.json
@@ -11,10 +11,11 @@
],
"packageManager": "[email protected]",
"scripts": {
+ "fix": "cd app && bunx --bun biome check --write",
+ "lint:ci": "cd app && bunx --bun biome ci --changed --no-errors-on-unmatched --error-on-warnings",
"check": "cd app && tsc --noEmit --skipLibCheck --project packages/app/tsconfig.json",
"lint": "cd app && bunx --bun biome lint --skip=suspicious/noImportCycles",
- "format": "cd app && bunx --bun biome format --write",
- "fix": "cd app && bunx --bun biome lint --write"
+ "format": "cd app && bunx --bun biome format --write"
},
"trustedDependencies": [
"@pulumi/aws-native",