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(onboarding): rework lesson flow, better styles, better focus (#2158)

Seamuscfa1793c3e1e
diff --git a/js/app/packages/app/component/Launcher.tsx b/js/app/packages/app/component/Launcher.tsx
index 979abf4fcf..fc90e0e31a 100644
--- a/js/app/packages/app/component/Launcher.tsx
+++ b/js/app/packages/app/component/Launcher.tsx
@@ -583,21 +583,21 @@ export const LauncherInner = (props: LauncherInnerProps) => {
},
});
registerHotkey({
- hotkey: 'arrowleft',
+ hotkey: ['arrowleft', 'h'],
scopeId: launcherScope,
description: 'Navigate Left',
keyDownHandler: () => moveFocus(-1),
});
registerHotkey({
- hotkey: 'arrowright' as ValidHotkey,
+ hotkey: ['arrowright', 'l'],
scopeId: launcherScope,
description: 'Navigate Right',
keyDownHandler: () => moveFocus(1),
});
registerHotkey({
- hotkey: 'arrowup' as ValidHotkey,
+ hotkey: ['arrowup', 'k'],
scopeId: launcherScope,
description: 'Navigate Up',
keyDownHandler: (e) => {
@@ -607,7 +607,7 @@ export const LauncherInner = (props: LauncherInnerProps) => {
});
registerHotkey({
- hotkey: 'arrowdown' as ValidHotkey,
+ hotkey: ['arrowdown', 'j'],
scopeId: launcherScope,
description: 'Navigate Down',
keyDownHandler: (e) => {
diff --git a/js/app/packages/app/component/command/CommandMenu.tsx b/js/app/packages/app/component/command/CommandMenu.tsx
index 95ac59bdbd..0fcce36b42 100644
--- a/js/app/packages/app/component/command/CommandMenu.tsx
+++ b/js/app/packages/app/component/command/CommandMenu.tsx
@@ -96,6 +96,8 @@ export function CommandMenuInner(props: {
commandMenuRef: () => HTMLDivElement | undefined;
/** Override items source with custom data (e.g. sandbox entities for tutorial) */
items?: () => CommandMenuItem[];
+ /** Called when the user selects an item from the menu */
+ onSelect?: (item: CommandMenuItem) => void;
}) {
const analytics = useAnalytics();
@@ -133,6 +135,7 @@ export function CommandMenuInner(props: {
function handleItemAction(item: CommandMenuItem, openInNewSplit = false) {
if (!item) return;
+ props.onSelect?.(item);
analytics.track('command_menu_use', { itemType: item.bucket });
if (isCommandItem(item)) {
diff --git a/js/app/packages/app/component/interactive-onboarding/InteractiveOnboarding.tsx b/js/app/packages/app/component/interactive-onboarding/InteractiveOnboarding.tsx
index cb8dbb10f8..30f7318a2c 100644
--- a/js/app/packages/app/component/interactive-onboarding/InteractiveOnboarding.tsx
+++ b/js/app/packages/app/component/interactive-onboarding/InteractiveOnboarding.tsx
@@ -24,7 +24,6 @@ import {
loadCompletedLessons,
saveCompletedLesson,
} from './persistence';
-
import { ClippedPanel } from '@core/component/ClippedPanel';
import { PcNoiseGrid } from '@core/component/PcNoiseGrid';
import { useAnalytics } from '@app/component/analytics-context';
@@ -41,9 +40,23 @@ export default function InteractiveOnboarding() {
clearCompletedLessons();
}
+ const params = new URLSearchParams(location.search);
+ const slideParam = params.get('slide');
+ const slideIndex =
+ slideParam !== null ? Math.max(0, parseInt(slideParam, 10) - 1) : null;
+
+ const sortedLessons = [...LESSONS].sort(
+ (a, b) => (a.order ?? 0) - (b.order ?? 0)
+ );
+ const debugCompleted =
+ slideIndex !== null
+ ? new Set(sortedLessons.slice(0, slideIndex).map((l) => l.id))
+ : undefined;
+
const state = createOnboardingState({
definitions: LESSONS,
- initialCompleted: testMode ? new Set() : loadCompletedLessons(),
+ initialCompleted:
+ debugCompleted ?? (testMode ? new Set() : loadCompletedLessons()),
});
const [readyToContinue, setReadyToContinue] = createSignal(false);
@@ -331,19 +344,21 @@ export default function InteractiveOnboarding() {
scopeId={scopeId}
/>
</div>
- <div class="mt-8 pt-4 flex flex-col gap-2">
- <ContinueButton
- ref={(el) => {
- continueButtonRef = el;
- }}
- onClick={handleContinue}
- label={continueLabel()}
- ghost={!readyToContinue()}
- />
- <Show when={lesson().definition.skippable}>
- <SkipButton onClick={handleSkip} />
- </Show>
- </div>
+ <Show when={!lesson().definition.hideContinue}>
+ <div class="mt-8 pt-4 flex flex-col gap-2">
+ <ContinueButton
+ ref={(el) => {
+ continueButtonRef = el;
+ }}
+ onClick={handleContinue}
+ label={continueLabel()}
+ disabled={!readyToContinue()}
+ />
+ <Show when={lesson().definition.skippable}>
+ <SkipButton onClick={handleSkip} />
+ </Show>
+ </div>
+ </Show>
</div>
{/* Footer */}
diff --git a/js/app/packages/app/component/interactive-onboarding/OnboardingEntityList.tsx b/js/app/packages/app/component/interactive-onboarding/OnboardingEntityList.tsx
index 9ce0b371cc..09dc3ea6e5 100644
--- a/js/app/packages/app/component/interactive-onboarding/OnboardingEntityList.tsx
+++ b/js/app/packages/app/component/interactive-onboarding/OnboardingEntityList.tsx
@@ -1,57 +1,135 @@
import { Entity } from '@entity/entity';
import type { EntityData } from '@entity';
import type { SoupState } from '@app/component/next-soup/create-soup-state';
-import { createEffect, For } from 'solid-js';
+import { createEffect, For, Show } from 'solid-js';
import { cn } from '@ui/utils/classname';
interface OnboardingEntityListProps {
soup: SoupState;
+ removingIds?: () => Set<string>;
}
export function OnboardingEntityList(props: OnboardingEntityListProps) {
return (
- <div
- class="flex flex-col w-full h-full scrollbar-hidden overflow-scroll"
- role="listbox"
- >
- <For each={props.soup.data()}>
- {(entity) => {
- const isFocused = () => props.soup.focus.id() === entity.id;
- let rowRef: HTMLDivElement | undefined;
+ <>
+ <style>{`
+ @keyframes onboarding-entity-remove {
+ 0% { opacity: 1; transform: translateX(0); max-height: 48px; }
+ 60% { opacity: 0; transform: translateX(-12px); max-height: 48px; }
+ 100% { opacity: 0; transform: translateX(-12px); max-height: 0; padding-top: 0; padding-bottom: 0; }
+ }
+ .onboarding-entity-removing {
+ overflow: hidden;
+ pointer-events: none;
+ animation: onboarding-entity-remove 180ms ease-in forwards;
+ }
+ `}</style>
+ <div
+ class="flex flex-col w-full h-full scrollbar-hidden overflow-scroll"
+ role="listbox"
+ >
+ <For each={props.soup.data()}>
+ {(entity) => {
+ const isFocused = () => props.soup.focus.id() === entity.id;
+ const isRemoving = () =>
+ props.removingIds?.().has(entity.id) ?? false;
+ let rowRef: HTMLDivElement | undefined;
- createEffect(() => {
- if (isFocused()) {
- rowRef?.scrollIntoView({ block: 'nearest' });
- }
- });
+ createEffect(() => {
+ if (isFocused()) {
+ rowRef?.scrollIntoView({ block: 'nearest' });
+ }
+ });
- return (
- <Entity.Root
- ref={rowRef}
- entity={entity as EntityData}
- class={cn(
- 'relative w-full min-h-10 flex items-center gap-2 px-3 text-sm font-semibold',
- {
- 'bg-accent/5 outline-1 outline-accent/20 outline-offset-[-1px]':
- isFocused(),
- 'hover:bg-hover/30': !isFocused(),
- }
- )}
- >
- <div
+ return (
+ <Entity.Root
+ ref={rowRef}
+ entity={entity as EntityData}
class={cn(
- 'absolute h-full w-[3px] left-0 top-0 bg-accent opacity-0',
- { 'opacity-100': isFocused() }
+ 'relative w-full min-h-10 flex items-center gap-2 px-5 text-sm font-semibold',
+ {
+ 'bg-accent/5 outline-1 outline-accent/20 outline-offset-[-1px]':
+ isFocused(),
+ 'hover:bg-hover/30': !isFocused(),
+ 'onboarding-entity-removing': isRemoving(),
+ }
)}
- />
- <div class="size-4 shrink-0">
- <Entity.Icon entity={entity as EntityData} />
- </div>
- <Entity.Title entity={entity as EntityData} />
- </Entity.Root>
- );
- }}
- </For>
- </div>
+ >
+ <div
+ class={cn(
+ 'absolute h-full w-[3px] left-0 top-0 bg-accent opacity-0',
+ { 'opacity-100': isFocused() }
+ )}
+ />
+ <Show
+ when={entity.type === 'email'}
+ fallback={
+ <>
+ <span class="size-1.5 shrink-0" />
+ <div class="size-4 shrink-0">
+ <Entity.Icon entity={entity as EntityData} />
+ </div>
+ <Entity.Title entity={entity as EntityData} />
+ <span class="ml-auto font-mono font-light uppercase tracking-wide text-xs text-ink/40 shrink-0">
+ <Entity.Timestamp entity={entity as EntityData} />
+ </span>
+ </>
+ }
+ >
+ {/* Fixed-width: unread dot + icon + sender */}
+ <div class="w-[22ch] shrink-0 flex items-center gap-2 min-w-0">
+ <span
+ class={cn('size-1.5 rounded-full bg-accent shrink-0', {
+ 'opacity-0': (
+ entity as EntityData & { isRead: boolean }
+ ).isRead,
+ })}
+ />
+ <div class="size-4 shrink-0">
+ <Entity.Icon entity={entity as EntityData} />
+ </div>
+ <span
+ class={cn('truncate', {
+ 'text-ink font-semibold': !(
+ entity as EntityData & { isRead: boolean }
+ ).isRead,
+ 'text-ink/60 font-normal': (
+ entity as EntityData & { isRead: boolean }
+ ).isRead,
+ })}
+ >
+ {
+ (entity as EntityData & { senderName: string })
+ .senderName
+ }
+ </span>
+ </div>
+ <span class="flex-1 flex items-baseline gap-2 min-w-0 truncate">
+ <span
+ class={cn('truncate shrink-0 max-w-[40%]', {
+ 'font-semibold': !(
+ entity as EntityData & { isRead: boolean }
+ ).isRead,
+ 'font-normal text-ink/70': (
+ entity as EntityData & { isRead: boolean }
+ ).isRead,
+ })}
+ >
+ <Entity.Title entity={entity as EntityData} />
+ </span>
+ <span class="truncate text-ink/50 font-normal">
+ {(entity as EntityData & { snippet: string }).snippet}
+ </span>
+ </span>
+ <span class="ml-auto font-mono font-light uppercase tracking-wide text-xs text-ink/40 shrink-0">
+ <Entity.Timestamp entity={entity as EntityData} />
+ </span>
+ </Show>
+ </Entity.Root>
+ );
+ }}
+ </For>
+ </div>
+ </>
);
}
diff --git a/js/app/packages/app/component/interactive-onboarding/components-lib.tsx b/js/app/packages/app/component/interactive-onboarding/components-lib.tsx
index 14297da0f4..19aff9a457 100644
--- a/js/app/packages/app/component/interactive-onboarding/components-lib.tsx
+++ b/js/app/packages/app/component/interactive-onboarding/components-lib.tsx
@@ -1,6 +1,6 @@
-import { createSignal, For, onCleanup, onMount } from 'solid-js';
+import { createSignal, For, onCleanup, onMount, Show } from 'solid-js';
+import CheckIcon from '@icon/bold/check-bold.svg';
import { cn } from '@ui/utils/classname';
-import { Hotkey } from '@core/component/Hotkey';
const DISPLAY_TO_EVENT_KEY: Record<string, string> = {
'↓': 'arrowdown',
@@ -21,126 +21,129 @@ function displayToEventKey(display: string): string {
interface HotkeyCalloutProps {
keys: string[];
label: string;
- size?: 'lg' | 'sm';
separator?: string;
- /** When true, all keys stay permanently highlighted. */
completed?: boolean;
}
export function HotkeyCallout(props: HotkeyCalloutProps) {
- const isLarge = () => (props.size ?? 'lg') === 'lg';
- const [activeKeys, setActiveKeys] = createSignal<Set<string>>(new Set());
- // Keys that have been pressed at least once (for progressive chord feedback)
- const [everPressed, setEverPressed] = createSignal<Set<string>>(new Set());
- // Whether the full chord was completed (all keys held simultaneously)
- const [chordDone, setChordDone] = createSignal(false);
+ const [pressedKeys, setPressedKeys] = createSignal<Set<string>>(new Set());
onMount(() => {
const onKeyDown = (e: KeyboardEvent) => {
- if (chordDone() || props.completed) return;
const pressed = e.key.toLowerCase();
const match = props.keys.find((k) => displayToEventKey(k) === pressed);
if (match) {
- setActiveKeys((prev) => {
- const next = new Set(prev);
- next.add(match);
- // Check if all keys in the chord are now active
- if (next.size === props.keys.length) {
- setChordDone(true);
- }
- return next;
- });
- setEverPressed((prev) => {
- const next = new Set(prev);
- next.add(match);
- return next;
- });
+ setPressedKeys((prev) => new Set(prev).add(match));
}
};
const onKeyUp = (e: KeyboardEvent) => {
- if (chordDone() || props.completed) return;
+ if (props.completed) return;
const released = e.key.toLowerCase();
- const isModifier = released === 'meta' || released === 'control';
- if (isModifier) {
- setActiveKeys(new Set<string>());
- } else {
- setActiveKeys((prev) => {
- const matched = props.keys.find(
- (k) => displayToEventKey(k) === released
- );
- if (!matched) return prev;
- const next = new Set(prev);
- next.delete(matched);
- return next;
- });
+ // When a modifier is released the OS swallows subsequent keyup events,
+ // so clear everything to prevent keys getting stuck.
+ if (released === 'meta' || released === 'control' || released === 'alt') {
+ setPressedKeys(new Set([]));
+ return;
}
+ setPressedKeys((prev) => {
+ const matched = props.keys.find(
+ (k) => displayToEventKey(k) === released
+ );
+ if (!matched) return prev;
+ const next = new Set(prev);
+ next.delete(matched);
+ return next;
+ });
};
- const onBlur = () => {
- if (!chordDone() && !props.completed) {
- setActiveKeys(new Set<string>());
- }
+ const clearAll = () => {
+ if (!props.completed) setPressedKeys(new Set([]));
+ };
+ const onVisibilityChange = () => {
+ if (document.hidden) clearAll();
};
document.addEventListener('keydown', onKeyDown, { capture: true });
document.addEventListener('keyup', onKeyUp, { capture: true });
- window.addEventListener('blur', onBlur);
+ document.addEventListener('visibilitychange', onVisibilityChange);
+ window.addEventListener('blur', clearAll);
onCleanup(() => {
document.removeEventListener('keydown', onKeyDown, { capture: true });
document.removeEventListener('keyup', onKeyUp, { capture: true });
- window.removeEventListener('blur', onBlur);
+ document.removeEventListener('visibilitychange', onVisibilityChange);
+ window.removeEventListener('blur', clearAll);
});
});
- const isLocked = () => props.completed || chordDone();
-
- /** Per-key highlight state: 'full' | 'partial' | 'none' */
- const keyState = (key: string): 'full' | 'partial' | 'none' => {
- if (isLocked()) return 'full';
- if (activeKeys().has(key)) return 'full';
- if (everPressed().has(key)) return 'partial';
- return 'none';
- };
-
return (
- <div
- class={cn(
- isLarge()
- ? 'flex items-center gap-3 rounded-xs bg-hover/50 px-4 py-3 border border-edge-muted'
- : 'inline-flex items-center gap-1.5'
- )}
- >
- <div class="flex items-center gap-1.5">
+ <div class="flex items-center gap-3 rounded-xs bg-hover/50 px-4 py-3 border border-edge-muted bracket-never">
+ <style>{`
+ @keyframes hotkey-pulse {
+ 0% { outline: 2px solid rgb(from var(--color-edge) r g b / 0.3); outline-offset: 0px; }
+ 100% { outline: 2px solid rgb(from var(--color-edge) r g b / 0); outline-offset: 10px; }
+ }
+ .hotkey-pulsing {
+ animation: hotkey-pulse 1.4s cubic-bezier(0.2, 0.8, 0.4, 1);
+ }
+ `}</style>
+ <div class="flex items-center gap-1.5 bracket-never">
<For each={props.keys}>
- {(key, i) => (
- <>
- {i() > 0 && props.separator && (
+ {(key, i) => {
+ let keyRef: HTMLSpanElement | undefined;
+
+ const isPressed = () => pressedKeys().has(key);
+
+ onMount(() => {
+ const onKeyDown = (e: KeyboardEvent) => {
+ const pressed = e.key.toLowerCase();
+ if (displayToEventKey(key) !== pressed) return;
+ if (!keyRef) return;
+ keyRef.classList.remove('hotkey-pulsing');
+ void keyRef.offsetWidth; // reflow to restart animation
+ keyRef.classList.add('hotkey-pulsing');
+ };
+ const onAnimationEnd = () => {
+ keyRef?.classList.remove('hotkey-pulsing');
+ };
+ document.addEventListener('keydown', onKeyDown, {
+ capture: true,
+ });
+ keyRef?.addEventListener('animationend', onAnimationEnd);
+ onCleanup(() => {
+ document.removeEventListener('keydown', onKeyDown, {
+ capture: true,
+ });
+ keyRef?.removeEventListener('animationend', onAnimationEnd);
+ });
+ });
+
+ return (
+ <>
+ {i() > 0 && props.separator && (
+ <span class="text-ink-extra-muted/70 text-sm">
+ {props.separator}
+ </span>
+ )}
<span
- class={cn('text-ink/40', isLarge() ? 'text-sm' : 'text-xs')}
+ ref={keyRef}
+ class={cn(
+ 'inline-grid place-items-center rounded-sm border px-2.5 py-1 text-base',
+ isPressed() || props.completed
+ ? 'bg-ink/10 border-edge text-ink'
+ : 'bg-transparent border-edge-muted text-ink'
+ )}
>
- {props.separator}
+ {key}
</span>
- )}
- <span
- class={cn(
- 'rounded-sm border',
- isLarge() ? 'px-2.5 py-1 text-base' : 'px-1.5 py-0.5 text-xs',
- keyState(key) === 'full'
- ? 'bg-ink border-ink text-panel'
- : keyState(key) === 'partial'
- ? 'bg-ink/15 border-edge-muted text-ink'
- : 'bg-hover/50 border-edge-muted text-ink'
- )}
- >
- {key}
- </span>
- </>
- )}
+ </>
+ );
+ }}
</For>
</div>
- <span
- class={cn(isLarge() ? 'text-sm text-ink/70' : 'text-sm text-ink/70')}
- >
- {props.label}
- </span>
+ <span class="text-sm text-muted">{props.label}</span>
+ <Show when={props.completed}>
+ <div class="bg-accent text-panel size-5 rounded xs flex items-center justify-center ml-auto">
+ <CheckIcon class="size-4" />
+ </div>
+ </Show>
</div>
);
}
@@ -148,7 +151,7 @@ export function HotkeyCallout(props: HotkeyCalloutProps) {
interface ContinueButtonProps {
onClick: () => void;
label?: string;
- ghost?: boolean;
+ disabled?: boolean;
ref?: (el: HTMLButtonElement) => void;
}
@@ -158,24 +161,27 @@ export function ContinueButton(props: ContinueButtonProps) {
ref={props.ref}
type="button"
class={cn(
- 'w-full px-4 py-2.5 text-lg font-bold rounded-xs flex items-center justify-between gap-2 bracket-never',
- props.ghost
- ? 'bg-transparent text-ink/40 font-normal'
- : 'bg-accent text-panel hover:bg-accent hover:ring-2 ring-accent ring-offset-1 focus:ring-2'
+ 'w-full px-3 py-2.5 text-lg font-bold rounded-xs flex items-center justify-between gap-2 bracket-never',
+ {
+ 'bg-transparent text-ink/40 font-normal ring-1 ring-edge-muted/50':
+ props.disabled,
+ 'bg-accent text-panel hover:bg-accent hover:ring-2 ring-accent ring-offset-1 focus:ring-2':
+ !props.disabled,
+ }
)}
onClick={props.onClick}
>
{props.label ?? 'Continue'}
- <span
+ {/*<span
class={cn(
- 'text-sm px-3 py-1 border rounded-sm',
- props.ghost
- ? 'border-edge-muted text-ink/30'
- : 'border-panel/50 text-panel'
+ 'text-sm px-3 py-1 border rounded-sm flex items-center gap-1 border-panel/50 text-panel',
+ { 'opacity-0': props.disabled }
)}
>
- <Hotkey shortcut="cmd+enter" />
- </span>
+ <Hotkey shortcut="cmd" />
+ <span>+</span>
+ <span>Enter</span>
+ </span>*/}
</button>
);
}
@@ -188,13 +194,11 @@ export function SkipButton(props: SkipButtonProps) {
return (
<button
type="button"
- class="w-full px-4 py-2.5 text-lg rounded-xs flex items-center justify-between gap-2 bg-transparent text-ink/40 hover:bg-hover/60"
+ class="w-full px-4 py-2.5 text-lg rounded-xs flex items-center gap-2 bg-transparent text-ink/40 hover:bg-hover/60 bracket-never focus:bg-hover/50"
onClick={props.onClick}
>
Skip
- <span class="text-sm px-3 py-1 border rounded-sm border-edge-muted text-ink/30">
- esc
- </span>
+ <span class="opacity-50">(esc)</span>
</button>
);
}
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 5f9df82e3d..f43b285b30 100644
--- a/js/app/packages/app/component/interactive-onboarding/components/MockAppChrome.tsx
+++ b/js/app/packages/app/component/interactive-onboarding/components/MockAppChrome.tsx
@@ -1,40 +1,215 @@
-import { SIDEBAR_LINKS } from '@app/component/app-sidebar/sidebar';
-import { For, type JSX } from 'solid-js';
+import { For, Show, type JSX, onMount, onCleanup } from 'solid-js';
import MacroIcon from '@macro-icons/macro-logo.svg';
import { Dynamic } from 'solid-js/web';
+import { cn } from '@ui/utils/classname';
+import {
+ sidebarFilter,
+ setSidebarFilter,
+ type SandboxSidebarFilter,
+} from '../sandbox/sandbox-store';
+import { AnimatedFileMdIcon } from '@macro-icons/wide/animating/fileMd';
+import { AnimatedEmailIcon } from '@macro-icons/wide/animating/email';
+import { AnimatedTaskIcon } from '@macro-icons/wide/animating/task';
+import { AnimatedChannelIcon } from '@macro-icons/wide/animating/channel';
+import { AnimatedStarIcon } from '@macro-icons/wide/animating/star';
+import { AnimatedFolderIcon } from '@macro-icons/wide/animating/folder';
+import { registerHotkey, createHotkeyGroup } from '@core/hotkey/hotkeys';
+import { GO_TO_COMMAND_SCOPE, GO_TO_LEADER_KEY } from '@app/constants/hotkeys';
+import type { ValidHotkey } from '@core/hotkey/types';
+import { Tooltip } from '@core/component/Tooltip';
+
+export const MOCK_SIDEBAR_LINKS = [
+ {
+ id: 'channels',
+ label: 'Channels',
+ icon: AnimatedChannelIcon,
+ hotkey: 'c',
+ },
+ {
+ id: 'documents',
+ label: 'Documents',
+ icon: AnimatedFileMdIcon,
+ hotkey: 'd',
+ },
+ {
+ id: 'mail',
+ label: 'Emails',
+ icon: AnimatedEmailIcon,
+ hotkey: 'e',
+ },
+ {
+ id: 'tasks',
+ label: 'Tasks',
+ icon: AnimatedTaskIcon,
+ hotkey: 't',
+ },
+ {
+ id: 'agents',
+ label: 'Agents',
+ icon: AnimatedStarIcon,
+ hotkey: 'a',
+ },
+ {
+ id: 'folders',
+ label: 'Folders',
+ icon: AnimatedFolderIcon,
+ hotkey: 'f',
+ },
+] satisfies {
+ id: SandboxSidebarFilter;
+ label: string;
+ icon: (props: {}) => JSX.Element;
+ hotkey: ValidHotkey;
+}[];
interface MockAppChromeProps {
- viewTitle?: string;
children?: JSX.Element;
+ /** Called whenever the sidebar filter changes (click or hotkey). */
+ onFilterChange?: (filter: SandboxSidebarFilter) => void;
}
export function MockAppChrome(props: MockAppChromeProps) {
+ const displayTitle = () => {
+ const filter = sidebarFilter();
+ if (!filter) return 'All Items';
+ const match = MOCK_SIDEBAR_LINKS.find((link) => link.id === filter);
+ return match?.label ?? 'All Items';
+ };
+
+ const setFilter = (filter: SandboxSidebarFilter) => {
+ setSidebarFilter(filter);
+ props.onFilterChange?.(filter);
+ };
+
+ const group = createHotkeyGroup();
+
+ onMount(() => {
+ registerHotkey({
+ hotkey: GO_TO_LEADER_KEY,
+ scopeId: 'global',
+ description: 'Go to page',
+ keyDownHandler: () => false,
+ activateCommandScopeId: GO_TO_COMMAND_SCOPE,
+ hide: true,
+ registrationType: 'add',
+ }).withGroup(group);
+
+ for (const link of MOCK_SIDEBAR_LINKS) {
+ registerHotkey({
+ hotkey: link.hotkey as ValidHotkey,
+ scopeId: GO_TO_COMMAND_SCOPE,
+ description: `Go to ${link.label}`,
+ keyDownHandler: () => {
+ setFilter(link.id as SandboxSidebarFilter);
+ return true;
+ },
+ }).withGroup(group);
+ }
+ });
+
+ onCleanup(() => group.dispose());
+
return (
<div class="size-full p-4 bg-panel">
<div class="flex size-full bg-page rounded-sm border border-edge-muted">
- {/* Mock sidebar */}
- <div class="px-3 shrink-0 bg-surface-secondary/50 flex flex-col items-center py-3 gap-3">
- <MacroIcon class="size-5 text-accent" />
- <For each={SIDEBAR_LINKS}>
- {(link) => (
- <div class="size-5 text-ink rounded-xs p-1 opacity-50">
- {link.icon && <Dynamic component={link.icon} />}
- </div>
+ <div class="px-2 shrink-0 bg-surface-secondary/50 flex flex-col items-center py-3 gap-1">
+ <MacroIcon class="size-5 text-accent mb-4" />
+ <button
+ type="button"
+ class={cn(
+ 'size-6 text-ink rounded-xs p-1 transition-colors cursor-default hover:bg-ink/10',
+ sidebarFilter() === null
+ ? 'opacity-100 bg-ink/10 text-ink'
+ : 'opacity-50 hover:opacity-80'
)}
+ onClick={(e) => {
+ e.preventDefault();
+ setFilter(null);
+ }}
+ title="All"
+ >
+ <svg
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ stroke-width="2"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ >
+ <rect x="3" y="3" width="7" height="7" />
+ <rect x="14" y="3" width="7" height="7" />
+ <rect x="3" y="14" width="7" height="7" />
+ <rect x="14" y="14" width="7" height="7" />
+ </svg>
+ </button>
+ <For each={MOCK_SIDEBAR_LINKS}>
+ {(link) => {
+ const isActive = () => sidebarFilter() === link.id;
+ return (
+ <Tooltip
+ tooltip={
+ <span class="flex items-center gap-1.5 text-xs">
+ {link.label}
+ <span class="flex items-center gap-1 text-ink/40">
+ <span class="px-1.5 rounded-sm border border-edge-muted">
+ G
+ </span>
+ then
+ <span class="px-1.5 rounded-sm border border-edge-muted">
+ {link.hotkey.toUpperCase()}
+ </span>
+ </span>
+ </span>
+ }
+ placement="right"
+ >
+ <button
+ type="button"
+ class={cn(
+ 'size-6 text-ink rounded-xs p-1 transition-colors cursor-default hover:bg-ink/10',
+ isActive()
+ ? 'opacity-100 bg-ink/10 text-ink'
+ : 'opacity-50 hover:opacity-80'
+ )}
+ onClick={(e) => {
+ e.preventDefault();
+ setFilter(link.id as SandboxSidebarFilter);
+ }}
+ >
+ {link.icon && (
+ <Dynamic component={link.icon} class="size-4" />
+ )}
+ </button>
+ </Tooltip>
+ );
+ }}
</For>
</div>
{/* Main area */}
<div class="flex-1 min-w-0 flex flex-col m-1 ml-0 bg-panel border border-edge-muted rounded-sm">
{/* Mock top bar */}
- <div class="h-10 shrink-0 border-b border-edge-muted flex items-center px-3">
- <span class="text-sm font-semibold text-ink/60">
- {props.viewTitle ?? 'Inbox'}
- </span>
- </div>
+ <Show when={sidebarFilter() !== 'empty'}>
+ <div class="h-10 shrink-0 border-b border-edge-muted flex items-center px-3">
+ <span class="text-sm font-semibold text-ink/60">
+ {displayTitle()}
+ </span>
+ </div>
+ </Show>
{/* Content area */}
- <div class="flex-1 min-h-0 overflow-y-auto">{props.children}</div>
+ <div class="flex-1 min-h-0 overflow-y-auto">
+ <Show
+ when={sidebarFilter() !== 'empty'}
+ fallback={
+ <div class="flex items-center justify-center size-full">
+ <MacroIcon class="size-10 text-ink/10" />
+ </div>
+ }
+ >
+ {props.children}
+ </Show>
+ </div>
</div>
</div>
</div>
diff --git a/js/app/packages/app/component/interactive-onboarding/lessons/choose-plan.tsx b/js/app/packages/app/component/interactive-onboarding/lessons/choose-plan.tsx
index fad80f6940..70e81ee400 100644
--- a/js/app/packages/app/component/interactive-onboarding/lessons/choose-plan.tsx
+++ b/js/app/packages/app/component/interactive-onboarding/lessons/choose-plan.tsx
@@ -42,45 +42,57 @@ function ChoosePlanContent(props: LessonContentProps) {
function ChoosePlanDemo() {
return (
<div class="h-full w-full flex items-center justify-center px-8">
- <div class="flex gap-4 w-full max-w-2xl">
+ <div class="flex gap-4 w-full max-w-2xl items-start">
<For each={PLANS}>
{(plan) => (
- <div
- class="flex-1 rounded-sm border bg-panel flex flex-col overflow-hidden"
- classList={{
- 'border-accent ring-1 ring-accent': !!plan.popular,
- 'border-edge-muted': !plan.popular,
- }}
- >
- {plan.popular && (
- <div class="bg-accent text-panel text-[10px] font-semibold text-center py-0.5">
- Most popular
- </div>
- )}
- <div class="p-4 flex flex-col gap-3 flex-1">
- <div>
- <h3 class="text-lg font-semibold text-ink">{plan.name}</h3>
- <p class="text-xs text-ink/50 mt-0.5">{plan.description}</p>
- </div>
- <div class="flex items-baseline gap-0.5">
- <span class="text-3xl font-bold text-ink">${plan.price}</span>
- <span class="text-sm text-ink/40">/mo</span>
- </div>
- <div class="text-xs text-ink/60">
- <span class="font-semibold text-ink">{plan.calls}</span> AI
- tool calls per month
- </div>
- <div class="mt-auto pt-2">
- <button
- type="button"
- class="w-full py-2 rounded-xs text-sm font-semibold"
- classList={{
- 'bg-accent text-panel': !!plan.popular,
- 'bg-ink/8 text-ink hover:bg-ink/12': !plan.popular,
- }}
- >
- Get {plan.name}
- </button>
+ <div class="flex-1 flex flex-col">
+ {/* Badge row — always reserves the same height so cards align */}
+ <div class="h-5 flex items-end justify-start">
+ {plan.popular && (
+ <span class="bg-accent text-panel text-[10px] font-semibold px-2 py-0.5 rounded-sm rounded-b-none translate-x-[-1px]">
+ Most popular
+ </span>
+ )}
+ </div>
+
+ {/* Card */}
+ <div
+ class="border bg-panel flex flex-col overflow-hidden"
+ style={{
+ 'border-radius': plan.popular ? '0 2px 2px 2px' : '2px',
+ }}
+ classList={{
+ 'border-accent ring-1 ring-accent': !!plan.popular,
+ 'border-edge-muted': !plan.popular,
+ }}
+ >
+ <div class="p-4 flex flex-col gap-3 flex-1">
+ <div>
+ <h3 class="text-xl font-semibold text-ink">{plan.name}</h3>
+ <p class="text-sm text-ink/50 mt-0.5">{plan.description}</p>
+ </div>
+ <div class="flex items-baseline gap-0.5">
+ <span class="text-4xl font-bold text-ink">
+ ${plan.price}
+ </span>
+ <span class="text-base text-ink/40">/mo</span>
+ </div>
+ <div class="text-sm text-ink/60">
+ <span class="font-semibold text-ink">{plan.calls}</span> AI
+ tool calls
+ </div>
+ <div class="mt-auto pt-2">
+ <button
+ type="button"
+ class="w-full py-2 rounded-xs text-base font-semibold"
+ classList={{
+ 'bg-accent text-panel': !!plan.popular,
+ 'bg-ink/8 text-ink hover:bg-ink/12': !plan.popular,
+ }}
+ >
+ Get {plan.name}
+ </button>
+ </div>
</div>
</div>
</div>
@@ -97,4 +109,5 @@ export const choosePlanLesson: LessonDefinition = {
content: ChoosePlanContent,
demo: ChoosePlanDemo,
order: 80,
+ hideContinue: true,
};
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 a1decb3e00..508d93381b 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
@@ -5,17 +5,17 @@ import { ClippedPanel } from '@core/component/ClippedPanel';
import { createFreshSearch } from '@core/util/freshSort';
import { Dialog } from '@kobalte/core/dialog';
import {
- sandboxEntities,
+ filteredSandboxEntities,
sandboxToCommandItems,
} from '../sandbox/sandbox-store';
import {
createEffect,
createMemo,
createSignal,
- on,
onCleanup,
onMount,
} from 'solid-js';
+import { Hotkey } from '@core/component/Hotkey';
import { HotkeyCallout } from '../components-lib';
import { MockAppChrome } from '../components/MockAppChrome';
import { OnboardingEntityList } from '../OnboardingEntityList';
@@ -24,6 +24,9 @@ import type { LessonContentProps, LessonDefinition } from '../types';
/** Module-level signal toggled by the onboarding shell's cmd+k handler. */
export const [commandKOpen, setCommandKOpen] = createSignal(false);
+/** Shared completion state between content and demo panels. */
+const [completed, setCompleted] = createSignal(false);
+
/** Map category filter to the bucket values used by sandbox items. */
const CATEGORY_TO_BUCKETS: Record<CategoryFilter, string[] | null> = {
all: null, // no filter
@@ -38,34 +41,43 @@ const CATEGORY_TO_BUCKETS: Record<CategoryFilter, string[] | null> = {
people: [], // sandbox has no people — show nothing
};
-function CommandKContent(props: LessonContentProps) {
- const [completed, setCompleted] = createSignal(false);
-
- // Complete as soon as the user opens the command menu
- createEffect(
- on(commandKOpen, (open) => {
- if (open && !completed()) {
- setCompleted(true);
- props.onComplete();
- }
- })
- );
-
+function CommandKContent(_props: LessonContentProps) {
return (
<div class="flex flex-col gap-3 onboarding-stagger">
- <HotkeyCallout keys={['⌘', 'K']} label="to open the command menu" />
<p>
- Search for anything — documents, emails, tasks, channels — and navigate
- to it instantly.
+ The Command Menu is another way to quickly find items in your workspace.
+ Search for documents, tasks, channels, and more — and navigate to them
+ instantly.
</p>
- <p>
- Press <strong>⌘K</strong> to try it out.
+ <HotkeyCallout
+ keys={['⌘', 'K']}
+ label="to open the command menu"
+ completed={completed()}
+ />
+ <p class="flex flex-wrap items-center gap-x-1 gap-y-1 text-sm text-fg-muted">
+ <strong>Tip:</strong> Search and use
+ <span class="flex border border-edge-muted text-[0.625rem] rounded-xs items-center px-1.5 py-0.25 font-normal">
+ <Hotkey shortcut="ctrl+j" class="space-x-1" />
+ </span>
+ /
+ <span class="flex border border-edge-muted text-[0.625rem] rounded-xs items-center px-1.5 py-0.25 font-normal">
+ <Hotkey shortcut="ctrl+k" class="space-x-1" />
+ </span>
+ or
+ <span class="flex border border-edge-muted text-[0.625rem] rounded-xs items-center px-1.5 py-0.25 font-normal">
+ <Hotkey shortcut="arrowup" class="space-x-1" />
+ </span>
+ /
+ <span class="flex border border-edge-muted text-[0.625rem] rounded-xs items-center px-1.5 py-0.25 font-normal">
+ <Hotkey shortcut="arrowdown" class="space-x-1" />
+ </span>
+ to move the cursor, then select an item to continue.
</p>
</div>
);
}
-function CommandKDemo(_props: LessonContentProps) {
+function CommandKDemo(props: LessonContentProps) {
const [commandMenuRef, setCommandMenuRef] = createSignal<HTMLDivElement>();
onMount(() => {
@@ -75,6 +87,7 @@ function CommandKDemo(_props: LessonContentProps) {
onCleanup(() => {
CommandState.forceReset();
setCommandKOpen(false);
+ setCompleted(false);
});
const allItems = () => sandboxToCommandItems();
@@ -115,63 +128,42 @@ function CommandKDemo(_props: LessonContentProps) {
return items;
});
- // Capture the initial height on first render so the top offset stays fixed
- // even as the list shrinks from filtering.
- const [topOffset, setTopOffset] = createSignal<number | undefined>(undefined);
let contentEl: HTMLDivElement | undefined;
- const measureOnce = () => {
- if (topOffset() !== undefined || !contentEl) return;
- // Wait a frame for the menu to fully render
- requestAnimationFrame(() => {
- if (!contentEl) return;
- const h = contentEl.getBoundingClientRect().height;
- setTopOffset(Math.max(0, (window.innerHeight - h) / 2));
- });
- };
-
- // Re-measure each time the dialog opens
- createEffect(() => {
- if (commandKOpen()) {
- setTopOffset(undefined);
- requestAnimationFrame(measureOnce);
- }
- });
-
const soup = createSoupState({
- initialData: sandboxEntities(),
+ initialData: filteredSandboxEntities(),
wrapNavigation: true,
});
createEffect(() => {
- soup.setData(sandboxEntities());
+ soup.setData(filteredSandboxEntities());
});
return (
<>
{/* Entity list visible behind the modal */}
- <MockAppChrome viewTitle="Documents">
+ <MockAppChrome>
<OnboardingEntityList soup={soup} />
</MockAppChrome>
<Dialog open={commandKOpen()} onOpenChange={setCommandKOpen}>
<Dialog.Portal>
<Dialog.Overlay class="z-modal fixed inset-0 bg-modal-overlay pattern-edge-muted pattern-diagonal-4" />
- <div class="z-modal fixed inset-0 flex items-start justify-center">
+ <div class="z-modal fixed inset-0 flex items-start justify-center pt-[15vh]">
<Dialog.Content
ref={contentEl}
class="max-w-[calc(100vw-16px)] overflow-hidden portal-scope"
- style={{
- width: '800px',
- 'margin-top':
- topOffset() !== undefined ? `${topOffset()}px` : '20vh',
- }}
+ style={{ width: '800px' }}
>
<ClippedPanel active cornerRadius="4px">
<div class="[&>*]:max-h-[75vh]" ref={setCommandMenuRef}>
<CommandMenuInner
commandMenuRef={commandMenuRef}
items={filteredItems}
+ onSelect={() => {
+ setCompleted(true);
+ props.onComplete();
+ }}
/>
</div>
</ClippedPanel>
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 808617b47c..582d1dd79b 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
@@ -21,9 +21,11 @@ import { MockAppChrome } from '../components/MockAppChrome';
import { HotkeyCallout } from '../components-lib';
import type { LessonContentProps, LessonDefinition } from '../types';
import {
- sandboxEntities,
+ filteredSandboxEntities,
addSandboxEntity,
createSandboxEntity,
+ sidebarFilter,
+ setSidebarFilter,
type SandboxEntityType,
} from '../sandbox/sandbox-store';
@@ -42,10 +44,9 @@ const BLOCK_TO_SANDBOX: Record<string, SandboxEntityType> = {
const [sharedSoup, setSharedSoup] = createSignal<SoupState | undefined>();
const [onCreated, setOnCreated] = createSignal<(() => void) | undefined>();
const [launcherOpen, setLauncherOpen] = createSignal(false);
+const [completed, setCompleted] = createSignal(false);
function CreateEntityContent(props: LessonContentProps) {
- const [completed, setCompleted] = createSignal(false);
-
setOnCreated(() => () => {
if (!completed()) {
setCompleted(true);
@@ -62,7 +63,7 @@ function CreateEntityContent(props: LessonContentProps) {
hotkey: 'c',
description: 'Open Create menu',
keyDownHandler: () => {
- setLauncherOpen(true);
+ setLauncherOpen((open) => !open);
return true;
},
}).withGroup(group);
@@ -81,6 +82,7 @@ function CreateEntityContent(props: LessonContentProps) {
group.dispose();
setLauncherOpen(false);
setOnCreated(undefined);
+ setCompleted(false);
});
return (
@@ -89,26 +91,36 @@ function CreateEntityContent(props: LessonContentProps) {
tabIndex={0}
class="flex flex-col gap-3 outline-none onboarding-stagger"
>
- <div class="bracket-never">
- <HotkeyCallout keys={['C']} label="to open the Create menu" />
- </div>
+ <p>
+ The <strong>Create Launcher</strong> lets you create Macro Editor
+ quickly, from anywhere. Press <strong>C</strong> to open the Launcher.
+ </p>
+ <HotkeyCallout
+ keys={['C']}
+ label="to open the Create menu"
+ completed={completed()}
+ />
</div>
);
}
function CreateEntityDemo(props: LessonContentProps) {
const soup = createSoupState({
- initialData: sandboxEntities(),
+ initialData: filteredSandboxEntities(),
wrapNavigation: true,
});
setSharedSoup(soup);
+ // Ensure we always start in the All Items view
+ const previousFilter = sidebarFilter();
+ setSidebarFilter(null);
+
useListNavigation(soup, props.scopeId);
// Keep soup synced with sandbox store
createEffect(() => {
- soup.setData(sandboxEntities());
+ soup.setData(filteredSandboxEntities());
});
// Build sandbox versions of all creatable blocks
@@ -128,11 +140,12 @@ function CreateEntityDemo(props: LessonContentProps) {
onCleanup(() => {
setSharedSoup(undefined);
+ setSidebarFilter(previousFilter);
});
return (
<div class="flex flex-col h-full relative">
- <MockAppChrome viewTitle="Documents">
+ <MockAppChrome>
<Show when={sharedSoup()}>
{(s) => <OnboardingEntityList soup={s()} />}
</Show>
diff --git a/js/app/packages/app/component/interactive-onboarding/lessons/email-invite.tsx b/js/app/packages/app/component/interactive-onboarding/lessons/email-invite.tsx
index cb88a6bd0b..343a1a42fa 100644
--- a/js/app/packages/app/component/interactive-onboarding/lessons/email-invite.tsx
+++ b/js/app/packages/app/component/interactive-onboarding/lessons/email-invite.tsx
@@ -1,68 +1,54 @@
-import { createSignal, For } from 'solid-js';
+import { createSignal, onCleanup, onMount } from 'solid-js';
import type { LessonContentProps, LessonDefinition } from '../types';
+import { MockAppChrome } from '../components/MockAppChrome';
+
+function EmailInviteContent(props: LessonContentProps) {
+ const [value, setValue] = createSignal('');
+ let textareaRef: HTMLTextAreaElement | undefined;
+
+ // setTimeout defers onComplete to a new macrotask, safely after the shell's
+ // handleContinue has finished calling setReadyToContinue(false). Then the
+ // double-rAF focuses the textarea after the shell's own rAF focuses the button.
+ onMount(() => {
+ setTimeout(() => {
+ props.onComplete('Send Invites');
+ requestAnimationFrame(() =>
+ requestAnimationFrame(() => textareaRef?.focus())
+ );
+ });
+ });
+
+ onCleanup(() => {
+ const emails = value().trim();
+ if (!emails) return;
+ // TODO: fire invite API here in next PR (fire-and-forget)
+ });
-function EmailInviteContent(_props: LessonContentProps) {
return (
<div class="flex flex-col gap-3 onboarding-stagger">
<p>
Macro is better with your team. Invite collaborators to your workspace
by email.
</p>
+ <div class="flex flex-col gap-2">
+ <textarea
+ ref={textareaRef}
+ value={value()}
+ onInput={(e) => setValue(e.currentTarget.value)}
+ rows={4}
+ class="w-full px-3 py-2 text-sm border border-edge-muted rounded-xs bg-panel text-ink placeholder:text-ink/30 outline-none focus:border-accent/50 resize-none leading-relaxed"
+ />
+ <p class="text-xs text-ink/40">
+ Separate addresses with a new line or comma.
+ </p>
+ </div>
</div>
);
}
-function EmailInviteDemo(props: LessonContentProps) {
- const [emails, setEmails] = createSignal(['']);
-
- const updateEmail = (index: number, value: string) => {
- setEmails((prev) => {
- const next = [...prev];
- next[index] = value;
- return next;
- });
- };
-
- const addField = () => {
- setEmails((prev) => [...prev, '']);
- };
-
- const handleSend = () => {
- props.onComplete();
- };
-
- return (
- <div class="h-full w-full flex items-center justify-center px-6">
- <div class="w-full max-w-sm flex flex-col gap-3">
- <p class="text-sm font-semibold text-ink/70">Invite teammates</p>
- <For each={emails()}>
- {(email, i) => (
- <input
- type="email"
- placeholder="[email protected]"
- value={email}
- onInput={(e) => updateEmail(i(), e.currentTarget.value)}
- class="w-full px-3 py-2 text-sm border border-edge-muted rounded-xs bg-panel text-ink placeholder:text-ink/30 outline-none focus:border-accent/50"
- />
- )}
- </For>
- <button
- type="button"
- class="self-start text-xs text-accent hover:text-accent/80"
- onClick={addField}
- >
- + Add another
- </button>
- <button
- type="button"
- class="w-full px-4 py-2 text-sm font-semibold bg-accent text-panel rounded-xs hover:bg-accent/90"
- onClick={handleSend}
- >
- Send Invites
- </button>
- </div>
- </div>
- );
+function EmailInviteDemo() {
+ return <MockAppChrome />;
}
export const emailInviteLesson: LessonDefinition = {
diff --git a/js/app/packages/app/component/interactive-onboarding/lessons/home.tsx b/js/app/packages/app/component/interactive-onboarding/lessons/home.tsx
index cb2712241f..f20d82581f 100644
--- a/js/app/packages/app/component/interactive-onboarding/lessons/home.tsx
+++ b/js/app/packages/app/component/interactive-onboarding/lessons/home.tsx
@@ -1,6 +1,6 @@
import { createSoupState } from '@app/component/next-soup/create-soup-state';
-import { sandboxEntities } from '../sandbox/sandbox-store';
-import { onMount } from 'solid-js';
+import { filteredSandboxEntities } from '../sandbox/sandbox-store';
+import { createEffect, onMount } from 'solid-js';
import { OnboardingEntityList } from '../OnboardingEntityList';
import { MockAppChrome } from '../components/MockAppChrome';
import type { LessonContentProps, LessonDefinition } from '../types';
@@ -11,22 +11,29 @@ function HomeContent(props: LessonContentProps) {
return (
<div class="flex flex-col gap-3 onboarding-stagger">
<p>
- The Macro workspace has a the left-hand <strong>Sidebar</strong>
- and <strong>Splits</strong> which can contain{' '}
+ The Macro workspace has a <strong>Sidebar</strong> and{' '}
+ <strong>Splits</strong>. Each split can contain{' '}
<strong>List Views</strong> or content.
</p>
+ <p class="text-sm text-ink/50">
+ Try clicking the sidebar icons on the right to filter the list.
+ </p>
</div>
);
}
function HomeDemo() {
const soup = createSoupState({
- initialData: sandboxEntities(),
+ initialData: filteredSandboxEntities(),
wrapNavigation: true,
});
+ createEffect(() => {
+ soup.setData(filteredSandboxEntities());
+ });
+
return (
- <MockAppChrome viewTitle="Documents">
+ <MockAppChrome>
<OnboardingEntityList soup={soup} />
</MockAppChrome>
);
diff --git a/js/app/packages/app/component/interactive-onboarding/lessons/index.ts b/js/app/packages/app/component/interactive-onboarding/lessons/index.ts
index 5bcd0d70ab..488070d9ee 100644
--- a/js/app/packages/app/component/interactive-onboarding/lessons/index.ts
+++ b/js/app/packages/app/component/interactive-onboarding/lessons/index.ts
@@ -1,22 +1,22 @@
import type { LessonDefinition } from '../types';
import { welcomeLesson } from './welcome';
-import { homeLesson } from './home';
+import { sidebarNavLesson } from './sidebar-nav';
import { navigateListLesson } from './navigate-list';
import { commandKLesson } from './command-k';
import { createEntityLesson } from './create-entity';
import { markdownMentionsLesson } from './markdown-mentions';
-import { composersPreviewLesson } from './composers-preview';
+// import { composersPreviewLesson } from './composers-preview';
import { emailInviteLesson } from './email-invite';
import { choosePlanLesson } from './choose-plan';
export const LESSONS: LessonDefinition[] = [
welcomeLesson,
- homeLesson,
+ sidebarNavLesson,
navigateListLesson,
commandKLesson,
createEntityLesson,
markdownMentionsLesson,
- composersPreviewLesson,
+ // composersPreviewLesson,
emailInviteLesson,
choosePlanLesson,
];
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 78c87d3258..d9c61a23bb 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
@@ -1,15 +1,23 @@
import { buildConfig } from '@core/component/LexicalMarkdown/builder/MarkdownConfigBuilder';
import { MarkdownShell } from '@core/component/LexicalMarkdown/builder/MarkdownShell';
import { sandboxToCommandItems, SANDBOX_USERS } from '../sandbox/sandbox-store';
-import { createSignal } from 'solid-js';
+import { createSignal, onCleanup } from 'solid-js';
+import { sidebarFilter, setSidebarFilter } from '../sandbox/sandbox-store';
import { HotkeyCallout } from '../components-lib';
import { MockAppChrome } from '../components/MockAppChrome';
import type { LessonContentProps, LessonDefinition } from '../types';
+/** Shared completion state between content and demo panels. */
+const [completed, setCompleted] = createSignal(false);
+
function MarkdownMentionsContent(_props: LessonContentProps) {
return (
<div class="flex flex-col gap-3 onboarding-stagger">
- <HotkeyCallout keys={['@']} label="to mention someone" />
+ <HotkeyCallout
+ keys={['@']}
+ label="to mention someone"
+ completed={completed()}
+ />
<p>
Macro's editor supports rich markdown, mentions, and emoji. Try typing
something or mentioning a teammate with <strong>@</strong>.
@@ -21,6 +29,14 @@ function MarkdownMentionsContent(_props: LessonContentProps) {
function MarkdownMentionsDemo(props: LessonContentProps) {
const [mentioned, setMentioned] = createSignal(false);
+ const previousFilter = sidebarFilter();
+ setSidebarFilter(null);
+
+ onCleanup(() => {
+ setCompleted(false);
+ setSidebarFilter(previousFilter);
+ });
+
const sandboxEntities = () =>
sandboxToCommandItems().map((item) => ({
...item,
@@ -36,6 +52,7 @@ function MarkdownMentionsDemo(props: LessonContentProps) {
onCreate: () => {
if (!mentioned()) {
setMentioned(true);
+ setCompleted(true);
props.onComplete();
}
},
@@ -45,7 +62,7 @@ function MarkdownMentionsDemo(props: LessonContentProps) {
.withSkipPreviewFetch();
return (
- <MockAppChrome viewTitle="Daily Note">
+ <MockAppChrome>
<div class="px-8 py-6">
<h1 class="text-3xl font-semibold text-ink mb-4">Daily Note</h1>
<MarkdownShell
diff --git a/js/app/packages/app/component/interactive-onboarding/lessons/navigate-list.tsx b/js/app/packages/app/component/interactive-onboarding/lessons/navigate-list.tsx
index ac64e7e9a0..ba23dca55c 100644
--- a/js/app/packages/app/component/interactive-onboarding/lessons/navigate-list.tsx
+++ b/js/app/packages/app/component/interactive-onboarding/lessons/navigate-list.tsx
@@ -1,62 +1,156 @@
import { createSoupState } from '@app/component/next-soup/create-soup-state';
import type { SoupState } from '@app/component/next-soup/create-soup-state';
-import { sandboxEntities } from '../sandbox/sandbox-store';
-import { createEffect, createSignal, onCleanup, Show } from 'solid-js';
+import {
+ filteredSandboxEntities,
+ removeSandboxEntity,
+ setSidebarFilter,
+ sidebarFilter,
+} from '../sandbox/sandbox-store';
+import {
+ createEffect,
+ createSignal,
+ onCleanup,
+ onMount,
+ Show,
+ untrack,
+} from 'solid-js';
import { OnboardingEntityList } from '../OnboardingEntityList';
import { HotkeyCallout } from '../components-lib';
import type { LessonContentProps, LessonDefinition } from '../types';
import { useListNavigation } from '../use-list-navigation';
import { MockAppChrome } from '../components/MockAppChrome';
-
-const REQUIRED_NAVIGATIONS = 3;
+import { createHotkeyGroup, registerHotkey } from '@core/hotkey/hotkeys';
const [sharedSoup, setSharedSoup] = createSignal<SoupState | undefined>();
+const [removingIds, setRemovingIds] = createSignal<Set<string>>(new Set());
+
+const REMOVE_ANIMATION_MS = 180;
function NavigateListContent(props: LessonContentProps) {
+ const previousFilter = sidebarFilter();
+ setSidebarFilter('mail');
+
const soup = createSoupState({
- initialData: sandboxEntities(),
+ initialData: filteredSandboxEntities(),
wrapNavigation: true,
});
setSharedSoup(soup);
- // Keep soup synced with sandbox store (entities created in earlier lesson)
createEffect(() => {
- soup.setData(sandboxEntities());
+ soup.setData(filteredSandboxEntities());
});
- let navCount = 0;
+ const [hasHitNext, setHasHitNext] = createSignal(false);
+ const [hasHitPrev, setHasHitPrev] = createSignal(false);
+ const [hasMarkedDone, setHasMarkedDone] = createSignal(false);
+
+ const hasNavigated = () => hasHitNext() && hasHitPrev();
- useListNavigation(soup, props.scopeId, () => {
- navCount++;
- if (navCount >= REQUIRED_NAVIGATIONS) {
- props.onComplete();
+ useListNavigation(soup, props.scopeId, (direction) => {
+ if (direction === 'down') setHasHitNext(true);
+ if (direction === 'up') setHasHitPrev(true);
+ });
+
+ // Auto-select the first item as soon as the list has data (handles the case
+ // where the filter starts as 'empty' and only populates after a sidebar click).
+ let focusInitialized = false;
+ createEffect(() => {
+ const data = soup.data();
+ if (!focusInitialized && data.length > 0) {
+ focusInitialized = true;
+ untrack(() => soup.navigate.toFirst());
}
});
+ const group = createHotkeyGroup();
+
+ onMount(() => {
+ registerHotkey({
+ scopeId: props.scopeId,
+ hotkey: 'e',
+ description: 'Mark done',
+ keyDownHandler: () => {
+ if (!hasNavigated()) return false;
+ const focused = soup.focus.item();
+ if (!focused) return false;
+ const currentIndex = soup.focus.index();
+ const data = soup.items.data();
+
+ // Select the next item by id *before* removing so focus never resets
+ const nextItem = data[currentIndex + 1] ?? data[currentIndex - 1];
+ if (nextItem) soup.focus.set(nextItem.id);
+
+ // Animate the row away, then remove from the store
+ setRemovingIds(new Set<string>([focused.id]));
+ setTimeout(() => {
+ removeSandboxEntity(focused.id);
+ setRemovingIds(new Set<string>());
+ }, REMOVE_ANIMATION_MS);
+
+ if (!hasMarkedDone()) {
+ setHasMarkedDone(true);
+ props.onComplete();
+ }
+ return true;
+ },
+ }).withGroup(group);
+ });
+
onCleanup(() => {
+ group.dispose();
setSharedSoup(undefined);
+ setRemovingIds(new Set<string>());
+ setSidebarFilter(previousFilter);
});
return (
- <div class="flex flex-col gap-3 onboarding-stagger">
- <HotkeyCallout
- keys={['J', '↓']}
- separator="or"
- label="Move to next item"
- />
- <HotkeyCallout keys={['K', '↑']} separator="or" label="Move back up" />
+ <div class="flex flex-col gap-4 onboarding-stagger">
+ <p>
+ Macro uses fast, familiar keys for navigating lists.{' '}
+ <strong class="text-ink/90 font-medium">J</strong> and{' '}
+ <strong class="text-ink/90 font-medium">K</strong> — or the arrow keys —
+ move you through items without reaching for the mouse.
+ </p>
+
+ <div class="flex flex-col gap-2">
+ <HotkeyCallout
+ keys={['J', '↓']}
+ separator="or"
+ label="Move to next item"
+ completed={hasHitNext()}
+ />
+ <HotkeyCallout
+ keys={['K', '↑']}
+ separator="or"
+ label="Move back up"
+ completed={hasHitPrev()}
+ />
+ </div>
+
+ <Show when={hasNavigated()}>
+ <p>
+ In certain views, you can mark items as done to indicate their
+ completeness — keeping your list focused on what still needs
+ attention.
+ </p>
+ <HotkeyCallout
+ keys={['E']}
+ label="Mark item done"
+ completed={hasMarkedDone()}
+ />
+ </Show>
</div>
);
}
function NavigateListDemo() {
return (
- <MockAppChrome viewTitle="Documents">
+ <MockAppChrome>
<Show when={sharedSoup()}>
{(soup) => (
<div class="h-full overflow-y-auto">
- <OnboardingEntityList soup={soup()} />
+ <OnboardingEntityList soup={soup()} removingIds={removingIds} />
</div>
)}
</Show>
@@ -66,7 +160,7 @@ function NavigateListDemo() {
export const navigateListLesson: LessonDefinition = {
id: 'navigate-list',
- title: 'The List',
+ title: 'The List View',
content: NavigateListContent,
demo: NavigateListDemo,
order: 20,
diff --git a/js/app/packages/app/component/interactive-onboarding/lessons/sidebar-nav.tsx b/js/app/packages/app/component/interactive-onboarding/lessons/sidebar-nav.tsx
new file mode 100644
index 0000000000..1cbd6853a4
--- /dev/null
+++ b/js/app/packages/app/component/interactive-onboarding/lessons/sidebar-nav.tsx
@@ -0,0 +1,64 @@
+import { createSoupState } from '@app/component/next-soup/create-soup-state';
+import {
+ filteredSandboxEntities,
+ sidebarFilter,
+} from '../sandbox/sandbox-store';
+import { createEffect, createSignal } from 'solid-js';
+import { OnboardingEntityList } from '../OnboardingEntityList';
+import { HotkeyCallout } from '../components-lib';
+import { MockAppChrome } from '../components/MockAppChrome';
+import type { LessonContentProps, LessonDefinition } from '../types';
+
+function SidebarNavContent(props: LessonContentProps) {
+ const [done, setDone] = createSignal(false);
+ createEffect(() => {
+ if (sidebarFilter() === 'mail') {
+ setDone(true);
+ props.onComplete();
+ }
+ });
+
+ return (
+ <div class="flex flex-col gap-3 onboarding-stagger">
+ <p>
+ Use the sidebar to quickly jump between views. Try navigating to{' '}
+ <strong>Emails</strong>.
+ </p>
+ <HotkeyCallout
+ keys={['G', 'E']}
+ separator="then"
+ label="Go to Emails"
+ completed={done()}
+ />
+ <p class="text-sm text-ink/50">
+ Or click the email icon in the sidebar on the right.
+ </p>
+ </div>
+ );
+}
+
+function SidebarNavDemo() {
+ const soup = createSoupState({
+ initialData: filteredSandboxEntities(),
+ wrapNavigation: true,
+ });
+
+ createEffect(() => {
+ soup.setData(filteredSandboxEntities());
+ });
+
+ return (
+ <MockAppChrome>
+ <OnboardingEntityList soup={soup} />
+ </MockAppChrome>
+ );
+}
+
+export const sidebarNavLesson: LessonDefinition = {
+ id: 'sidebar-nav',
+ title: 'Sidebar Navigation',
+ content: SidebarNavContent,
+ demo: SidebarNavDemo,
+ order: 5,
+ skippable: true,
+};
diff --git a/js/app/packages/app/component/interactive-onboarding/lessons/welcome.tsx b/js/app/packages/app/component/interactive-onboarding/lessons/welcome.tsx
index 07fec28d91..563ed5e39e 100644
--- a/js/app/packages/app/component/interactive-onboarding/lessons/welcome.tsx
+++ b/js/app/packages/app/component/interactive-onboarding/lessons/welcome.tsx
@@ -7,8 +7,9 @@ function WelcomeContent(props: LessonContentProps) {
return (
<div class="flex flex-col gap-3 onboarding-stagger">
<p>
- Macro is a powerful, keyboard-first workspace. Let's learn a few core
- features.
+ Macro is a unified system for work – built for <strong>speed</strong>{' '}
+ and <strong>focus</strong>. This short walk-through will introduce a few
+ core features.
</p>
</div>
);
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 676b27b2b3..f10e1ca438 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
@@ -2,28 +2,35 @@ import type { EntityData } from '@entity';
import type { IUser } from '@core/user/types';
import {
MOCK_DOCUMENT_BASIC,
- MOCK_EMAIL_UNREAD,
- MOCK_TASK_TODO,
- MOCK_CHANNEL_PUBLIC,
MOCK_PROJECT_1,
} from '../../../../entity/mocks/mockEntityData';
import { createSignal } from 'solid-js';
const now = new Date();
-function seedDoc(id: string, name: string, fileType = 'md'): EntityData {
+/** Returns a Date that is `minutesAgo` minutes before `now`. */
+function ago(minutesAgo: number): Date {
+ return new Date(now.getTime() - minutesAgo * 60_000);
+}
+
+function seedDoc(
+ id: string,
+ name: string,
+ updatedAt: Date,
+ fileType = 'md'
+): EntityData {
return {
type: 'document',
id,
name,
ownerId: 'sandbox',
fileType,
- createdAt: now,
- updatedAt: now,
+ createdAt: updatedAt,
+ updatedAt,
frecencyScore: 1,
};
}
-function seedTask(id: string, name: string): EntityData {
+function seedTask(id: string, name: string, updatedAt: Date): EntityData {
return {
type: 'document',
id,
@@ -31,8 +38,8 @@ function seedTask(id: string, name: string): EntityData {
ownerId: 'sandbox',
fileType: 'md',
subType: { type: 'task', is_completed: false },
- createdAt: now,
- updatedAt: now,
+ createdAt: updatedAt,
+ updatedAt,
frecencyScore: 1,
};
}
@@ -40,124 +47,230 @@ function seedEmail(
id: string,
name: string,
senderName: string,
- senderEmail: string
+ senderEmail: string,
+ snippet: string,
+ updatedAt: Date,
+ isRead = false
): EntityData {
return {
type: 'email',
id,
name,
ownerId: 'sandbox',
- isRead: false,
+ isRead,
isDraft: false,
isImportant: false,
done: false,
senderEmail,
senderName,
- snippet: '',
+ snippet,
participants: [],
- createdAt: now,
- updatedAt: now,
+ createdAt: updatedAt,
+ updatedAt,
frecencyScore: 1,
};
}
-function seedChannel(id: string, name: string): EntityData {
+function seedChannel(id: string, name: string, updatedAt: Date): EntityData {
return {
type: 'channel',
id,
name,
ownerId: 'sandbox',
- channelType: 'public',
- createdAt: now,
- updatedAt: now,
+ channelType: 'private',
+ createdAt: updatedAt,
+ updatedAt,
frecencyScore: 1,
};
}
-function seedProject(id: string, name: string): EntityData {
+function seedProject(id: string, name: string, updatedAt: Date): EntityData {
return {
type: 'project',
id,
name,
ownerId: 'sandbox',
- createdAt: now,
- updatedAt: now,
+ createdAt: updatedAt,
+ updatedAt,
frecencyScore: 1,
};
}
-function seedChat(id: string, name: string): EntityData {
+function seedChat(id: string, name: string, updatedAt: Date): EntityData {
return {
type: 'chat',
id,
name,
ownerId: 'sandbox',
- createdAt: now,
- updatedAt: now,
+ createdAt: updatedAt,
+ updatedAt,
+ frecencyScore: 1,
+ };
+}
+function seedDM(id: string, name: string, updatedAt: Date): EntityData {
+ return {
+ type: 'channel',
+ id,
+ name,
+ ownerId: 'sandbox',
+ channelType: 'direct_message',
+ createdAt: updatedAt,
+ updatedAt,
frecencyScore: 1,
};
}
+// Sorted by updatedAt descending so the "all" view is interleaved by type.
const SEED_ENTITIES: EntityData[] = [
- MOCK_PROJECT_1,
- seedDoc('seed_doc_1', 'Q3 Product Roadmap'),
- seedTask('seed_task_1', 'Review design mockups'),
+ seedChannel('seed_channel_1', 'engineering', ago(5)),
seedEmail(
'seed_email_1',
'Re: Launch checklist',
'Sarah Chen',
+ 'Just reviewed the checklist — a few items still need sign-off before we go live on Friday.',
+ ago(35)
),
- seedChannel('seed_channel_1', 'engineering'),
- seedDoc('seed_doc_2', 'Architecture Decision Record'),
- seedTask('seed_task_2', 'Write release notes'),
- seedProject('seed_project_2', 'Website Redesign'),
- seedChat('seed_chat_1', 'Brainstorm: onboarding flow'),
+ seedChat('seed_chat_1', 'Brainstorm: onboarding flow', ago(90)),
+ seedTask('seed_task_1', 'Review design mockups', ago(180)),
+ seedDM('seed_dm_1', 'Sarah Chen', ago(300)),
+ seedDoc('seed_doc_1', 'Q3 Product Roadmap', ago(480)),
seedEmail(
'seed_email_2',
'Budget approval needed',
'Marcus Lee',
+ 'The Q4 vendor contracts are ready. We need approval by EOD Thursday to avoid delays.',
+ ago(720)
),
- seedDoc('seed_doc_3', 'Meeting Notes — All Hands'),
- seedTask('seed_task_3', 'Set up CI pipeline'),
- seedChannel('seed_channel_2', 'design'),
- seedDoc('seed_doc_4', 'Customer Interview Summary', 'canvas'),
+ seedChannel('seed_channel_2', 'design', ago(960)),
+ seedChat('seed_chat_2', 'Draft: pricing page copy', ago(60 * 20)),
+ seedTask('seed_task_2', 'Write release notes', ago(60 * 26)),
+ MOCK_PROJECT_1,
+ seedDM('seed_dm_2', 'Marcus Lee', ago(60 * 30)),
+ seedDoc('seed_doc_2', 'Architecture Decision Record', ago(60 * 36)),
seedEmail(
'seed_email_3',
'Investor update Q3',
'Jordan Rivera',
+ 'Attaching the draft deck for your review. Key highlights: ARR up 34%, churn down to 2.1%.',
+ ago(60 * 44),
+ true
),
- seedTask('seed_task_4', 'Fix login page regression'),
- seedProject('seed_project_3', 'Mobile App v2'),
- seedDoc('seed_doc_5', 'API Reference', 'py'),
- seedChat('seed_chat_2', 'Draft: pricing page copy'),
- seedChannel('seed_channel_3', 'announcements'),
+ seedChannel('seed_channel_3', 'announcements', ago(60 * 52)),
+ seedTask('seed_task_3', 'Set up CI pipeline', ago(60 * 60)),
+ seedChat('seed_chat_3', 'Debug: auth token expiry', ago(60 * 72)),
+ seedDoc('seed_doc_3', 'Meeting Notes — All Hands', ago(60 * 84)),
+ seedDM('seed_dm_3', 'Jordan Rivera', ago(60 * 96)),
+ seedProject('seed_project_2', 'Website Redesign', ago(60 * 120)),
seedEmail(
'seed_email_4',
'Contract renewal — action required',
'Alex Kim',
+ 'Your annual subscription renews in 7 days. Please confirm billing details to avoid interruption.',
+ ago(60 * 144),
+ true
),
- seedTask('seed_task_5', 'Update dependencies'),
- seedDoc('seed_doc_6', 'Brand Guidelines'),
- seedTask('seed_task_6', 'Schedule user research sessions'),
+ seedTask('seed_task_4', 'Fix login page regression', ago(60 * 168)),
+ seedChannel('seed_channel_4', 'product', ago(60 * 200)),
+ seedChat('seed_chat_4', 'Summarize: customer feedback Q3', ago(60 * 240)),
+ seedDoc('seed_doc_4', 'Customer Interview Summary', ago(60 * 288), 'canvas'),
+ seedDM('seed_dm_4', 'Priya Patel', ago(60 * 336)),
MOCK_DOCUMENT_BASIC,
- MOCK_EMAIL_UNREAD,
- MOCK_TASK_TODO,
- MOCK_CHANNEL_PUBLIC,
+ seedEmail(
+ 'seed_email_5',
+ 'Design review feedback',
+ 'Emily Zhang',
+ 'Overall looking great! Left a few comments on the nav and the mobile breakpoints.',
+ ago(60 * 400),
+ true
+ ),
+ seedTask('seed_task_5', 'Update dependencies', ago(60 * 480)),
+ seedChannel('seed_channel_5', 'random', ago(60 * 560)),
+ seedChat('seed_chat_5', 'Code review: payments module', ago(60 * 650)),
+ seedDoc('seed_doc_5', 'API Reference', ago(60 * 750), 'py'),
+ seedDM('seed_dm_5', 'Alex Kim', ago(60 * 840)),
+ seedProject('seed_project_3', 'Mobile App v2', ago(60 * 960)),
+ seedTask('seed_task_6', 'Schedule user research sessions', ago(60 * 1100)),
+ seedTask('seed_task_7', 'Review Q1 Budget', ago(60 * 1200)),
+ seedDoc('seed_doc_6', 'Brand Guidelines', ago(60 * 1300)),
+ seedChat('seed_chat_6', 'Research: competitor analysis', ago(60 * 1500)),
+ seedEmail(
+ 'seed_email_6',
+ 'Q1 Planning Session',
+ 'Alice Johnson',
+ "Sending the agenda ahead of Thursday's session. Please come with your top 3 priorities.",
+ ago(60 * 1700),
+ true
+ ),
+ seedChannel('seed_channel_6', 'general', ago(60 * 1900)),
];
const [entities, setEntities] = createSignal<EntityData[]>([...SEED_ENTITIES]);
let entityCounter = 0;
+// -- Sidebar filter --
+
+export type SandboxSidebarFilter =
+ | 'agents'
+ | 'mail'
+ | 'documents'
+ | 'tasks'
+ | 'channels'
+ | 'folders'
+ | 'empty'
+ | null;
+
+const [sidebarFilter, setSidebarFilter] =
+ createSignal<SandboxSidebarFilter>('empty');
+
+export { sidebarFilter, setSidebarFilter };
+
+function matchesFilter(
+ entity: EntityData,
+ filter: SandboxSidebarFilter
+): boolean {
+ if (!filter) return true;
+ switch (filter) {
+ case 'empty':
+ return false;
+ case 'agents':
+ return entity.type === 'chat';
+ case 'mail':
+ return entity.type === 'email';
+ case 'documents':
+ return entity.type === 'document' && entity.subType?.type !== 'task';
+ case 'tasks':
+ return entity.type === 'document' && entity.subType?.type === 'task';
+ case 'channels':
+ return entity.type === 'channel';
+ case 'folders':
+ return entity.type === 'project';
+ default:
+ return true;
+ }
+}
+
export function sandboxEntities() {
return entities();
}
+export function filteredSandboxEntities() {
+ const filter = sidebarFilter();
+ if (!filter) return entities();
+ return entities().filter((e) => matchesFilter(e, filter));
+}
+
export function addSandboxEntity(entity: EntityData) {
setEntities((prev) => [entity, ...prev]);
}
+export function removeSandboxEntity(id: string) {
+ setEntities((prev) => prev.filter((e) => e.id !== id));
+}
+
export type SandboxEntityType =
| 'md'
| 'email'
@@ -219,7 +332,7 @@ export function createSandboxEntity(type: SandboxEntityType): EntityData {
participants: [],
};
case 'channel':
- return { ...base, type: 'channel', channelType: 'public' };
+ return { ...base, type: 'channel', channelType: 'private' };
case 'chat':
return { ...base, type: 'chat' };
case 'project':
@@ -230,6 +343,7 @@ export function createSandboxEntity(type: SandboxEntityType): EntityData {
export function resetSandbox() {
entityCounter = 0;
setEntities([...SEED_ENTITIES]);
+ setSidebarFilter('empty');
}
// -- Command menu helpers --
@@ -251,7 +365,7 @@ function entityToBucket(entity: EntityData): EntityBucketType {
case 'email':
return 'email';
case 'channel':
- return 'channel';
+ return entity.channelType === 'direct_message' ? 'dm' : 'channel';
case 'chat':
return 'chat';
case 'project':
diff --git a/js/app/packages/app/component/interactive-onboarding/types.ts b/js/app/packages/app/component/interactive-onboarding/types.ts
index d076969a98..bdf7174584 100644
--- a/js/app/packages/app/component/interactive-onboarding/types.ts
+++ b/js/app/packages/app/component/interactive-onboarding/types.ts
@@ -12,6 +12,8 @@ export interface LessonDefinition {
order?: number;
/** Whether the user can skip this lesson. Defaults to false. */
skippable?: boolean;
+ /** Hide the continue/skip buttons entirely — the lesson drives its own advancement. */
+ hideContinue?: boolean;
}
export interface LessonContentProps {
diff --git a/js/app/packages/entity/mocks/mockEntityData.ts b/js/app/packages/entity/mocks/mockEntityData.ts
index d576ac81ac..5a607808ac 100644
--- a/js/app/packages/entity/mocks/mockEntityData.ts
+++ b/js/app/packages/entity/mocks/mockEntityData.ts
@@ -267,7 +267,7 @@ export const MOCK_CHANNEL_PUBLIC: ChannelEntity = {
id: 'channel_public_1',
name: 'general',
ownerId: MOCK_USER_IDS.owner,
- channelType: 'public',
+ channelType: 'private',
createdAt: MOCK_TIMESTAMPS.lastYear,
updatedAt: MOCK_TIMESTAMPS.today,
interactedAt: MOCK_TIMESTAMPS.today,