fix(ui): address greptile sidebar rail review

This commit is contained in:
Dotta committed 2026-06-09 16:37:05 +00:00
1 parent 2dee4ba32e
commit d5627dc442
3 files changed
+11 -9

No files matched your search

@@ -11,11 +11,13 @@ interface ShortcutEntry {
// Platform-appropriate label for the Cmd/Ctrl modifier so the cheatsheet shows
// the same key the user actually presses (re-pointed in the collapsible sidebar
// work — Cmd/Ctrl+B toggles the rail).
const META_KEY =
typeof navigator !== "undefined" &&
/Mac|iPhone|iPad|iPod/.test(navigator.platform || navigator.userAgent || "")
? "⌘"
: "Ctrl";
function getPlatformLabel() {
if (typeof navigator === "undefined") return "";
const nav = navigator as Navigator & { userAgentData?: { platform?: string } };
return nav.userAgentData?.platform || navigator.userAgent || "";
}
const META_KEY = /Mac|iPhone|iPad|iPod/.test(getPlatformLabel()) ? "⌘" : "Ctrl";
interface ShortcutSection {
title: string;
+2 -2
View File
@@ -17,7 +17,7 @@ import { useSidebar } from "../context/SidebarContext";
import { useTheme } from "../context/ThemeContext";
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import { cn } from "../lib/utils";
import { cn, SIDEBAR_RAIL_HIDDEN_LABEL } from "../lib/utils";
const PROFILE_SETTINGS_PATH = "/company/settings/instance/profile";
const DOCS_URL = "https://docs.paperclip.ing/";
@@ -151,7 +151,7 @@ export function SidebarAccountMenu({
{session?.user.image ? <AvatarImage src={session.user.image} alt={displayName} /> : null}
<AvatarFallback>{initials}</AvatarFallback>
</Avatar>
<span className={cn("min-w-0 flex-1 truncate", rail && "sr-only")}>{displayName}</span>
<span className={cn("min-w-0 flex-1 truncate", rail && SIDEBAR_RAIL_HIDDEN_LABEL)}>{displayName}</span>
</button>
</PopoverTrigger>
<PopoverContent
+2 -2
View File
@@ -36,7 +36,7 @@ import { useCompany } from "@/context/CompanyContext";
import { useDialogActions } from "@/context/DialogContext";
import { useCompanyOrder } from "@/hooks/useCompanyOrder";
import { queryKeys } from "@/lib/queryKeys";
import { cn } from "@/lib/utils";
import { cn, SIDEBAR_RAIL_HIDDEN_LABEL } from "@/lib/utils";
import { useSidebar } from "../context/SidebarContext";
import { CompanyPatternIcon } from "./CompanyPatternIcon";
@@ -235,7 +235,7 @@ export function SidebarCompanyMenu({ open: controlledOpen, onOpenChange }: Sideb
>
<span className="flex min-w-0 flex-1 items-center gap-2">
{selectedCompany ? <WorkspaceIcon company={selectedCompany} /> : null}
<span className={cn("truncate text-sm font-bold text-foreground", rail && "sr-only")}>
<span className={cn("truncate text-sm font-bold text-foreground", rail && SIDEBAR_RAIL_HIDDEN_LABEL)}>
{selectedCompany?.name ?? "Select workspace"}
</span>
</span>