Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b537f9f
chore(workflow-renderer): declare @sim/emcn dep + wire the package in…
waleedlatif1 Jun 29, 2026
0ba9203
feat(docs): render loop/parallel containers with the shared SubflowNo…
waleedlatif1 Jun 29, 2026
76b44bf
feat(docs): render block nodes with the shared WorkflowBlockView
waleedlatif1 Jun 29, 2026
8a133ce
refactor(workflow-renderer): make editor-only WorkflowBlockView props…
waleedlatif1 Jun 29, 2026
0c0957d
feat(docs): replace how-it-runs static diagrams with live WorkflowPre…
waleedlatif1 Jun 29, 2026
975a675
refactor(workflow-renderer): the view owns condition/router/error rows
waleedlatif1 Jun 29, 2026
0b03846
refactor(docs): drop the parallel --wp-* token layer for the app/emcn…
waleedlatif1 Jun 29, 2026
186903e
refactor(docs): adopt emcn Badge + dedup resolveIcon in workflow-preview
waleedlatif1 Jun 29, 2026
85b2ed0
refactor(docs): rebuild the preview inspector on emcn chip primitives
waleedlatif1 Jun 30, 2026
7fef831
refactor(docs): render the block-reference hero through the shared View
waleedlatif1 Jun 30, 2026
4d2581a
fix(docs): define sim's type scale + align the preview inspector to t…
waleedlatif1 Jun 30, 2026
f8d98bc
fix(docs): inspector shows the full field list + dragged positions pe…
waleedlatif1 Jun 30, 2026
9bebf7e
feat(docs): highlight <> references + env vars; hide Ask AI over the …
waleedlatif1 Jun 30, 2026
a301a94
fix(docs): make per-type field templates match the real block registry
waleedlatif1 Jun 30, 2026
24facdd
improvement(docs): taller default preview height so respaced diagrams…
waleedlatif1 Jun 30, 2026
184cf41
improvement(docs): zoomable inline preview + taller default + themed …
waleedlatif1 Jun 30, 2026
25522d2
improvement(docs): click canvas to expand; click empty lightbox to de…
waleedlatif1 Jun 30, 2026
a3c089e
improvement(docs): reveal inline zoom controls on hover only
waleedlatif1 Jun 30, 2026
1eaa3f5
improvement(docs): drop zoom controls on the inline preview
waleedlatif1 Jun 30, 2026
c794714
improvement(docs): remove zoom controls from the lightbox too
waleedlatif1 Jun 30, 2026
dc688b0
improvement(docs): match the real canvas — flat background + editor e…
waleedlatif1 Jun 30, 2026
b83b0fb
improvement(docs): rebrand the docs assistant as 'Ask Sim', styled li…
waleedlatif1 Jun 30, 2026
7765416
improvement(docs): match Ask Sim message styling to the mothership chat
waleedlatif1 Jun 30, 2026
231447c
improvement(docs): compact single-row Ask Sim composer
waleedlatif1 Jun 30, 2026
0d756da
fix(docs): pass the router Context value to the shared view
waleedlatif1 Jun 30, 2026
d9d1bfe
fix(docs): don't apply a block-type field template that doesn't match…
waleedlatif1 Jun 30, 2026
2556fe7
fix(docs): connect preview edges to subflow container handles
waleedlatif1 Jun 30, 2026
59642d1
fix(docs): don't expand the inspector template for blocks with no rows
waleedlatif1 Jun 30, 2026
1090907
fix(docs): render blank branch/router-context values as '-' like the …
waleedlatif1 Jun 30, 2026
cc14b09
fix(docs): show '-' for blank inspector branch values, matching the c…
waleedlatif1 Jun 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 19 additions & 50 deletions apps/docs/app/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@import "fumadocs-ui/css/preset.css";
@import "fumadocs-openapi/css/preset.css";
@source "../../../packages/emcn/src";
@source "../../../packages/workflow-renderer/src";

/* Prevent overscroll bounce effect on the page */
html,
Expand All @@ -19,6 +20,20 @@ body {

@theme {
--color-fd-primary: var(--color-fd-foreground);
/* Sim's custom type scale — emcn components (Label, Badge, the shared block
views) use these names, so they must resolve here or text falls back to the
inherited size. Mirrors apps/sim/tailwind.config.ts. */
--text-micro: 10px;
--text-xs: 11px;
--text-caption: 12px;
--text-small: 13px;
--text-base: 15px;
--text-md: 16px;
}

/* Hide the floating Ask Sim widget while a workflow-preview lightbox is open. */
body.wp-lightbox-open [aria-label="Ask Sim"] {
display: none;
}

/* Pure white light mode background */
Expand All @@ -42,6 +57,7 @@ body {
*/
:root {
--bg: #fefefe;
--workflow-edge: #e0e0e0;
--surface-1: #fbfbfb;
--surface-2: #ffffff;
--surface-3: #f7f7f7;
Expand All @@ -51,6 +67,7 @@ body {
--surface-active: #ececec;
--border: #dedede;
--border-1: #e0e0e0;
--divider: #ededed;
--text-primary: #1a1a1a;
--text-secondary: #525252;
--text-tertiary: #5c5c5c;
Expand Down Expand Up @@ -91,6 +108,7 @@ body {

.dark {
--bg: #1b1b1b;
--workflow-edge: #454545;
--surface-1: #1e1e1e;
--surface-2: #232323;
--surface-3: #242424;
Expand All @@ -100,6 +118,7 @@ body {
--surface-active: #2c2c2c;
--border: #333333;
--border-1: #3d3d3d;
--divider: #393939;
--text-primary: #e6e6e6;
--text-secondary: #cccccc;
--text-tertiary: #b3b3b3;
Expand Down Expand Up @@ -1661,56 +1680,6 @@ main article blockquote {
box-shadow: none !important;
}

/* Workflow-preview theme scope. Values mirror the app's tokens in
apps/sim/app/_styles/globals.css (light from :root/.light, dark from .dark)
so the docs previews match the OG repository in both modes. */
.wp-scope {
/* surfaces */
--wp-canvas: var(--bg);
--wp-panel: var(--surface-1);
--wp-surface: var(--surface-2);
--wp-header: var(--surface-3);
--wp-btn: var(--surface-4);
--wp-control: var(--surface-5);
--wp-active: var(--surface-active);
--wp-container-fill: rgba(0, 0, 0, 0.02);

/* borders */
--wp-border: var(--border);
--wp-border-1: var(--border-1);
--wp-chip-bg: var(--surface-5); /* ChipTag surface (light) */
--wp-chip-text: var(--text-body);
--wp-divider: #ededed; /* --divider */
--wp-edge: #e0e0e0; /* --workflow-edge */
--wp-highlight: #33b4ff; /* traced edge / highlighted output node */

/* text */
--wp-text: var(--text-primary);
--wp-text-2: var(--text-secondary);
--wp-text-3: var(--text-tertiary);
--wp-text-muted: var(--text-muted);
--wp-text-subtle: var(--text-subtle);

/* type badges (output inspector) */
--wp-badge-success-bg: var(--badge-success-bg);
--wp-badge-success-text: var(--badge-success-text);
--wp-badge-blue-bg: var(--badge-blue-bg);
--wp-badge-blue-text: var(--badge-blue-text);
--wp-badge-orange-bg: var(--badge-orange-bg);
--wp-badge-orange-text: var(--badge-orange-text);
--wp-badge-purple-bg: var(--badge-purple-bg);
--wp-badge-purple-text: var(--badge-purple-text);
--wp-badge-gray-bg: var(--badge-gray-bg);
--wp-badge-gray-text: var(--badge-gray-text);
}

.dark .wp-scope {
--wp-container-fill: rgba(255, 255, 255, 0.02);
--wp-chip-bg: var(--surface-4); /* ChipTag surface (dark) */
--wp-divider: #393939;
--wp-edge: #454545;
}

/* Tailwind v4 content sources */
@source '../app/**/*.{js,ts,jsx,tsx,mdx}';
@source '../components/**/*.{js,ts,jsx,tsx,mdx}';
Expand Down
99 changes: 56 additions & 43 deletions apps/docs/components/ai/ask-ai.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ export function AskAI({ locale }: AskAIProps) {
{!open && (
<button
type='button'
aria-label='Ask AI'
aria-label='Ask Sim'
onClick={() => setOpen(true)}
className='fixed right-4 bottom-4 z-50 flex h-11 items-center gap-1.5 rounded-full border border-[var(--border-1)] bg-[var(--surface-5)] px-4 font-season text-[var(--text-body)] text-sm shadow-[var(--shadow-medium)] transition-colors hover:bg-[var(--surface-active)] dark:bg-[var(--surface-4)]'
>
<MessageCircle className='size-[16px] text-[var(--text-icon)]' />
Ask AI
Ask Sim
</button>
)}

Expand All @@ -96,7 +96,7 @@ export function AskAI({ locale }: AskAIProps) {
<div className='flex items-center justify-between border-[var(--border-1)] border-b px-4 py-3'>
<span className='flex items-center gap-1.5 font-season text-[var(--text-body)] text-sm'>
<MessageCircle className='size-[16px] text-[var(--text-icon)]' />
Ask AI
Ask Sim
</span>
<button
type='button'
Expand Down Expand Up @@ -127,18 +127,27 @@ export function AskAI({ locale }: AskAIProps) {
<div
key={message.id}
className={cn(
'flex flex-col gap-1',
'flex flex-col gap-1.5',
message.role === 'user' ? 'items-end' : 'items-start'
)}
>
{message.role === 'user' ? (
<div className='max-w-[90%] whitespace-pre-wrap rounded-lg bg-[var(--surface-active)] px-3 py-2 text-[var(--text-body)] text-sm'>
<div className='max-w-[85%] whitespace-pre-wrap rounded-[16px] bg-[var(--surface-5)] px-3 py-2 text-[var(--text-primary)] text-base leading-[23px]'>
{text}
</div>
) : (
<div className='max-w-[90%] text-[var(--text-body)] text-sm'>
<div className='max-w-full text-[var(--text-primary)] text-base'>
{text ? (
<Streamdown className='space-y-2 text-sm leading-relaxed [&_a]:text-[var(--brand-accent)] [&_a]:underline [&_li]:my-0.5 [&_ol]:list-decimal [&_ol]:pl-5 [&_ul]:list-disc [&_ul]:pl-5'>
<Streamdown
className={cn(
'space-y-3 text-[var(--text-primary)] text-base leading-relaxed',
'[&_a]:text-[var(--text-primary)] [&_a]:underline [&_a]:decoration-dashed [&_a]:underline-offset-4',
'[&_strong]:font-[600]',
'[&_h1]:font-[600] [&_h2]:font-[600] [&_h3]:font-[600] [&_h4]:font-[600]',
'[&_li]:my-1 [&_ol]:my-3 [&_ol]:list-decimal [&_ol]:pl-5 [&_ul]:my-3 [&_ul]:list-disc [&_ul]:pl-5',
'[&_code]:font-mono [&_pre]:my-3 [&_pre]:overflow-x-auto [&_pre]:rounded-lg [&_pre]:bg-[var(--surface-5)] [&_pre]:p-3 [&_pre]:text-small'
)}
>
{text}
</Streamdown>
) : isStreaming ? (
Expand Down Expand Up @@ -174,42 +183,46 @@ export function AskAI({ locale }: AskAIProps) {
)}
</div>

<form
onSubmit={handleSubmit}
className='flex items-end gap-2 border-[var(--border-1)] border-t px-3 py-3'
>
<textarea
value={input}
onChange={(event) => setInput(event.target.value)}
onKeyDown={(event) => {
if (event.key === 'Enter' && !event.shiftKey) {
event.preventDefault()
handleSubmit(event)
}
}}
rows={1}
placeholder='Ask a question…'
className='max-h-32 flex-1 resize-none bg-transparent font-season text-[var(--text-body)] text-sm outline-none placeholder:text-[var(--text-muted)]'
/>
{isBusy ? (
<button
type='button'
aria-label='Stop'
onClick={() => stop()}
className='flex size-8 shrink-0 items-center justify-center rounded-lg bg-[var(--surface-active)] text-[var(--text-icon)]'
>
<Square className='size-[16px]' />
</button>
) : (
<button
type='submit'
aria-label='Send'
disabled={!input.trim()}
className='flex size-8 shrink-0 items-center justify-center rounded-lg bg-[var(--text-primary)] text-[var(--text-inverse)] transition-opacity disabled:opacity-40 dark:bg-white dark:text-[var(--bg)]'
>
<ArrowUp className='size-[16px]' />
</button>
)}
<form onSubmit={handleSubmit} className='px-3 pb-3'>
<div className='flex items-end gap-2 rounded-2xl border border-[var(--border-1)] bg-white px-2.5 py-1.5 dark:bg-[var(--surface-5)]'>
<textarea
value={input}
onChange={(event) => setInput(event.target.value)}
onKeyDown={(event) => {
if (event.key === 'Enter' && !event.shiftKey) {
event.preventDefault()
handleSubmit(event)
}
}}
rows={1}
placeholder='Ask Sim about the docs…'
className='max-h-32 flex-1 resize-none bg-transparent py-1 font-season text-[var(--text-body)] text-sm outline-none placeholder:text-[var(--text-muted)]'
/>
{isBusy ? (
<button
type='button'
aria-label='Stop'
onClick={() => stop()}
className='flex size-[28px] shrink-0 items-center justify-center rounded-full bg-[#383838] transition-colors hover:bg-[#575757] dark:bg-[#e0e0e0] dark:hover:bg-[#cfcfcf]'
>
<Square className='size-[12px] fill-white text-white dark:fill-black dark:text-black' />
</button>
) : (
<button
type='submit'
aria-label='Send'
disabled={!input.trim()}
className={cn(
'flex size-[28px] shrink-0 items-center justify-center rounded-full transition-colors',
input.trim()
? 'bg-[#383838] hover:bg-[#575757] dark:bg-[#e0e0e0] dark:hover:bg-[#cfcfcf]'
: 'bg-[#808080]'
)}
>
<ArrowUp className='size-[16px] text-white dark:text-black' />
</button>
)}
</div>
</form>
</div>
)}
Expand Down
Loading
Loading