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.

fix(tutorial): fix some tutorial bugs and inconsistencies (#4258)

Seamuse612a6a162e5
diff --git a/js/app/packages/app/component/interactive-onboarding/components/MockAppChrome.tsx b/js/app/packages/app/component/interactive-onboarding/components/MockAppChrome.tsx
index b5fcf4317e..824a7b0075 100644
--- a/js/app/packages/app/component/interactive-onboarding/components/MockAppChrome.tsx
+++ b/js/app/packages/app/component/interactive-onboarding/components/MockAppChrome.tsx
@@ -3,7 +3,6 @@ import { createHotkeyGroup, registerHotkey } from '@core/hotkey/hotkeys';
import type { ValidHotkey } from '@core/hotkey/types';
import MacroIcon from '@icon/macro-logo.svg';
import { AnimatedChannelIcon } from '@icon/wide-channel';
-import { AnimatedCommandIcon } from '@icon/wide-command';
import { AnimatedEmailIcon } from '@icon/wide-email';
import { AnimatedFileMdIcon } from '@icon/wide-fileMd';
import { AnimatedFolderIcon } from '@icon/wide-folder';
@@ -77,10 +76,6 @@ interface MockAppChromeProps {
onFilterChange?: (filter: SandboxSidebarFilter) => void;
/** When set, highlights that sidebar icon in accent color until activated. */
highlightId?: SandboxSidebarFilter;
- /** Called when the command menu button at the bottom of the sidebar is clicked. If omitted, the button is inert. */
- onCommandClick?: () => void;
- /** When true, glows the command menu button until it's clicked for the first time. */
- highlightCommand?: boolean;
/** Called when the create (+) button at the top of the sidebar is clicked. If omitted, the button is inert. */
onCreateClick?: () => void;
/** When true, glows the create button until it's clicked for the first time. */
@@ -118,10 +113,6 @@ export function MockAppChrome(props: MockAppChromeProps) {
props.onFilterChange?.(filter);
};
- const [commandActivated, setCommandActivated] = createSignal(false);
- const isCommandHighlighted = () =>
- !!props.highlightCommand && !commandActivated();
-
const [createActivated, setCreateActivated] = createSignal(false);
const isCreateHighlighted = () =>
!!props.highlightCreate && !createActivated();
@@ -274,23 +265,6 @@ export function MockAppChrome(props: MockAppChromeProps) {
</For>
<div class="mt-auto flex flex-col items-center gap-1">
- <button
- type="button"
- class={cn(
- 'size-6 text-ink rounded-xs p-1 transition-colors cursor-default',
- isCommandHighlighted()
- ? 'opacity-100 hover:bg-ink/10 sidebar-glow'
- : 'opacity-50 hover:opacity-80 hover:bg-ink/10'
- )}
- onClick={(e) => {
- e.preventDefault();
- setCommandActivated(true);
- props.onCommandClick?.();
- }}
- title="Command Menu"
- >
- <AnimatedCommandIcon />
- </button>
<button
type="button"
class="size-6 text-ink rounded-xs p-1 transition-colors cursor-default opacity-50 hover:opacity-80 hover:bg-ink/10"
diff --git a/js/app/packages/app/component/interactive-onboarding/lessons/command-k.tsx b/js/app/packages/app/component/interactive-onboarding/lessons/command-k.tsx
index 63a53aa402..697709d036 100644
--- a/js/app/packages/app/component/interactive-onboarding/lessons/command-k.tsx
+++ b/js/app/packages/app/component/interactive-onboarding/lessons/command-k.tsx
@@ -3,7 +3,6 @@ import { CommandMenuInner, CommandState } from '@app/component/command';
import { createSoupState } from '@app/component/next-soup/create-soup-state';
import { IS_MAC } from '@core/constant/isMac';
import { createFreshSearch } from '@core/util/freshSort';
-import { AnimatedCommandIcon } from '@icon/wide-command';
import { Dialog } from '@kobalte/core/dialog';
import {
createEffect,
@@ -13,7 +12,7 @@ import {
onMount,
} from 'solid-js';
import { MockAppChrome } from '../components/MockAppChrome';
-import { ClickCallout, HotkeyCallout } from '../components-lib';
+import { HotkeyCallout } from '../components-lib';
import { OnboardingEntityList } from '../OnboardingEntityList';
import {
filteredSandboxEntities,
@@ -32,7 +31,7 @@ const CATEGORY_TO_BUCKETS: Record<CategoryFilter, string[] | null> = {
all: null, // no filter
channels: ['channel'],
dms: ['dm'],
- documents: ['note', 'document'],
+ documents: ['note', 'document', 'snippet'],
tasks: ['task'],
chats: ['chat'],
projects: ['project'],
@@ -54,16 +53,6 @@ function CommandKContent(_props: LessonContentProps) {
label=""
completed={completed()}
/>
- <div class="flex items-center gap-3 text-sm text-ink/40">
- <div class="h-px w-8 bg-edge-muted" />
- or
- <div class="h-px flex-1 bg-edge-muted" />
- </div>
- <ClickCallout
- icon={AnimatedCommandIcon}
- label="in the sidebar (bottom)"
- completed={completed()}
- />
</div>
</div>
);
@@ -146,11 +135,7 @@ function CommandKDemo(props: LessonContentProps) {
return (
<>
{/* Entity list visible behind the modal */}
- <MockAppChrome
- onCommandClick={() => setCommandKOpen((v) => !v)}
- highlightCommand
- scopeId={props.scopeId}
- >
+ <MockAppChrome scopeId={props.scopeId}>
<OnboardingEntityList soup={soup} />
</MockAppChrome>
diff --git a/js/app/packages/app/component/interactive-onboarding/lessons/create-entity.tsx b/js/app/packages/app/component/interactive-onboarding/lessons/create-entity.tsx
index 4698eee812..09fc4fe7be 100644
--- a/js/app/packages/app/component/interactive-onboarding/lessons/create-entity.tsx
+++ b/js/app/packages/app/component/interactive-onboarding/lessons/create-entity.tsx
@@ -34,6 +34,7 @@ import { useListNavigation } from '../use-list-navigation';
const BLOCK_TO_SANDBOX: Record<string, SandboxEntityType> = {
md: 'md',
+ snippet: 'snippet',
email: 'email',
task: 'task',
channel: 'channel',
diff --git a/js/app/packages/app/component/interactive-onboarding/lessons/markdown-mentions.tsx b/js/app/packages/app/component/interactive-onboarding/lessons/markdown-mentions.tsx
index a0bbbe41db..674e3ede65 100644
--- a/js/app/packages/app/component/interactive-onboarding/lessons/markdown-mentions.tsx
+++ b/js/app/packages/app/component/interactive-onboarding/lessons/markdown-mentions.tsx
@@ -69,13 +69,14 @@ function MarkdownMentionsDemo(props: LessonContentProps) {
return (
<MockAppChrome scopeId={props.scopeId}>
- <div class="h-full flex flex-col px-8 py-6">
+ <div class="portal-scope h-full flex flex-col px-8 py-6">
<h1 class="text-3xl font-semibold text-ink mb-4">Daily Note</h1>
<MarkdownShell
class="flex-1 min-h-0 cursor-text"
config={config}
placeholder="Start typing... use @ to mention"
autofocus
+ portalScope="local"
/>
</div>
</MockAppChrome>
diff --git a/js/app/packages/app/component/interactive-onboarding/sandbox/sandbox-store.ts b/js/app/packages/app/component/interactive-onboarding/sandbox/sandbox-store.ts
index 10f04a0f15..238f556a82 100644
--- a/js/app/packages/app/component/interactive-onboarding/sandbox/sandbox-store.ts
+++ b/js/app/packages/app/component/interactive-onboarding/sandbox/sandbox-store.ts
@@ -273,6 +273,7 @@ function _removeSandboxEntity(id: string) {
export type SandboxEntityType =
| 'md'
+ | 'snippet'
| 'email'
| 'task'
| 'channel'
@@ -283,6 +284,7 @@ export type SandboxEntityType =
const SAMPLE_NAMES: Record<SandboxEntityType, string> = {
md: 'My Sample Document',
+ snippet: 'My Sample Snippet',
email: 'My Sample Email Draft',
task: 'My Sample Task',
channel: 'My Sample Message',
@@ -307,6 +309,13 @@ export function createSandboxEntity(type: SandboxEntityType): EntityData {
switch (type) {
case 'md':
return { ...base, type: 'document', fileType: 'md' };
+ case 'snippet':
+ return {
+ ...base,
+ type: 'document',
+ fileType: 'md',
+ subType: { type: 'snippet' },
+ };
case 'canvas':
return { ...base, type: 'document', fileType: 'canvas' };
case 'code':
@@ -351,6 +360,7 @@ export function resetSandbox() {
type EntityBucketType =
| 'note'
| 'task'
+ | 'snippet'
| 'email'
| 'channel'
| 'chat'
@@ -361,7 +371,9 @@ type EntityBucketType =
function entityToBucket(entity: EntityData): EntityBucketType {
switch (entity.type) {
case 'document':
- return entity.subType?.type === 'task' ? 'task' : 'note';
+ if (entity.subType?.type === 'task') return 'task';
+ if (entity.subType?.type === 'snippet') return 'snippet';
+ return 'note';
case 'email':
return 'email';
case 'channel':