fix(ui): align context surface icons
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
{
|
||||
"$schema": "https://unpkg.com/knip@latest/schema.json",
|
||||
"ignore": [
|
||||
"packages/mobile/android/app/src/main/assets/public/**",
|
||||
"packages/mobile/ios/App/App/public/**"
|
||||
],
|
||||
"workspaces": {
|
||||
".": {
|
||||
"entry": [
|
||||
"postcss.config.js",
|
||||
"scripts/**/*.{js,cjs,mjs,ts}"
|
||||
],
|
||||
"project": [
|
||||
@@ -12,6 +17,8 @@
|
||||
},
|
||||
"packages/ui": {
|
||||
"entry": [
|
||||
"src/apps/renderVSCodeApp.tsx",
|
||||
"src/**/*.bench.{ts,tsx}",
|
||||
"src/**/*.{test,spec}.{js,cjs,mjs,jsx,ts,tsx}",
|
||||
"src/**/__tests__/**/*.{js,cjs,mjs,jsx,ts,tsx}"
|
||||
],
|
||||
@@ -23,7 +30,9 @@
|
||||
"entry": [
|
||||
"src/mobile-main.tsx",
|
||||
"src/mini-chat-main.tsx",
|
||||
"src/main.tsx",
|
||||
"src/sw.ts",
|
||||
"bin/**/*.{test,spec}.{js,cjs,mjs}",
|
||||
"server/**/*.{test,spec}.{js,cjs,mjs}",
|
||||
"src/**/*.{test,spec}.{ts,tsx}"
|
||||
],
|
||||
@@ -50,6 +59,7 @@
|
||||
},
|
||||
"packages/vscode": {
|
||||
"entry": [
|
||||
"webview/main.tsx",
|
||||
"src/**/*.{test,spec}.{js,cjs,mjs,ts,tsx}",
|
||||
"webview/**/*.{test,spec}.{js,cjs,mjs,ts,tsx}"
|
||||
],
|
||||
@@ -57,6 +67,15 @@
|
||||
"src/**/*.{ts,tsx}",
|
||||
"webview/**/*.{ts,tsx}"
|
||||
]
|
||||
},
|
||||
"packages/mobile": {
|
||||
"entry": [
|
||||
"scripts/**/*.{js,cjs,mjs,ts}"
|
||||
],
|
||||
"project": [
|
||||
"*.{js,cjs,mjs,ts}",
|
||||
"scripts/**/*.{js,cjs,mjs,ts}"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ export const iconSpriteData = {
|
||||
"book": `<path d="M3 18.5V5C3 3.34315 4.34315 2 6 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22H6.5C4.567 22 3 20.433 3 18.5ZM19 20V17H6.5C5.67157 17 5 17.6716 5 18.5C5 19.3284 5.67157 20 6.5 20H19ZM5 15.3368C5.45463 15.1208 5.9632 15 6.5 15H19V4H6C5.44772 4 5 4.44772 5 5V15.3368Z" fill="currentColor"/>`,
|
||||
"book-open": `<path d="M13 21V23H11V21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H9C10.1947 3 11.2671 3.52375 12 4.35418C12.7329 3.52375 13.8053 3 15 3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H13ZM20 19V5H15C13.8954 5 13 5.89543 13 7V19H20ZM11 19V7C11 5.89543 10.1046 5 9 5H4V19H11Z" fill="currentColor"/>`,
|
||||
"booklet": `<path d="M20.0049 2C21.1068 2 22 2.89821 22 3.9908V20.0092C22 21.1087 21.1074 22 20.0049 22H4V18H2V16H4V13H2V11H4V8H2V6H4V2H20.0049ZM8 4H6V20H8V4ZM20 4H10V20H20V4Z" fill="currentColor"/>`,
|
||||
"braces": `<path d="M4 18V14.3C4 13.4716 3.32843 12.8 2.5 12.8H2V11.2H2.5C3.32843 11.2 4 10.5284 4 9.7V6C4 4.34315 5.34315 3 7 3H8V5H7C6.44772 5 6 5.44772 6 6V10.1C6 10.9858 5.42408 11.7372 4.62623 12C5.42408 12.2628 6 13.0142 6 13.9V18C6 18.5523 6.44772 19 7 19H8V21H7C5.34315 21 4 19.6569 4 18ZM20 14.3V18C20 19.6569 18.6569 21 17 21H16V19H17C17.5523 19 18 18.5523 18 18V13.9C18 13.0142 18.5759 12.2628 19.3738 12C18.5759 11.7372 18 10.9858 18 10.1V6C18 5.44772 17.5523 5 17 5H16V3H17C18.6569 3 20 4.34315 20 6V9.7C20 10.5284 20.6716 11.2 21.5 11.2H22V12.8H21.5C20.6716 12.8 20 13.4716 20 14.3Z" fill="currentColor"/>`,
|
||||
"brain": `<path d="M9 4C10.1046 4 11 4.89543 11 6V12.8271C10.1058 12.1373 8.96602 11.7305 7.6644 11.5136L7.3356 13.4864C8.71622 13.7165 9.59743 14.1528 10.1402 14.7408C10.67 15.3147 11 16.167 11 17.5C11 18.8807 9.88071 20 8.5 20C7.11929 20 6 18.8807 6 17.5V17.1493C6.43007 17.2926 6.87634 17.4099 7.3356 17.4864L7.6644 15.5136C6.92149 15.3898 6.1752 15.1144 5.42909 14.7599C4.58157 14.3573 4 13.499 4 12.5C4 11.6653 4.20761 11.0085 4.55874 10.5257C4.90441 10.0504 5.4419 9.6703 6.24254 9.47014L7 9.28078V6C7 4.89543 7.89543 4 9 4ZM12 3.35418C11.2671 2.52376 10.1947 2 9 2C6.79086 2 5 3.79086 5 6V7.77422C4.14895 8.11644 3.45143 8.64785 2.94126 9.34933C2.29239 10.2415 2 11.3347 2 12.5C2 14.0652 2.79565 15.4367 4 16.2422V17.5C4 19.9853 6.01472 22 8.5 22C9.91363 22 11.175 21.3482 12 20.3287C12.825 21.3482 14.0864 22 15.5 22C17.9853 22 20 19.9853 20 17.5V16.2422C21.2044 15.4367 22 14.0652 22 12.5C22 11.3347 21.7076 10.2415 21.0587 9.34933C20.5486 8.64785 19.8511 8.11644 19 7.77422V6C19 3.79086 17.2091 2 15 2C13.8053 2 12.7329 2.52376 12 3.35418ZM18 17.1493V17.5C18 18.8807 16.8807 20 15.5 20C14.1193 20 13 18.8807 13 17.5C13 16.167 13.33 15.3147 13.8598 14.7408C14.4026 14.1528 15.2838 13.7165 16.6644 13.4864L16.3356 11.5136C15.034 11.7305 13.8942 12.1373 13 12.8271V6C13 4.89543 13.8954 4 15 4C16.1046 4 17 4.89543 17 6V9.28078L17.7575 9.47014C18.5581 9.6703 19.0956 10.0504 19.4413 10.5257C19.7924 11.0085 20 11.6653 20 12.5C20 13.499 19.4184 14.3573 18.5709 14.7599C17.8248 15.1144 17.0785 15.3898 16.3356 15.5136L16.6644 17.4864C17.1237 17.4099 17.5699 17.2926 18 17.1493Z" fill="currentColor"/>`,
|
||||
"brain-ai-3": `<path d="M19.5 4.7832V7.6709L22 9.11426V14.8867L19.499 16.3311L19.5 19.2178L14.5 22.1045L12 20.6611L9.5 22.1045L4.5 19.2178V16.3311L2 14.8877L2.00098 9.11328L4.5 7.66992V4.78418L9.5 1.89746L11.999 3.34082L14.501 1.89648L19.5 4.7832ZM13 5.07227V7H11V5.07324L9.5 4.20703L6.49902 5.93848V8.8252L4 10.2676V13.7334L6.5 15.1768V18.0635L9.5 19.7959L11 18.9287V17H13V18.9297L14.5 19.7959L17.5 18.0625V15.1768L20 13.7324V10.2695L17.499 8.8252L17.5 5.9375L14.501 4.20605L13 5.07227ZM14.2646 13.1602C14.3529 12.9473 14.6472 12.9473 14.7354 13.1602L14.8623 13.4648C15.0783 13.986 15.4807 14.4027 15.9873 14.6279L16.3457 14.7871C16.5511 14.8784 16.5511 15.1773 16.3457 15.2686L15.9658 15.4375C15.4721 15.6571 15.0761 16.0586 14.8564 16.5625L14.7334 16.8447C14.6432 17.0517 14.3569 17.0517 14.2666 16.8447L14.1436 16.5625C13.9239 16.0586 13.5279 15.6571 13.0342 15.4375L12.6543 15.2686C12.4489 15.1773 12.4489 14.8784 12.6543 14.7871L13.0127 14.6279C13.5193 14.4027 13.9217 13.986 14.1377 13.4648L14.2646 13.1602ZM9.58789 7.7793C9.74239 7.40671 10.2577 7.4067 10.4121 7.7793L10.6338 8.31445C11.0118 9.22695 11.7161 9.95624 12.6025 10.3506L13.2305 10.6289C13.5899 10.7887 13.5897 11.3117 13.2305 11.4717L12.5654 11.7676C11.7013 12.152 11.0086 12.8548 10.624 13.7373L10.4082 14.2324C10.2504 14.5948 9.74973 14.5948 9.5918 14.2324L9.37598 13.7373C8.99143 12.8548 8.29875 12.152 7.43457 11.7676L6.76953 11.4717C6.41033 11.3117 6.41022 10.7887 6.76953 10.6289L7.39746 10.3506C8.2839 9.95624 8.98832 9.22697 9.36621 8.31445L9.58789 7.7793Z" fill="currentColor"/>`,
|
||||
"briefcase": `<path d="M7 5V2C7 1.44772 7.44772 1 8 1H16C16.5523 1 17 1.44772 17 2V5H21C21.5523 5 22 5.44772 22 6V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V6C2 5.44772 2.44772 5 3 5H7ZM4 16V19H20V16H4ZM4 14H20V7H4V14ZM9 3V5H15V3H9ZM11 11H13V13H11V11Z" fill="currentColor"/>`,
|
||||
|
||||
@@ -1,9 +1,21 @@
|
||||
import type { SVGProps } from 'react';
|
||||
|
||||
import { Icon } from '@/components/icon/Icon';
|
||||
|
||||
interface DiffIconProps extends Omit<SVGProps<SVGSVGElement>, 'children'> {
|
||||
size?: number | string;
|
||||
}
|
||||
|
||||
export function DiffViewIcon({ className = 'h-5 w-5' }: { className?: string }) {
|
||||
return (
|
||||
<span aria-hidden="true" className={`relative inline-block overflow-hidden rounded-[2px] ${className}`}>
|
||||
<span className="absolute left-[20%] top-[20%] h-[60%] w-[25%] bg-[var(--status-error)]/25" />
|
||||
<span className="absolute right-[20%] top-[20%] h-[60%] w-[25%] bg-[var(--status-success)]/25" />
|
||||
<Icon name="layout-column" className="absolute inset-0 h-full w-full" />
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Git merge/branch icon for the Diff tab.
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
|
||||
import { FileTypeIcon } from '@/components/icons/FileTypeIcon';
|
||||
import { DiffViewIcon } from '@/components/icons/DiffIcon';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { SortableTabsStrip } from '@/components/ui/sortable-tabs-strip';
|
||||
import { DiffView } from '@/components/views/DiffView';
|
||||
@@ -246,7 +247,7 @@ const getTabIcon = (tab: { mode: ContextPanelMode; targetPath: string | null }):
|
||||
}
|
||||
|
||||
if (tab.mode === 'diff') {
|
||||
return <Icon name="arrow-left-right" className="h-3.5 w-3.5" />;
|
||||
return <DiffViewIcon className="h-3.5 w-3.5" />;
|
||||
}
|
||||
|
||||
if (tab.mode === 'walkthrough') {
|
||||
@@ -258,7 +259,7 @@ const getTabIcon = (tab: { mode: ContextPanelMode; targetPath: string | null }):
|
||||
}
|
||||
|
||||
if (tab.mode === 'pr') {
|
||||
return <Icon name="git-pull-request" className="h-3.5 w-3.5" />;
|
||||
return <Icon name="github" className="h-3.5 w-3.5" />;
|
||||
}
|
||||
|
||||
if (tab.mode === 'notes') {
|
||||
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
import { CSS } from '@dnd-kit/utilities';
|
||||
|
||||
import { Icon } from '@/components/icon/Icon';
|
||||
import { DiffViewIcon } from '@/components/icons/DiffIcon';
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
|
||||
import { useEffectiveDirectory } from '@/hooks/useEffectiveDirectory';
|
||||
import { useDeviceInfo } from '@/lib/device';
|
||||
@@ -80,7 +81,11 @@ const ContextPanelRailItem: React.FC<RailItemProps> = ({
|
||||
: 'text-muted-foreground hover:text-foreground',
|
||||
)}
|
||||
>
|
||||
<Icon name={surface.icon} className="h-[18px] w-[18px]" />
|
||||
{surface.id === 'diff' ? (
|
||||
<DiffViewIcon />
|
||||
) : (
|
||||
<Icon name={surface.icon} className="h-[18px] w-[18px]" />
|
||||
)}
|
||||
{showActivityDot ? (
|
||||
<span
|
||||
aria-hidden="true"
|
||||
|
||||
@@ -62,7 +62,7 @@ export const CONTEXT_SURFACES: readonly ContextSurfaceDescriptor[] = [
|
||||
descriptionKey: 'contextRail.surface.pr.description',
|
||||
defaultWidthFraction: 0.45,
|
||||
mode: 'pr',
|
||||
icon: 'git-pull-request',
|
||||
icon: 'github',
|
||||
labelKey: 'contextPanel.mode.pr',
|
||||
availability: 'always',
|
||||
},
|
||||
@@ -89,7 +89,7 @@ export const CONTEXT_SURFACES: readonly ContextSurfaceDescriptor[] = [
|
||||
descriptionKey: 'contextRail.surface.editor.description',
|
||||
defaultWidthFraction: 3 / 5,
|
||||
mode: 'file',
|
||||
icon: 'file-code',
|
||||
icon: 'braces',
|
||||
labelKey: 'contextPanel.mode.files',
|
||||
availability: 'always',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user