Skip to content

Commit

Permalink
chore: refactor to embrace dom typographical elements (#1144)
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Hopper-Lowe <[email protected]>
  • Loading branch information
ryanhopperlowe authored Jan 7, 2025
1 parent 4ef2c5f commit ce837ac
Show file tree
Hide file tree
Showing 48 changed files with 241 additions and 475 deletions.
29 changes: 0 additions & 29 deletions ui/admin/app/components/TruncatedText.tsx

This file was deleted.

208 changes: 0 additions & 208 deletions ui/admin/app/components/Typography.tsx

This file was deleted.

19 changes: 9 additions & 10 deletions ui/admin/app/components/agent/Agent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { AssistantNamespace } from "~/lib/model/assistants";
import { AgentService } from "~/lib/service/api/agentService";
import { cn } from "~/lib/utils";

import { TypographyH4, TypographyP } from "~/components/Typography";
import { useAgent } from "~/components/agent/AgentContext";
import { AgentForm } from "~/components/agent/AgentForm";
import { AgentPublishStatus } from "~/components/agent/AgentPublishStatus";
Expand Down Expand Up @@ -111,10 +110,10 @@ export function Agent({ className, currentThreadId, onRefresh }: AgentProps) {
</div>

<div className="p-4 m-4 space-y-4 lg:mx-6 xl:mx-8">
<TypographyH4 className="flex items-center gap-2 border-b pb-2">
<h4 className="flex items-center gap-2 border-b pb-2">
<WrenchIcon className="w-5 h-5" />
Tools
</TypographyH4>
</h4>

<CardDescription>
Add tools the allow the agent to perform useful actions
Expand All @@ -132,10 +131,10 @@ export function Agent({ className, currentThreadId, onRefresh }: AgentProps) {
</div>

<div className="p-4 m-4 space-y-4 lg:mx-6 xl:mx-8">
<TypographyH4 className="flex items-center gap-2 border-b pb-2">
<h4 className="flex items-center gap-2 border-b pb-2">
<VariableIcon className="w-5 h-5" />
Environment Variables
</TypographyH4>
</h4>

<EnvironmentVariableSection
entity={agent}
Expand All @@ -145,10 +144,10 @@ export function Agent({ className, currentThreadId, onRefresh }: AgentProps) {
</div>

<div className="p-4 m-4 space-y-4 lg:mx-6 xl:mx-8">
<TypographyH4 className="flex items-center gap-2 border-b pb-2">
<h4 className="flex items-center gap-2 border-b pb-2">
<LibraryIcon className="w-6 h-6" />
Knowledge
</TypographyH4>
</h4>
<CardDescription>
Provide knowledge to the agent in the form of files,
website, or external links in order to give it context
Expand All @@ -172,11 +171,11 @@ export function Agent({ className, currentThreadId, onRefresh }: AgentProps) {
<footer className="flex justify-between items-center px-8 py-4 gap-4 shadow-inner">
<div className="text-muted-foreground">
{error ? (
<TypographyP>Error saving agent</TypographyP>
<p>Error saving agent</p>
) : isUpdating ? (
<TypographyP>Saving...</TypographyP>
<p>Saving...</p>
) : lastUpdated ? (
<TypographyP>Saved</TypographyP>
<p>Saved</p>
) : (
<div />
)}
Expand Down
5 changes: 2 additions & 3 deletions ui/admin/app/components/agent/AgentForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { z } from "zod";
import { ModelUsage } from "~/lib/model/models";
import { ModelApiService } from "~/lib/service/api/modelApiService";

import { TypographyH4 } from "~/components/Typography";
import { ComboBox } from "~/components/composed/ComboBox";
import {
ControlledAutosizeTextarea,
Expand Down Expand Up @@ -101,10 +100,10 @@ export function AgentForm({ agent, onSubmit, onChange }: AgentFormProps) {
className="text-xl text-muted-foreground"
/>

<TypographyH4 className="flex items-center gap-2">
<h4 className="flex items-center gap-2">
<BrainIcon className="w-5 h-5" />
Instructions
</TypographyH4>
</h4>

<ControlledAutosizeTextarea
control={form.control}
Expand Down
7 changes: 3 additions & 4 deletions ui/admin/app/components/agent/AgentPublishStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { Agent } from "~/lib/model/agents";
import { ConsumptionUrl } from "~/lib/routers/baseRouter";
import { AssistantApiService } from "~/lib/service/api/assistantApiService";

import { TypographySmall } from "~/components/Typography";
import { AgentDropdownActions } from "~/components/agent/AgentDropdownActions";
import { Publish } from "~/components/agent/Publish";
import { Unpublish } from "~/components/agent/Unpublish";
Expand Down Expand Up @@ -73,10 +72,10 @@ export function AgentPublishStatus({
<div className="flex flex-col gap-1 h-full">
<div className="flex items-center gap-2">
<div className="size-2 bg-warning rounded-full" />
<TypographySmall>Unavailable</TypographySmall>
<small>Unavailable</small>
</div>

<TypographySmall className="pb-0 text-muted-foreground">
<small className="pb-0 text-muted-foreground">
<span className="min-w-fit">
Ref name <b>{refAssistant.id}</b> used by{" "}
</span>
Expand All @@ -86,7 +85,7 @@ export function AgentPublishStatus({
>
{refAssistant.name}
</Link>
</TypographySmall>
</small>
</div>
);
}
Expand Down
9 changes: 4 additions & 5 deletions ui/admin/app/components/agent/PastThreads.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import useSWR from "swr";
import { Thread } from "~/lib/model/threads";
import { ThreadsService } from "~/lib/service/api/threadsService";

import { TypographyP } from "~/components/Typography";
import { LoadingSpinner } from "~/components/ui/LoadingSpinner";
import { Button } from "~/components/ui/button";
import {
Expand Down Expand Up @@ -98,17 +97,17 @@ export const PastThreads: React.FC<PastThreadsProps> = ({
>
<div className="flex items-center justify-between w-full">
<div>
<TypographyP className="font-semibold">
<p className="font-semibold">
Thread
<span className="ml-2 text-muted-foreground">
{thread.id}
</span>
</TypographyP>
<TypographyP className="text-sm text-gray-500">
</p>
<p className="text-sm text-gray-500">
{new Date(
thread.created
).toLocaleString()}
</TypographyP>
</p>
</div>
<div>
{currentThreadId &&
Expand Down
Loading

0 comments on commit ce837ac

Please sign in to comment.