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.

chg(tasks): task tab in command, tasks are green, more task icon bug fixes, fix broken link paste (#537)

Seamusce3cd21b2699
diff --git a/js/app/packages/app/component/EntityActionsMenuItems.tsx b/js/app/packages/app/component/EntityActionsMenuItems.tsx
index afd23cfcfa..9e9a49acd4 100644
--- a/js/app/packages/app/component/EntityActionsMenuItems.tsx
+++ b/js/app/packages/app/component/EntityActionsMenuItems.tsx
@@ -88,9 +88,9 @@ export const EntityActionsMenuItems = (props: EntityActionsMenuItemsProps) => {
return;
}
if (props.entity.type === 'document') {
- const { fileType, id } = props.entity;
+ const { fileType, id, subType } = props.entity;
splitManager.createNewSplit({
- type: fileTypeToBlockName(fileType),
+ type: fileTypeToBlockName(subType ?? fileType),
id,
});
} else {
diff --git a/js/app/packages/app/component/ItemDragAndDrop.tsx b/js/app/packages/app/component/ItemDragAndDrop.tsx
index 9bc8ad640e..6255409acb 100644
--- a/js/app/packages/app/component/ItemDragAndDrop.tsx
+++ b/js/app/packages/app/component/ItemDragAndDrop.tsx
@@ -28,7 +28,7 @@ export function ItemDragOverlay() {
if (!data) return 'default';
if (data.type === 'document') {
- return fileTypeToBlockName(data.fileType, true);
+ return fileTypeToBlockName(data.subType ?? data.fileType, true);
}
if (data.type === 'channel') {
diff --git a/js/app/packages/app/component/SoupContext.tsx b/js/app/packages/app/component/SoupContext.tsx
index da2e358600..fe4d7e81e1 100644
--- a/js/app/packages/app/component/SoupContext.tsx
+++ b/js/app/packages/app/component/SoupContext.tsx
@@ -872,9 +872,9 @@ export function createNavigationEntityListShortcut({
) {
const { type, id } = selectedEntity;
if (type === 'document') {
- const { fileType } = selectedEntity;
+ const { fileType, subType } = selectedEntity;
splitHandle.replace(
- { type: fileTypeToBlockName(fileType), id },
+ { type: fileTypeToBlockName(subType ?? fileType), id },
true
);
} else {
diff --git a/js/app/packages/app/component/UnifiedListView.tsx b/js/app/packages/app/component/UnifiedListView.tsx
index f24d34ee0f..29a2fa97a2 100644
--- a/js/app/packages/app/component/UnifiedListView.tsx
+++ b/js/app/packages/app/component/UnifiedListView.tsx
@@ -1037,9 +1037,8 @@ export function UnifiedListView(props: UnifiedListViewProps) {
const documentEntityClickHandler: EntityClickHandler<
DocumentEntity | WithSearch<DocumentEntity>
> = async (entity, event) => {
- const { id, fileType } = entity;
- const blockName =
- entity.subType === 'task' ? 'task' : fileTypeToBlockName(fileType);
+ const { id, fileType, subType } = entity;
+ const blockName = fileTypeToBlockName(subType ?? fileType);
const handle = event.altKey
? insertSplit({ type: blockName, id })
: replaceOrInsertSplit({ type: blockName, id });
diff --git a/js/app/packages/app/component/command/KonsoleItem.tsx b/js/app/packages/app/component/command/KonsoleItem.tsx
index 61bf61a42b..8e7ffedb8b 100644
--- a/js/app/packages/app/component/command/KonsoleItem.tsx
+++ b/js/app/packages/app/component/command/KonsoleItem.tsx
@@ -105,6 +105,7 @@ const DEFAULT_CATEGORIES = [
{ name: 'Channels', visible: true },
{ name: 'DMs', visible: true },
{ name: 'Notes', visible: true },
+ { name: 'Tasks', visible: true },
{ name: 'Documents', visible: true },
{ name: 'Chats', visible: true },
{ name: 'Folders', visible: true },
@@ -504,8 +505,15 @@ export function filterItemByCategory(item: CommandItemCard) {
return (
item.type === 'item' &&
item.data.itemType === 'document' &&
+ item.data.subType !== 'task' &&
fileTypeToBlockName(item.data.fileType) === 'md'
);
+ case 'Tasks':
+ return (
+ item.type === 'item' &&
+ item.data.itemType === 'document' &&
+ item.data.subType === 'task'
+ );
case 'Chats':
return item.type === 'item' && item.data.itemType === 'chat';
case 'Emails':
diff --git a/js/app/packages/app/index.css b/js/app/packages/app/index.css
index 5aefa27c3d..374428de68 100644
--- a/js/app/packages/app/index.css
+++ b/js/app/packages/app/index.css
@@ -92,14 +92,14 @@
--theme-write: oklch(from var(--a0) l c 260deg);
--theme-video: oklch(from var(--a0) l c 277deg);
--theme-note: oklch(from var(--a0) l c 293deg);
- --theme-code: oklch(from var(--a0) l c 162deg);
+ --theme-code: oklch(from var(--a0) l c 180deg);
--theme-chat: oklch(from var(--a0) l c 220deg);
--theme-image: oklch(from var(--a0) l c 95deg);
--theme-html: oklch(from var(--a0) l c 47deg);
--theme-rss: oklch(from var(--a0) l c 260deg);
--theme-pdf: oklch(from var(--a0) l c 25deg);
--theme-comment: oklch(from var(--a0) l c 90deg);
- --theme-task: oklch(from var(--a0) l c 330deg);
+ --theme-task: oklch(from var(--a0) l c 150deg);
--gutter-size: 8px;
--transition: 0.2s;
diff --git a/js/app/packages/core/component/LexicalMarkdown/component/core/LinkWithPreview.tsx b/js/app/packages/core/component/LexicalMarkdown/component/core/LinkWithPreview.tsx
index 1cdc898615..d448b990ec 100644
--- a/js/app/packages/core/component/LexicalMarkdown/component/core/LinkWithPreview.tsx
+++ b/js/app/packages/core/component/LexicalMarkdown/component/core/LinkWithPreview.tsx
@@ -42,7 +42,7 @@ export function LinkWithPreview(props: UnfurlLinkProps) {
<Show when={previewOpen()}>
<ScopedPortal>
<div
- class="p-1 absolute top-full left-0 z-10 bg-menu rounded-lg w-80 shadow-lg ring-edge ring-1 mt-2"
+ class="p-1 absolute top-full left-0 z-10 bg-menu w-80 shadow-lg ring-edge ring-1 mt-2"
style={{
transform: 'translateY(0)',
}}
diff --git a/js/app/packages/core/component/LexicalMarkdown/component/menu/FloatingLinkMenu.tsx b/js/app/packages/core/component/LexicalMarkdown/component/menu/FloatingLinkMenu.tsx
index 697aa736c3..d6e1d8f401 100644
--- a/js/app/packages/core/component/LexicalMarkdown/component/menu/FloatingLinkMenu.tsx
+++ b/js/app/packages/core/component/LexicalMarkdown/component/menu/FloatingLinkMenu.tsx
@@ -337,7 +337,7 @@ export function FloatingLinkMenu(props: { closePopup?: () => void }) {
<Switch fallback={<div class="display-none">{props.children}</div>}>
<Match when={linkInfo()?.linkRef !== undefined}>
<div
- class="p-2 fixed bg-menu top-0 left-0 text-sm z-action-menu ring ring-edge rounded-md shadow-lg min-w-80"
+ class="p-2 fixed bg-menu top-0 left-0 text-sm z-action-menu ring ring-edge min-w-100"
use:floatWithElement={{
element: () => linkInfo()?.linkRef,
useBlockBoundary: true,
@@ -378,7 +378,7 @@ export function FloatingLinkMenu(props: { closePopup?: () => void }) {
{(link) => (
<ScopedPortal>
<div
- class="p-2 absolute top-0 left-0 z-10 bg-menu rounded-lg w-80 shadow-lg ring-edge ring-1"
+ class="p-2 absolute top-0 left-0 z-10 bg-menu w-80 shadow-lg ring-edge ring-1"
use:floatWithElement={{
element: () => link().linkRef,
useBlockBoundary: true,
@@ -436,43 +436,41 @@ export function FloatingLinkMenu(props: { closePopup?: () => void }) {
/>
</div>
<div class="relative flex items-center justify-end shrink">
- <div
- class={`flex ease-in-out ${
- expanded()
- ? 'opacity-0 pointer-events-none w-0 -translate-x-28 pl-0'
- : 'opacity-100 w-28 translate-x-0 pl-1'
- }`}
- >
+ <div class="flex ease-in-out" classList={{ hidden: expanded() }}>
<Tooltip tooltip="Open in new tab">
<IconButton
onClick={openInNewTab}
- class="p-1 hover:bg-hover hover-transition-bg rounded-md"
+ class="p-1 hover:bg-hover hover-transition-bg"
theme="accent"
icon={NewTab}
+ size="sm"
/>
</Tooltip>
<Tooltip tooltip="Edit link">
<IconButton
onClick={handleEditClick}
- class="p-1 hover:bg-hover hover-transition-bg rounded-md"
+ class="p-1 hover:bg-hover hover-transition-bg"
theme="clear"
icon={Pencil}
+ size="sm"
/>
</Tooltip>
<Tooltip tooltip="Copy link">
<IconButton
onClick={copyLink}
- class="p-1 hover:bg-hover hover-transition-bg rounded-md"
+ class="p-1 hover:bg-hover hover-transition-bg"
theme="clear"
icon={Copy}
+ size="sm"
/>
</Tooltip>
<Tooltip tooltip="Remove link">
<IconButton
onClick={handleUnlink}
- class="p-1 hover:bg-hover hover-transition-bg rounded-md"
+ class="p-1 hover:bg-hover hover-transition-bg"
theme="clear"
icon={Trash}
+ size="sm"
/>
</Tooltip>
</div>
diff --git a/js/app/packages/core/util/getItemBlockName.ts b/js/app/packages/core/util/getItemBlockName.ts
index cb3c592fee..f7616823f2 100644
--- a/js/app/packages/core/util/getItemBlockName.ts
+++ b/js/app/packages/core/util/getItemBlockName.ts
@@ -2,6 +2,7 @@ import { fileTypeToBlockName } from '@core/constant/allBlocks';
import type { Item } from '@service-storage/generated/schemas/item';
export function getItemBlockName(item: Item, icon?: boolean) {
- if (item.type === 'document') return fileTypeToBlockName(item.fileType, icon);
+ if (item.type === 'document')
+ return fileTypeToBlockName(item.subType ?? item.fileType, icon);
return item.type;
}
diff --git a/js/app/packages/lexical-core/nodes/DocumentMentionNode.ts b/js/app/packages/lexical-core/nodes/DocumentMentionNode.ts
index 8df5340a2f..7ee808b3b2 100644
--- a/js/app/packages/lexical-core/nodes/DocumentMentionNode.ts
+++ b/js/app/packages/lexical-core/nodes/DocumentMentionNode.ts
@@ -1,6 +1,7 @@
import {
$applyNodeReplacement,
DecoratorNode,
+ type DOMConversion,
type DOMConversionMap,
type EditorConfig,
type EditorThemeClasses,
@@ -143,12 +144,8 @@ export class DocumentMentionNode extends DecoratorNode<
return false;
}
- static importDOM(): DOMConversionMap<HTMLSpanElement> | null {
+ static importDOM(): DOMConversionMap<HTMLElement> | null {
const convert = (domNode: HTMLElement) => {
- if (!domNode.hasAttribute('data-document-mention')) {
- return null;
- }
-
const documentId = domNode.getAttribute('data-document-id');
const documentName = domNode.getAttribute('data-document-name') || '';
const blockName = domNode.getAttribute('data-block-name') as string;
@@ -175,10 +172,15 @@ export class DocumentMentionNode extends DecoratorNode<
return null;
};
+ const wrapInCheck = (conversion: DOMConversion) => {
+ return (node: HTMLElement) =>
+ node.hasAttribute('data-document-mention') ? conversion : null;
+ };
+
return {
- span: () => ({ conversion: convert, priority: 1 }),
- div: () => ({ conversion: convert, priority: 1 }),
- a: () => ({ conversion: convert, priority: 1 }),
+ span: wrapInCheck({ conversion: convert, priority: 1 }),
+ div: wrapInCheck({ conversion: convert, priority: 1 }),
+ a: wrapInCheck({ conversion: convert, priority: 1 }),
};
}
diff --git a/js/app/packages/service-clients/service-cognition/generated/tools/types.ts b/js/app/packages/service-clients/service-cognition/generated/tools/types.ts
index cbbc9f31b3..2b2bb881fe 100644
--- a/js/app/packages/service-clients/service-cognition/generated/tools/types.ts
+++ b/js/app/packages/service-clients/service-cognition/generated/tools/types.ts
@@ -808,4 +808,3 @@ export interface WebSearchOutput {
url: string;
}[];
}
-