feat(webui): unify icons and refine interaction feedback (#6074)
* feat(webui): unify product icons and refine interaction feedback * test(webui): align layout and tooltip expectations with icon refresh * test(webui): verify temporary chat uses shared icon controls * fix(webui): toggle workspace access directly and restore send arrow * fix(webui): keep the send control circular * fix(webui): clear workspace toggle background on pointer leave * test(webui): isolate GitHub navigation in star prompt tests * test(webui): prevent external default navigation during star link clicks
This commit is contained in:
1 parent
9dc0abae4f
commit
63bdd40280
59 files changed
+615
-505
No files matched your search
@@ -1,20 +1,21 @@
|
||||
import {
|
||||
ArchiveIcon,
|
||||
SkillsIcon,
|
||||
AutomationsIcon,
|
||||
ChannelsIcon,
|
||||
SearchIcon,
|
||||
SettingsIcon,
|
||||
NewChatIcon,
|
||||
ComposeIcon,
|
||||
AppsIcon,
|
||||
} from "@/components/icons/product-icons";
|
||||
import {
|
||||
type ReactNode,
|
||||
type RefObject,
|
||||
useRef,
|
||||
useState,
|
||||
} from "react";
|
||||
import {
|
||||
Archive,
|
||||
Brain,
|
||||
CalendarClock,
|
||||
MessageCircle,
|
||||
PanelLeftClose,
|
||||
Search,
|
||||
Settings,
|
||||
SquarePen,
|
||||
Blocks,
|
||||
} from "lucide-react";
|
||||
import { PanelLeftClose } from "lucide-react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import {
|
||||
@@ -125,11 +126,11 @@ export function Sidebar(props: SidebarProps) {
|
||||
collapsed={collapsed}
|
||||
label={t("sidebar.newChat")}
|
||||
iconOnly
|
||||
className={collapsed ? undefined : "rounded-full border border-border/70 bg-background/80 shadow-sm"}
|
||||
className={collapsed ? undefined : "rounded-full border border-border/70 bg-background/80 shadow-sm settings-hover"}
|
||||
onClick={props.onNewChat}
|
||||
active={props.newChatActive}
|
||||
selectionRef={collapsed ? activeActionRef : undefined}
|
||||
icon={<SquarePen className="h-4 w-4" />}
|
||||
icon={collapsed ? <NewChatIcon className="h-4 w-4" /> : <ComposeIcon className="h-4 w-4" />}
|
||||
shortcut={sidebarShortcutLabel("newChat", apple)}
|
||||
ariaKeyShortcuts={sidebarShortcutAria("newChat")}
|
||||
/>
|
||||
@@ -142,7 +143,7 @@ export function Sidebar(props: SidebarProps) {
|
||||
ariaKeyShortcuts={sidebarShortcutAria("search")}
|
||||
iconOnly
|
||||
onClick={props.onOpenSearch}
|
||||
icon={<Search className="h-4 w-4" />}
|
||||
icon={<SearchIcon className="h-4 w-4" />}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -175,9 +176,7 @@ export function Sidebar(props: SidebarProps) {
|
||||
className={cn(
|
||||
"host-no-drag flex h-8 w-8 shrink-0 items-center justify-center rounded-xl transition-colors",
|
||||
props.hostChromeInset && "mt-5",
|
||||
collapsed
|
||||
? "hover:bg-sidebar-accent/60"
|
||||
: "pointer-events-none",
|
||||
!collapsed && "pointer-events-none",
|
||||
)}
|
||||
>
|
||||
<img
|
||||
@@ -218,7 +217,7 @@ export function Sidebar(props: SidebarProps) {
|
||||
onIntent={props.onSettingsIntent}
|
||||
active={props.activeUtility === "apps"}
|
||||
selectionRef={activeActionRef}
|
||||
icon={<Blocks className="h-4 w-4" />}
|
||||
icon={<AppsIcon className="h-4 w-4" />}
|
||||
/>
|
||||
<SidebarActionButton
|
||||
collapsed={collapsed}
|
||||
@@ -229,7 +228,7 @@ export function Sidebar(props: SidebarProps) {
|
||||
onIntent={props.onSettingsIntent}
|
||||
active={props.activeUtility === "skills"}
|
||||
selectionRef={activeActionRef}
|
||||
icon={<Brain className="h-4 w-4" />}
|
||||
icon={<SkillsIcon className="h-4 w-4" />}
|
||||
/>
|
||||
<SidebarActionButton
|
||||
collapsed={collapsed}
|
||||
@@ -240,7 +239,7 @@ export function Sidebar(props: SidebarProps) {
|
||||
onIntent={props.onSettingsIntent}
|
||||
active={props.activeUtility === "automations"}
|
||||
selectionRef={activeActionRef}
|
||||
icon={<CalendarClock className="h-4 w-4" />}
|
||||
icon={<AutomationsIcon className="h-4 w-4" />}
|
||||
/>
|
||||
<SidebarActionButton
|
||||
collapsed={collapsed}
|
||||
@@ -251,14 +250,14 @@ export function Sidebar(props: SidebarProps) {
|
||||
onIntent={props.onSettingsIntent}
|
||||
active={props.activeUtility === "channels"}
|
||||
selectionRef={activeActionRef}
|
||||
icon={<MessageCircle className="h-4 w-4" />}
|
||||
icon={<ChannelsIcon className="h-4 w-4" />}
|
||||
/>
|
||||
{props.archivedCount ? (
|
||||
<SidebarActionButton
|
||||
collapsed={collapsed}
|
||||
label={props.showArchived ? t("chat.hideArchived") : t("chat.showArchived")}
|
||||
onClick={props.onToggleArchived}
|
||||
icon={<Archive className="h-4 w-4" />}
|
||||
icon={<ArchiveIcon className="h-4 w-4" />}
|
||||
/>
|
||||
) : null}
|
||||
</SidebarSelectionHighlight>
|
||||
@@ -329,8 +328,7 @@ export function Sidebar(props: SidebarProps) {
|
||||
ariaKeyShortcuts={sidebarShortcutAria("settings")}
|
||||
onClick={props.onOpenSettings}
|
||||
onIntent={props.onSettingsIntent}
|
||||
className="w-9"
|
||||
icon={<Settings className="h-4 w-4" />}
|
||||
icon={<SettingsIcon className="h-4 w-4" />}
|
||||
/>
|
||||
<HostSwitcher collapsed={collapsed} portalContainer={props.containActionMenus ? menuPortalContainer : undefined} />
|
||||
</div>
|
||||
@@ -370,7 +368,7 @@ function SidebarActionButton({
|
||||
<Button
|
||||
ref={active ? selectionRef : undefined}
|
||||
type="button"
|
||||
variant={null}
|
||||
variant={compact ? "icon" : null}
|
||||
aria-label={label}
|
||||
aria-current={active ? "page" : undefined}
|
||||
aria-keyshortcuts={ariaKeyShortcuts}
|
||||
@@ -386,7 +384,9 @@ function SidebarActionButton({
|
||||
: "w-full justify-start gap-2 px-2 text-[13px] leading-5 [&_svg]:h-[18px] [&_svg]:w-[18px] [&_svg]:stroke-[1.75]",
|
||||
active
|
||||
? "text-sidebar-accent-foreground"
|
||||
: "text-sidebar-content settings-hover hover:text-sidebar-accent-foreground",
|
||||
: compact
|
||||
? "text-sidebar-content hover:text-sidebar-accent-foreground"
|
||||
: "text-sidebar-content settings-hover hover:text-sidebar-accent-foreground",
|
||||
className,
|
||||
)}
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user