Skip to content

UI fixes #161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 48 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
537adec
Merge pull request #151 from aibtcdev/feat/remove-endpoints-for-backend
whoabuddy Dec 20, 2024
57f8169
Merge pull request #157 from aibtcdev/staging
human058382928 Jan 14, 2025
5249f9c
hotfix: remove wrangler.toml
whoabuddy Jan 14, 2025
85e1a72
Merge pull request #158 from aibtcdev/staging
human058382928 Jan 14, 2025
45bc529
Merge pull request #159 from aibtcdev/staging
human058382928 Jan 14, 2025
4235ecd
Merge pull request #160 from aibtcdev/staging
human058382928 Jan 14, 2025
863daeb
fix: seperate thread component
biwasxyz Jan 14, 2025
3d8a43c
fix: change thread to chat
biwasxyz Jan 14, 2025
5b1a5f7
fix: chat window
biwasxyz Jan 14, 2025
425d8e7
fix: remove z-index
biwasxyz Jan 14, 2025
330ed48
fix: wallet panel in mobile
biwasxyz Jan 14, 2025
d061c75
fix: add aibtc logo in login
biwasxyz Jan 14, 2025
3cc46b3
Merge branch 'main' into css-fix
biwasxyz Jan 14, 2025
970c2b9
fix: agent pages
biwasxyz Jan 14, 2025
efb6e89
fix: fix user guide
biwasxyz Jan 14, 2025
f6d8da2
fix: show guide to new user only
biwasxyz Jan 14, 2025
b3e50d5
fix: remove unused vars
biwasxyz Jan 14, 2025
fe82e84
fix: show guide in desktop only
biwasxyz Jan 14, 2025
3a399b7
fix: remove duplicates
biwasxyz Jan 14, 2025
8b78f15
minor fixes
biwasxyz Jan 14, 2025
cc3ef9b
fix: agentpage ui
biwasxyz Jan 14, 2025
449b691
fix: comment out /chat route
biwasxyz Jan 14, 2025
9a2768c
fix: add brand logo
biwasxyz Jan 14, 2025
e78735f
fix: more fixups
biwasxyz Jan 14, 2025
6a2277c
fix: consitent icons
biwasxyz Jan 14, 2025
8927761
fix: user guide grammar
biwasxyz Jan 14, 2025
74f8729
fix: remove logs
biwasxyz Jan 14, 2025
292d710
fix: unnecessary code blocks
biwasxyz Jan 14, 2025
ab0dea6
fix: remove empty div
biwasxyz Jan 14, 2025
554906b
fix: cleanups
biwasxyz Jan 14, 2025
b02bf55
fix: cleanups
biwasxyz Jan 14, 2025
90f2f5e
fix: update layout
biwasxyz Jan 14, 2025
ddc6c4b
fix: use env to decide network
biwasxyz Jan 14, 2025
c59a2ac
fix: remove logs
biwasxyz Jan 14, 2025
9d5f47d
fix: build error
biwasxyz Jan 14, 2025
a64cceb
fix: implement new image url for agent
biwasxyz Jan 14, 2025
17ac776
fix: build errors
biwasxyz Jan 14, 2025
d74c1ce
fix: update image in agent selector too
biwasxyz Jan 14, 2025
614d607
fix: more fixups
biwasxyz Jan 14, 2025
8cd251f
fix: image for chat bubble
biwasxyz Jan 14, 2025
6b5aa21
fix: type
biwasxyz Jan 14, 2025
c6c6a5d
fix: add early return condition
biwasxyz Jan 14, 2025
e035a3b
fix: image in chat bubble
biwasxyz Jan 14, 2025
679e176
fix: comment out logs
biwasxyz Jan 14, 2025
669898a
fix: twitter og image
biwasxyz Jan 15, 2025
dd98abe
fix: meta title for DAOs
biwasxyz Jan 15, 2025
847dedf
fix: dao layout
biwasxyz Jan 15, 2025
aa70e27
Merge branch 'staging' into css-fix
human058382928 Jan 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/app/agents/[id]/edit/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { AgentForm } from "@/components/agents/agent-form";
import { Agent } from "@/types/supabase";
import { supabase } from "@/utils/supabase/client";
import { useSessionStore } from "@/store/session";
import { getRandomImageUrl } from "@/lib/generate-image";

export const runtime = "edge";

Expand Down Expand Up @@ -66,15 +67,9 @@ export default function EditAgentPage() {
e.preventDefault();
if (!agent) return;

const imageUrlName = `${agent.name}_${
stxAddresses[network as keyof typeof stxAddresses]
}`;

const updatedAgent = {
...agent,
image_url: `https://bitcoinfaces.xyz/api/get-image?name=${encodeURIComponent(
imageUrlName
)}`,
image_url: getRandomImageUrl(),
};

setSaving(true);
Expand Down
35 changes: 3 additions & 32 deletions src/app/agents/new/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
"use client";

import { useState, useEffect } from "react";
import { useState } from "react";
import { useRouter } from "next/navigation";
import { AgentForm } from "@/components/agents/agent-form";
import { Agent } from "@/types/supabase";
import { supabase } from "@/utils/supabase/client";
import { useSessionStore } from "@/store/session";
import { useWalletStore } from "@/store/wallet";
import { getRandomImageUrl } from "@/lib/generate-image";

// Loading Modal Component
const LoadingModal = () => (
Expand All @@ -24,10 +25,6 @@ export default function NewAgentPage() {
const router = useRouter();
const { userId } = useSessionStore();
const fetchWallets = useWalletStore((state) => state.fetchWallets);
const [stxAddresses, setStxAddresses] = useState<{
testnet: string;
mainnet: string;
}>({ testnet: "", mainnet: "" });

const [agent, setAgent] = useState<Partial<Agent>>({
name: "",
Expand All @@ -41,38 +38,12 @@ export default function NewAgentPage() {
const [saving, setSaving] = useState(false);
const [showLoadingModal, setShowLoadingModal] = useState(false);

useEffect(() => {
try {
const blockstackSession = localStorage.getItem("blockstack-session");
if (blockstackSession) {
const sessionData = JSON.parse(blockstackSession);
const addresses = sessionData?.userData?.profile?.stxAddress;
if (addresses) {
setStxAddresses({
testnet: addresses.testnet,
mainnet: addresses.mainnet,
});
}
}
} catch (error) {
console.error("Error reading blockstack session:", error);
}
}, []);

const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();

// Create combined name for image URL only
const imageUrlName = `${agent.name}_${
process.env.NEXT_PUBLIC_STACKS_NETWORK === "mainnet"
? stxAddresses.mainnet
: stxAddresses.testnet
}`;
const updatedAgent = {
...agent,
image_url: `https://bitcoinfaces.xyz/api/get-image?name=${encodeURIComponent(
imageUrlName
)}`,
image_url: getRandomImageUrl(),
};

setSaving(true);
Expand Down
65 changes: 39 additions & 26 deletions src/app/agents/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Button } from "@/components/ui/button";
import { Plus, Archive } from "lucide-react";
import { Heading } from "@/components/ui/heading";
import { useAgentsList } from "@/hooks/use-agents-list";
import Image from "next/image";
import { useState } from "react";
import { cn } from "@/lib/utils";

Expand Down Expand Up @@ -46,24 +45,31 @@ export default function AgentsPage() {
</div>

{/* Active Agents */}
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6">
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
{activeAgents.map((agent) => (
<Link
href={`/agents/${agent.id}`}
key={agent.id}
className="group relative bg-card hover:bg-muted transition-colors duration-200 rounded-lg overflow-hidden"
className="group flex items-center p-4 bg-card hover:bg-muted transition-colors duration-200 rounded-lg"
>
<div className="aspect-[4/3] relative">
<Image
src={agent.image_url || "/placeholder-agent.png"}
alt={agent.name}
fill
unoptimized={true}
className="object-cover w-full h-full"
/>
<div
className="relative w-16 h-16 flex-shrink-0 rounded-full overflow-hidden"
style={{
backgroundImage: `url(${
agent.image_url || "/placeholder-agent.png"
})`,
backgroundSize: "cover",
backgroundPosition: "center",
}}
>
<div className="absolute inset-0 bg-black/20 flex items-center justify-center">
<span className="text-2xl font-bold text-white">
{agent.name ? agent.name.charAt(0).toUpperCase() : "?"}
</span>
</div>
</div>
<div className="p-4">
<h3 className="font-medium text-lg">{agent.name}</h3>
<div className="ml-4 flex-grow">
<h3 className="font-medium text-base">{agent.name}</h3>
<p className="text-sm text-muted-foreground mt-1 line-clamp-2">
{agent.goal || agent.role}
</p>
Expand All @@ -80,25 +86,32 @@ export default function AgentsPage() {
Archived Agents
</h2>
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6">
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
{archivedAgents.map((agent) => (
<Link
href={`/agents/${agent.id}`}
key={agent.id}
className="group relative bg-card hover:bg-muted transition-colors duration-200 rounded-lg overflow-hidden opacity-75 hover:opacity-100"
className="group flex items-center p-4 bg-card hover:bg-muted transition-colors duration-200 rounded-lg opacity-75 hover:opacity-100"
>
<div className="aspect-[4/3] relative grayscale group-hover:grayscale-0 transition-all duration-200">
<Image
src={agent.image_url || "/placeholder-agent.png"}
alt={agent.name}
fill
unoptimized={true}
className="object-cover w-full h-full"
/>
<div
className="relative w-16 h-16 flex-shrink-0 rounded-full overflow-hidden"
style={{
backgroundImage: `url(${
agent.image_url || "/placeholder-agent.png"
})`,
backgroundSize: "cover",
backgroundPosition: "center",
}}
>
<div className="absolute inset-0 bg-black/20 flex items-center justify-center group-hover:bg-black/10 transition-colors">
<span className="text-2xl font-bold text-white">
{agent.name ? agent.name.charAt(0).toUpperCase() : "?"}
</span>
</div>
</div>
<div className="p-4">
<div className="flex items-center gap-2 mb-2">
<h3 className="font-medium text-lg">{agent.name}</h3>
<div className="ml-4 flex-grow">
<div className="flex items-center gap-2">
<h3 className="font-medium text-base">{agent.name}</h3>
<span className="px-2 py-0.5 rounded text-xs font-medium bg-zinc-800/40 text-zinc-400">
Archived
</span>
Expand Down
43 changes: 22 additions & 21 deletions src/app/application-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,7 @@ import * as React from "react";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { cn } from "@/lib/utils";
import {
Users,
MessageSquare,
Boxes,
Menu,
Wallet,
X,
LogOut,
} from "lucide-react";
import { Users, Boxes, Menu, Wallet, X, LogOut } from "lucide-react";
import { ScrollArea } from "@/components/ui/scroll-area";
import { WalletPanel } from "@/components/wallet/wallet-panel";
import { ThreadList } from "@/components/threads/thread-list";
Expand All @@ -26,10 +18,10 @@ interface ApplicationLayoutProps {
}

const navigation = [
{ name: "Chat", href: "/chat", icon: MessageSquare },
{ name: "Agents", href: "/agents", icon: Users },
{ name: "DAOs", href: "/daos", icon: Boxes },
{ id: "agents", name: "Agents", href: "/agents", icon: Users },
{ id: "daos", name: "DAOs", href: "/daos", icon: Boxes },
{
id: "profile",
name: "Profile",
href: "/profile",
icon: ({ className }: { className?: string }) => (
Expand Down Expand Up @@ -82,7 +74,12 @@ export default function ApplicationLayout({
width={20}
height={20}
/>
<span className="text-lg font-medium text-white">AIBTCDEV</span>
<Image
src="/logos/aibtcdev-primary-logo-white-wide-1000px.png"
alt="AIBTCDEV"
width={150}
height={300}
/>
</div>
<Button
variant="ghost"
Expand Down Expand Up @@ -118,7 +115,12 @@ export default function ApplicationLayout({
width={20}
height={20}
/>
<span className="text-lg font-medium text-white">AIBTCDEV</span>
<Image
src="/logos/aibtcdev-primary-logo-white-wide-1000px.png"
alt="AIBTCDEV"
width={150}
height={300}
/>
</div>
<Button
variant="ghost"
Expand All @@ -132,14 +134,19 @@ export default function ApplicationLayout({

{/* Navigation */}
<div className="flex flex-col h-[calc(100vh-3.5rem)]">
{/* Thread List */}
<div className="flex-1 overflow-y-auto">
<ThreadList setLeftPanelOpen={setLeftPanelOpen} />
</div>
<nav className="flex-none p-2" id="step4">
<div className="space-y-1">
{navigation.map((item) => {
const isActive = pathname === item.href;
return (
<Link
key={item.name}
key={item.id}
href={item.href}
id={item.id}
className={cn(
"flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-lg transition-colors",
isActive
Expand All @@ -155,11 +162,6 @@ export default function ApplicationLayout({
</div>
</nav>

{/* Thread List */}
<div className="flex-1 overflow-y-auto">
<ThreadList setLeftPanelOpen={setLeftPanelOpen} />
</div>

{/* Sign Out Button */}
<div className="flex-none p-2">
<button
Expand All @@ -175,7 +177,6 @@ export default function ApplicationLayout({

{/* Main Content */}
<main className="flex-1 min-w-0 relative">
<div id="step1"></div>
<ScrollArea className="h-screen w-full">{children}</ScrollArea>
</main>

Expand Down
Loading