Skip to content

Commit b385131

Browse files
authored
revert(editor): restore the canonical arrow toggle (#7550)
Revert a0f38db because the new icon switch is not ready to ship. Keep the restoration and remaining mode-toggle migrations in a separate follow-up.
1 parent a0f38db commit b385131

6 files changed

Lines changed: 39 additions & 246 deletions

File tree

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/canonical-mode-toggle.tsx

Lines changed: 0 additions & 28 deletions
This file was deleted.

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
export { CanonicalModeToggle } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/canonical-mode-toggle'
21
export { CheckboxList } from './checkbox-list'
32
export { Code } from './code'
43
export { ComboBox } from './combobox'

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/sub-block.tsx

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
import { type JSX, type MouseEvent, memo, useCallback, useMemo, useRef, useState } from 'react'
22
import { Button, cn, Input, Label, Tooltip } from '@sim/emcn'
3-
import { ArrowUp, Check, Clipboard, SquareArrowUpRight, TriangleAlert } from '@sim/emcn/icons'
3+
import {
4+
ArrowLeftRight,
5+
ArrowUp,
6+
Check,
7+
Clipboard,
8+
SquareArrowUpRight,
9+
TriangleAlert,
10+
} from '@sim/emcn/icons'
411
import { isEqual } from 'es-toolkit'
512
import { useParams } from 'next/navigation'
613
import type { FilterRule, SortRule } from '@/lib/table/query-builder/constants'
714
import {
8-
CanonicalModeToggle,
915
CheckboxList,
1016
Code,
1117
ComboBox,
@@ -368,11 +374,37 @@ const renderLabel = (
368374
</Tooltip.Root>
369375
)}
370376
{showCanonicalToggle && (
371-
<CanonicalModeToggle
372-
mode={canonicalToggle?.mode ?? 'basic'}
373-
onToggle={canonicalToggle?.onToggle}
374-
disabled={canonicalToggleDisabledResolved}
375-
/>
377+
<Tooltip.Root>
378+
<Tooltip.Trigger asChild>
379+
<button
380+
type='button'
381+
className='flex size-[12px] shrink-0 items-center justify-center bg-transparent p-0 disabled:cursor-not-allowed disabled:opacity-50'
382+
onClick={canonicalToggle?.onToggle}
383+
disabled={canonicalToggleDisabledResolved}
384+
aria-label={
385+
canonicalToggle?.mode === 'advanced'
386+
? 'Switch to selector'
387+
: 'Switch to manual ID'
388+
}
389+
>
390+
<ArrowLeftRight
391+
className={cn(
392+
'h-[12px]! w-[12px]!',
393+
canonicalToggle?.mode === 'advanced'
394+
? 'text-[var(--text-primary)]'
395+
: 'text-[var(--text-secondary)]'
396+
)}
397+
/>
398+
</button>
399+
</Tooltip.Trigger>
400+
<Tooltip.Content side='top'>
401+
<p>
402+
{canonicalToggle?.mode === 'advanced'
403+
? 'Switch to selector'
404+
: 'Switch to manual ID'}
405+
</p>
406+
</Tooltip.Content>
407+
</Tooltip.Root>
376408
)}
377409
</div>
378410
</div>

packages/emcn/src/components/icon-switch/icon-switch.test.tsx

Lines changed: 0 additions & 112 deletions
This file was deleted.

packages/emcn/src/components/icon-switch/icon-switch.tsx

Lines changed: 0 additions & 97 deletions
This file was deleted.

packages/emcn/src/components/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ export {
132132
} from './dropdown-menu/dropdown-menu'
133133
export { Expandable, ExpandableContent } from './expandable/expandable'
134134
export { DashedDividerLine, FieldDivider } from './field-divider/field-divider'
135-
export { IconSwitch, type IconSwitchOption, type IconSwitchProps } from './icon-switch/icon-switch'
136135
export { Info } from './info/info'
137136
export {
138137
InfoCard,

0 commit comments

Comments
 (0)