Skip to content

Commit

Permalink
Update agent avatar upload UI
Browse files Browse the repository at this point in the history
The agent avatar upload UI is updated to display a plus icon whenever there is no avatar selected. Additionally, a typo in the function name 'togleDataSourceDialog' has been corrected to 'toggleDataSourceDialog'.
  • Loading branch information
mikepsinn committed Jul 12, 2024
1 parent 72f85bd commit a21efe2
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 248 deletions.
43 changes: 23 additions & 20 deletions components/agents/agent-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
AlertDialogTitle,
} from "@/components/ui/alert-dialog"
import LoadingSpinner from "@/components/LoadingSpinner";
import {PlusIcon} from "lucide-react";

type FormData = z.infer<typeof agentSchema>

Expand Down Expand Up @@ -80,7 +81,7 @@ export default function AgentForm({
})

const navigateBack = () => {
router.refresh();
router.refresh();
router.back()
}

Expand Down Expand Up @@ -150,7 +151,7 @@ export default function AgentForm({
setLoading(false)
}
}

const deleteDatasource=(e:React.MouseEvent<HTMLButtonElement>)=>{
e.preventDefault()
startRemoveTransition(async () => {
Expand All @@ -174,11 +175,11 @@ export default function AgentForm({
})
}

const togleDataSourceDialog=()=>{
const toggleDataSourceDialog=()=>{
setDsDialogOpen(prev=>!prev);
}



useEffect(() => {
if (fields.length === 0) {
Expand All @@ -190,7 +191,7 @@ export default function AgentForm({

return (
<>
<AddAgentDataSource open={dsDialogOpen} agentId={agentData?.id} dataSource={dataSource} setDataSource={setDataSource} onClose={togleDataSourceDialog}/>
<AddAgentDataSource open={dsDialogOpen} agentId={agentData?.id} dataSource={dataSource} setDataSource={setDataSource} onClose={toggleDataSourceDialog}/>
<div
className={`mx-auto flex h-screen ${isSidebarOpen ? "lg:ml-[270px] lg:w-[calc(100%-270px)]" : "w-full lg:w-[96%]"}`}
>
Expand All @@ -213,20 +214,22 @@ export default function AgentForm({
<div className="space-y-4">
<div className="space-y-2">
<div className="relative mx-auto h-20 w-20 overflow-hidden rounded-full border border-gray-400 p-1">
<Input
type="file"
onChange={handleUpload}
className="absolute z-10 h-full w-full opacity-0"
accept="image/png, image/gif, image/jpeg"
/>
{avatar && (
<img
className="h-full w-full"
src={avatar}
alt="Agent avatar"
/>
)}
</div>
<Input
type="file"
onChange={handleUpload}
className="absolute z-10 h-full w-full opacity-0"
accept="image/png, image/gif, image/jpeg"
/>
{avatar ? (
<img
className="h-full w-full"
src={avatar}
alt="Agent avatar"
/>
) : (
<PlusIcon className="h-full w-full" />
)}
</div>
</div>
<div className="space-y-2">
<Label htmlFor="name" className="text-sm font-medium">
Expand Down Expand Up @@ -304,7 +307,7 @@ export default function AgentForm({
>
Datasource
<PlusCircle
onClick={togleDataSourceDialog}
onClick={toggleDataSourceDialog}
className="ml-2 h-7 w-7 cursor-pointer rounded-full p-1 shadow-md active:shadow-none focus:ring"
/>
</Label>
Expand Down
6 changes: 3 additions & 3 deletions components/agents/agent-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ export default function AgentList() {
<div
className={`mx-auto h-screen scroll-m-1 overflow-auto p-2 pt-8 md:p-8 xl:max-w-[1000px] ${isSidebarOpen ? "lg:ml-[270px] lg:w-[calc(100%-270px)]" : "w-full lg:w-[96%]"}`}
>
<h1 className="mb-6 text-3xl font-semibold">My Agents</h1>
<h1 className="mb-6 text-3xl font-semibold">My Positron Agents</h1>
<Link href="/agents/new">
<div className="flex w-full items-center space-x-4 rounded-sm p-4 hover:bg-secondary">
<div>
<PlusIcon className="h-8 w-8 rounded-full bg-black p-2 text-white dark:bg-white dark:text-black" />
</div>
<div>
<div className="font-semibold">Create a Agent</div>
<div className="font-semibold">Create a Positron Agent</div>
<div className="text-[#BBBBBB]">
Create a pro-social Positron agent to improve the world.
Create a pro-social AI agent to improve the world.
</div>
</div>
</div>
Expand Down
79 changes: 0 additions & 79 deletions public/docs/data-models.md

This file was deleted.

36 changes: 36 additions & 0 deletions public/docs/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Wishonia FAQ

## Q: Why not just focus on smaller focused goals?

By limiting its scope to small organizations, it would not be able to prevent duplication of effort on a global scale.

Research has shown that the quality of decisions made by groups is proportional to the diversity of the group. By focusing on a global scale, Wishocracy can tap into the wisdom of the crowd to make better decisions than any one person or small group of people could make.

This requires a decentralized protocol that can integrate with any existing system rather than a standalone system.

## Q: What's the benefit of a global todo list?

1. **Preventing Waste** - Minimizing duplicated effort by surfacing what problems/wishes people are already working on solving. This allows resources to be allocated more efficiently. Governments and charitable foundations spend billions on solving important problems, but lack of coordination often leads to significant duplication of effort. For instance, if two research organizations each spend $1 million doing animal trials on the same drug, that's effectively $1 million of funding wasted and lots of extra animals suffering for no reason.

2. **Coordination and Cost-Sharing** -
By decomposing solutions into atomic tasks
that anyone can contribute to, it enables cost-sharing between organizations that need the same thing.
This would enable all organizations to accomplish more with the same amount of resources.

3. **Helping People Maximize Their Impact** - Say you're a charitable individual who wants to improve the world. How can you figure out what the most important thing you can do A global decentralized to do list could help charitable people find the highest impact tasks to work on given their skills and resources.

4. **Iterative Improvement through Impact Tracking** - Iteratively improving allocation of resources over time by feeding impact data back into the prioritization process.

## Q: Even if we had a global to-do list, we need every organization to use it for it to be useful. How will we make it so that every organization decides to use it?

Widespread adoption of a global to-do list could be achieved by:

1. **Demonstrating Cost Savings**: Even if only two organizations use it, it could theoretically cut their costs in half by reducing duplication of efforts.

2. **Providing Competitive Advantage**: For businesses, ["coopetition"](https://en.wikipedia.org/wiki/Coopetition) would be a competitive advantage, as it increases efficiency and access to resources.

3. **Multiplying Nonprofit Impact**: For nonprofits, it would multiply the impact of donations, attracting donors who want to maximize the effectiveness of their contributions.

4. **Autonomous Agents**: As AI frontier models improve in reasoning, autonomous agents can take on more tasks, further reducing costs and increasing efficiency.

5. **Ensuring Easy Integration**: Seamless integration with existing tools and workflows will minimize adoption friction.
146 changes: 0 additions & 146 deletions public/docs/functional-components/security-and-privacy-framework.md

This file was deleted.

0 comments on commit a21efe2

Please sign in to comment.