Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

feat: improve styles for filters

Andrej615d5dd2efda
diff --git a/apps/web/src/components/board/board-toolbar.tsx b/apps/web/src/components/board/board-toolbar.tsx
index 98f49ad68..76ada6e76 100644
--- a/apps/web/src/components/board/board-toolbar.tsx
+++ b/apps/web/src/components/board/board-toolbar.tsx
@@ -84,7 +84,7 @@ function ActiveFilterChip({
<span className="h-full w-px bg-border" />
<span className="px-2 text-foreground/80">{operator}</span>
<span className="h-full w-px bg-border" />
- <span className="px-2 text-foreground">{value}</span>
+ <span className="flex px-2 text-foreground">{value}</span>
<span className="h-full w-px bg-border" />
<button
className="inline-flex h-full w-7 items-center justify-center rounded-r-md text-foreground/70 hover:bg-accent/70 hover:text-foreground"
diff --git a/apps/web/src/components/common/header/workspace-crumb-select.tsx b/apps/web/src/components/common/header/workspace-crumb-select.tsx
index 20c20546c..3e3d05a98 100644
--- a/apps/web/src/components/common/header/workspace-crumb-select.tsx
+++ b/apps/web/src/components/common/header/workspace-crumb-select.tsx
@@ -1,109 +1,26 @@
-import { ChevronsUpDown } from "lucide-react";
-import { useState } from "react";
+import { useNavigate } from "@tanstack/react-router";
import { Button } from "@/components/ui/button";
-import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuGroup,
- DropdownMenuItem,
- DropdownMenuLabel,
- DropdownMenuSeparator,
- DropdownMenuTrigger,
-} from "@/components/ui/menu";
-import useGetWorkspaces from "@/hooks/queries/workspace/use-get-workspaces";
+import useActiveWorkspace from "@/hooks/queries/workspace/use-active-workspace";
-type WorkspaceCrumbSelectProps = {
- workspaceId?: string;
- workspaceName?: string;
- onSelectWorkspace: (workspaceId: string) => Promise<void> | void;
-};
-
-type WorkspaceOption = {
- id: string;
- name: string;
-};
-
-export default function WorkspaceCrumbSelect({
- workspaceId,
- workspaceName,
- onSelectWorkspace,
-}: WorkspaceCrumbSelectProps) {
- const { data: workspaces = [] } = useGetWorkspaces();
- const [switchingWorkspaceId, setSwitchingWorkspaceId] = useState<
- string | null
- >(null);
-
- const workspaceOptions = (workspaces ?? []).filter(
- (workspace): workspace is WorkspaceOption =>
- typeof workspace?.id === "string" && typeof workspace?.name === "string",
- );
-
- const handleSelectWorkspace = async (nextWorkspaceId: string) => {
- if (nextWorkspaceId === workspaceId || switchingWorkspaceId) {
- return;
- }
-
- setSwitchingWorkspaceId(nextWorkspaceId);
- try {
- await onSelectWorkspace(nextWorkspaceId);
- } finally {
- setSwitchingWorkspaceId(null);
- }
- };
+export default function WorkspaceCrumbSelect() {
+ const { data: workspace } = useActiveWorkspace();
+ const navigate = useNavigate();
return (
- <DropdownMenu>
- <DropdownMenuTrigger
- render={
- <Button
- variant="ghost"
- size="xs"
- className="h-7 justify-between px-2 text-xs text-foreground"
- />
- }
- >
- <span className="truncate text-left">
- {workspaceName || "Select workspace"}
- </span>
- <ChevronsUpDown className="size-3.5 text-muted-foreground" />
- </DropdownMenuTrigger>
- <DropdownMenuContent className="w-64" align="start">
- <DropdownMenuGroup>
- <DropdownMenuLabel className="text-[11px] uppercase tracking-wide">
- Workspaces
- </DropdownMenuLabel>
- </DropdownMenuGroup>
- <DropdownMenuSeparator />
- <DropdownMenuGroup>
- {workspaceOptions.length > 0 ? (
- workspaceOptions.map((workspace) => (
- <DropdownMenuItem
- key={workspace.id}
- disabled={
- workspace.id === workspaceId ||
- (switchingWorkspaceId !== null &&
- switchingWorkspaceId !== workspace.id)
- }
- onClick={() => handleSelectWorkspace(workspace.id)}
- className="h-8 text-sm"
- >
- <span className="truncate">
- {switchingWorkspaceId === workspace.id
- ? "Switching..."
- : workspace.name}
- </span>
- </DropdownMenuItem>
- ))
- ) : (
- <DropdownMenuItem
- disabled
- className="h-8 text-sm text-muted-foreground"
- >
- No workspaces
- </DropdownMenuItem>
- )}
- </DropdownMenuGroup>
- </DropdownMenuContent>
- </DropdownMenu>
+ <Button
+ variant="ghost"
+ size="xs"
+ className="h-7 justify-between px-2 text-xs text-foreground"
+ onClick={() => {
+ navigate({
+ to: "/dashboard/workspace/$workspaceId",
+ params: { workspaceId: workspace?.id },
+ });
+ }}
+ >
+ <span className="truncate text-left">
+ {workspace?.name || "Select workspace"}
+ </span>
+ </Button>
);
}
diff --git a/apps/web/src/components/common/project-layout.tsx b/apps/web/src/components/common/project-layout.tsx
index f7d3e36b4..fa4916dfc 100644
--- a/apps/web/src/components/common/project-layout.tsx
+++ b/apps/web/src/components/common/project-layout.tsx
@@ -96,7 +96,7 @@ export default function ProjectLayout({
<div className="flex min-w-0 items-center gap-2">
<TooltipProvider>
<Tooltip>
- <TooltipTrigger asChild>
+ <TooltipTrigger>
<SidebarTrigger className="-ml-1 h-7 w-7 cursor-pointer text-foreground/85 hover:text-foreground" />
</TooltipTrigger>
<TooltipContent>
@@ -116,11 +116,7 @@ export default function ProjectLayout({
<div className="h-4 w-px shrink-0 bg-border/80" />
<div className="hidden min-w-0 items-center gap-1 md:flex">
- <WorkspaceCrumbSelect
- workspaceId={workspaceId}
- workspaceName={workspace?.name}
- onSelectWorkspace={handleWorkspaceSwitch}
- />
+ <WorkspaceCrumbSelect />
<span className="text-muted-foreground/70 text-xs">/</span>
<ProjectCrumbSelect
workspaceId={workspaceId}