Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

💄 style(worktree): use a sideways Split icon for the New worktree toggle (#23251)

Bryanfe9cc4318d69
diff --git a/src/features/ChatInput/ControlBar/DraftGit/WorktreeToggle.tsx b/src/features/ChatInput/ControlBar/DraftGit/WorktreeToggle.tsx
index a150b7562d6..c446b8aa8f3 100644
--- a/src/features/ChatInput/ControlBar/DraftGit/WorktreeToggle.tsx
+++ b/src/features/ChatInput/ControlBar/DraftGit/WorktreeToggle.tsx
@@ -3,19 +3,24 @@
import { Icon, Tooltip } from '@lobehub/ui';
import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';
import * as stylex from '@stylexjs/stylex';
-import { FolderGit2Icon } from 'lucide-react';
+import { SplitIcon } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { useWorktreeMode } from './useWorktreeMode';
const styles = stylex.create({
+ // Lucide's Split stands upright (trunk below, branching up); turned a quarter
+ // clockwise the trunk comes in from the left and forks to the right.
+ icon: { transform: 'rotate(90deg)' },
off: {
color: { 'default': cssVar.colorTextTertiary, ':hover': cssVar.colorText },
backgroundColor: { 'default': null, ':hover': cssVar.colorFillTertiary },
},
+ // Info blue, like the composer's other "on" switches (Memory, the SDK runtime
+ // chip): the neutral primary barely differs from the off state at this size.
on: {
- color: cssVar.colorPrimary,
- backgroundColor: { 'default': cssVar.colorPrimaryBg, ':hover': cssVar.colorPrimaryBgHover },
+ color: cssVar.colorInfo,
+ backgroundColor: { 'default': cssVar.colorInfoBg, ':hover': cssVar.colorInfoBgHover },
},
pending: { cursor: 'progress', opacity: 0.5 },
toggle: {
@@ -42,10 +47,14 @@ interface WorktreeToggleProps {
}
/**
- * The new-topic composer's "New worktree" switch. A git-folder icon, not a
- * fork: the fork reads as a branch, and this creates a working directory. On, the first send cuts a
+ * The new-topic composer's "New worktree" switch. On, the first send cuts a
* new `lobehub/…` branch from the picked branch into its own worktree and runs
* the topic there, leaving this directory untouched. Remembered per directory.
+ *
+ * The icon is a sideways Split: one line in from the left, forking into two
+ * paths to the right — "branch off a separate line of work from here". Not
+ * `GitFork`: the worktree switcher and `StaleGitSnapshot` already use it to say
+ * "you are inside a linked worktree", a state rather than this action.
*/
export const WorktreeToggle = ({ baseBranch, keyDeviceId, path }: WorktreeToggleProps) => {
const { t } = useTranslation('device');
@@ -79,7 +88,7 @@ export const WorktreeToggle = ({ baseBranch, keyDeviceId, path }: WorktreeToggle
void setEnabled(!enabled);
}}
>
- <Icon icon={FolderGit2Icon} size={13} />
+ <Icon icon={SplitIcon} size={14} {...stylex.props(styles.icon)} />
</div>
</Tooltip>
);