Skip to content

improvement(editor): replace mode toggle buttons with a switch - #7825

Merged
j15z merged 8 commits into
improvement/editor-deploy-experiencefrom
fix/compact-mode-switches-editor-deploy
Sep 15, 2026
Merged

j15z merged 8 commits into
improvement/editor-deploy-experiencefrom
fix/compact-mode-switches-editor-deploy

Conversation

@j15z

@j15z j15z commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replaces the ⇄ toggle button with a two-option switch wherever an input can flip between two modes. The old button only hinted at the current mode through its tint. The switch shows both modes side by side with the active one selected, so it's clear which mode a field is in and the other mode is one click away.

The switch is a new emcn component, IconSwitch: two 16px icon squares in a small frame, built on native radio buttons so arrow keys move between options, with each option's name shown as a tooltip.

Where it changed:

  • Selector-or-ID fields on blocks and on Agent block tools, such as Slack's Channel or the Jira tool's Project: Selector / Variable. The field header renders it through a shared CanonicalModeToggle.
  • Start block Files inputs: File uploader / JSON. The switch still hides when the uploader can't represent the current value.
  • Variables block boolean values: Selector / Variable
  • Knowledge base connector fields, such as Gmail's Labels: Selector / Manual input. The switch sits in a new ChipModalField titleAdornment slot outside the <label>, so clicking the field title doesn't change the mode, and it is disabled while the connector is being saved.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: UI improvement

Testing

  • apps/sim and packages/emcn type checks pass.
  • 56 tests pass across 6 files covering IconSwitch, ChipModal, the connector config fields, the field header, subblocks, and Start file inputs.
  • New tests cover switching connector modes while keeping each mode's stored values, clicking the field title without changing the mode, and disabled switches during submission. The field header test now selects the Variable option instead of looking for the old button.
  • Biome passes on all changed files.
  • The screenshots below come from the running app. Before is improvement/editor-deploy-experience (087a21d); after is this branch (09cc11a).

Reviewers: please check the switch's alignment in the block field header, where it shares the row with Copy, Generate and link actions.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

Selector-or-ID fields on blocks (Slack Channel)

Before After
Slack Channel field with the arrow toggle button Slack Channel field with the Selector and Variable switch

Agent block tool fields (Jira Account and Project)

Before After
Jira tool fields inside the Agent block with arrow toggle buttons Jira tool fields inside the Agent block with Selector and Variable switches

Start block Files input

Before After
Start block Files input with the arrow toggle button Start block Files input with the File uploader and JSON switch

Variables block boolean value

Before After
Variables block boolean value with the arrow toggle button Variables block boolean value with the Selector and Variable switch

Knowledge base connector field (Gmail Labels)

Before After
Gmail connector Labels field with the arrow toggle button Gmail connector Labels field with the Selector and Manual input switch

🤖 Generated with Claude Code

Restore the two-choice icon switch with smaller geometry and consistent label-row spacing. Use it for canonical subblocks, Start file inputs, boolean assignments, and knowledge connector fields.

Keep connector radio controls outside field labels and preserve disabled and selected-state behavior.
@vercel

vercel Bot commented Sep 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 15, 2026 3:12am UTC

Request Review

@j15z j15z changed the title fix(editor): bring compact mode switches to the editor redesign improvement(editor): replace mode toggle buttons with a switch Sep 14, 2026
The old toggle buttons set the title row height (20px in the editor,
18px in the connector modal). The switch only occupies 14px, so Value
rows in the Start block Files input and Variables block, and connector
titles with a mode switch, collapsed to the label height. Give those
rows the same minimum height the field header already uses.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@j15z
j15z marked this pull request as ready for review September 15, 2026 02:59
@greptile-apps

greptile-apps Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with the prior connector focus issue fixed and no actionable new findings.

Summary

Replaces two-mode toggle buttons with a shared, radio-based IconSwitch across editor and connector fields.

  • Shows both modes with labeled tooltips and disabled-state support.
  • Adds a separate titleAdornment slot to ChipModalField.
  • The latest revision preserves connector headers and switches under canonical-group keys while retaining field-specific control keys.
  • Adds regression coverage for radio identity and focus retention through a mode round trip.

Reviews (2) · Last reviewed commit: "fix(knowledge): keep connector mode swit..."

@j15z

j15z commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

@j15z

j15z commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@j15z I have started the AI code review. It will take a few minutes to complete.

@j15z
j15z merged commit 8dd1785 into improvement/editor-deploy-experience Sep 15, 2026
5 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/compact-mode-switches-editor-deploy branch September 15, 2026 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant