Skip to content

Commit 9bd9923

Browse files
committed
[TOOL-2816] Nebula - update sidebar + other minor UI adjustments (#5823)
## Problem solved Short description of the bug fixed or feature added <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on improving the UI components in the `ChatBar`, `ChatSidebar`, and `ContextFilters` by updating styles, modifying button variants, and enhancing layout structures. It also introduces a new `SidebarIconLink` component for better organization. ### Detailed summary - Removed `variant="primary"` from `Button` in `ChatBar`. - Simplified `Button` in `NebulaMobileNav`. - Adjusted class names in `ChatHistoryPage` for responsiveness. - Updated `Badge` components in `ContextFilters` to use `variant="secondary"`. - Replaced multiple icons in `ChatSidebar` with new ones. - Changed `Button` variant to `outline` in `ChatSidebar`. - Added new `SidebarIconLink` component for navigation links. - Adjusted layout spacing in `ChatSidebar`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 1e27491 commit 9bd9923

File tree

5 files changed

+55
-36
lines changed

5 files changed

+55
-36
lines changed

apps/dashboard/src/app/nebula-app/(app)/chat/history/ChatHistoryPage.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,13 @@ export function ChatHistoryPageUI(props: {
8181

8282
{filteredSessions.length > 0 && (
8383
<ScrollShadow
84-
className="container max-w-[800px] flex-1"
84+
className="flex-1"
8585
scrollableClassName="max-h-full py-6"
8686
shadowColor="hsl(var(--background))"
87+
shadowClassName="z-10"
8788
>
8889
{filteredSessions.length > 0 && (
89-
<div className="flex flex-col gap-5">
90+
<div className="container flex max-w-[800px] flex-col gap-5">
9091
{filteredSessions.map((session) => (
9192
<SessionCard
9293
key={session.id + session.updated_at + session.created_at}

apps/dashboard/src/app/nebula-app/(app)/components/ChatBar.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ export function Chatbar(props: {
5151
<Button
5252
aria-label="Send"
5353
disabled={message.trim() === ""}
54-
variant="primary"
5554
className={cn(
5655
"!h-auto w-auto border border-transparent p-2 disabled:opacity-100",
5756
message === "" &&

apps/dashboard/src/app/nebula-app/(app)/components/ChatSidebar.tsx

Lines changed: 47 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ import { ScrollShadow } from "@/components/ui/ScrollShadow/ScrollShadow";
33
import { Badge } from "@/components/ui/badge";
44
import { Button } from "@/components/ui/button";
55
import type { Account } from "@3rdweb-sdk/react/hooks/useApi";
6-
import {
7-
ChevronRightIcon,
8-
FlaskConicalIcon,
9-
MessageSquareDashedIcon,
10-
} from "lucide-react";
6+
import { MessagesSquareIcon, SquareDashedBottomCodeIcon } from "lucide-react";
117
import Link from "next/link";
128
import type { TruncatedSessionInfo } from "../api/types";
139
import { useNewChatPageLink } from "../hooks/useNewChatPageLink";
@@ -33,31 +29,45 @@ export function ChatSidebar(props: {
3329
<NebulaIcon className="size-8 text-foreground" />
3430
</Link>
3531

36-
<Badge variant="outline" className="gap-1">
37-
<FlaskConicalIcon className="size-2.5" />
32+
<Badge variant="secondary" className="gap-1 py-1">
3833
Alpha
3934
</Badge>
4035
</div>
4136

42-
<div className="p-2">
43-
<div className="h-3" />
44-
<Button asChild variant="primary" className="w-full gap-2">
45-
<Link href={newChatPage}>
46-
<MessageSquareDashedIcon className="size-4" />
47-
New Chat
48-
</Link>
37+
<div className="h-4" />
38+
39+
<div className="flex flex-col gap-2 px-2">
40+
<Button asChild variant="outline" className="w-full gap-2 rounded-lg">
41+
<Link href={newChatPage}>New Chat</Link>
4942
</Button>
5043
</div>
5144

45+
<div className="h-4" />
46+
47+
<div>
48+
<SidebarIconLink
49+
href="/chat/history"
50+
icon={MessagesSquareIcon}
51+
label="All Chats"
52+
/>
53+
54+
<SidebarIconLink
55+
href="https://portal.thirdweb.com/nebula"
56+
icon={SquareDashedBottomCodeIcon}
57+
label="Documentation"
58+
target="_blank"
59+
/>
60+
</div>
61+
5262
{sessionsToShow.length > 0 && (
5363
<ScrollShadow
54-
className="my-5 flex-1 border-t border-dashed pt-2"
64+
className="my-4 flex-1 border-t border-dashed pt-2"
5565
scrollableClassName="max-h-full"
56-
shadowColor="hsl(var(--muted))"
66+
shadowColor="transparent"
5767
shadowClassName="z-10"
5868
>
5969
<div className="flex flex-col gap-1">
60-
<h3 className="px-2 py-3 text-muted-foreground text-sm">
70+
<h3 className="px-2 py-3 text-muted-foreground text-xs">
6171
Recent Chats
6272
</h3>
6373
{sessionsToShow.map((session) => {
@@ -70,13 +80,6 @@ export function ChatSidebar(props: {
7080
/>
7181
);
7282
})}
73-
74-
<Link
75-
href="/chat/history"
76-
className="inline-flex items-center gap-1.5 px-2 py-3 text-muted-foreground text-sm underline-offset-4 hover:text-foreground hover:underline"
77-
>
78-
View All <ChevronRightIcon className="size-4 text-foreground" />
79-
</Link>
8083
</div>
8184
</ScrollShadow>
8285
)}
@@ -89,3 +92,23 @@ export function ChatSidebar(props: {
8992
</div>
9093
);
9194
}
95+
96+
function SidebarIconLink(props: {
97+
icon: React.FC<{ className?: string }>;
98+
label: string;
99+
target?: "_blank";
100+
href: string;
101+
}) {
102+
return (
103+
<Button asChild variant="ghost">
104+
<Link
105+
href={props.href}
106+
target={props.target}
107+
className="!justify-start !px-3 w-full gap-2.5 rounded-lg text-left"
108+
>
109+
<props.icon className="size-4" />
110+
{props.label}
111+
</Link>
112+
</Button>
113+
);
114+
}

apps/dashboard/src/app/nebula-app/(app)/components/ContextFilters.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use client";
22

3+
import { MultiNetworkSelector } from "@/components/blocks/NetworkSelectors";
34
import { Spinner } from "@/components/ui/Spinner/Spinner";
45
import { Badge } from "@/components/ui/badge";
56
import { Button } from "@/components/ui/button";
@@ -30,7 +31,6 @@ import { useForm } from "react-hook-form";
3031
import { toast } from "sonner";
3132
import { isAddress } from "thirdweb";
3233
import { z } from "zod";
33-
import { MultiNetworkSelector } from "../../../../@/components/blocks/NetworkSelectors";
3434
import type { ContextFilters } from "../api/chat";
3535

3636
export default function ContextFiltersButton(props: {
@@ -55,14 +55,14 @@ export default function ContextFiltersButton(props: {
5555
Context Filters
5656
<div className="flex gap-1 overflow-hidden">
5757
{chainIds && chainIds.length > 0 && (
58-
<Badge className="gap-1 truncate">
58+
<Badge className="gap-1 truncate" variant="secondary">
5959
Chain
6060
<span className="max-sm:hidden">{chainIds.join(", ")}</span>
6161
</Badge>
6262
)}
6363

6464
{contractAddresses && contractAddresses.length > 0 && (
65-
<Badge className="gap-1 truncate">
65+
<Badge className="gap-1 truncate" variant="secondary">
6666
Contract
6767
<span className="max-sm:hidden">
6868
{contractAddresses
@@ -73,7 +73,7 @@ export default function ContextFiltersButton(props: {
7373
)}
7474

7575
{walletAddresses && walletAddresses.length > 0 && (
76-
<Badge className="gap-1 truncate">
76+
<Badge className="gap-1 truncate" variant="secondary">
7777
Wallet
7878
<span className="max-sm:hidden">
7979
{walletAddresses

apps/dashboard/src/app/nebula-app/(app)/components/NebulaMobileNav.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,7 @@ export function MobileNav(props: {
6161
</Sheet>
6262

6363
<div className="flex items-center gap-5">
64-
<Button
65-
asChild
66-
variant="primary"
67-
className="h-auto w-auto rounded-lg px-2.5 py-1.5"
68-
>
64+
<Button asChild className="h-auto w-auto rounded-lg px-2.5 py-1.5">
6965
<Link href={newChatPage}>New Chat</Link>
7066
</Button>
7167
</div>

0 commit comments

Comments
 (0)