Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions packages/graph-explorer/src/components/Group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const groupVariants = cva({
variants: {
variant: {
default: "border-border divide-border",
danger: "border-danger-foreground/25 divide-danger-foreground/25",
success: "border-success-foreground/25 divide-success-foreground/25",
warning: "border-warning-foreground/25 divide-warning-foreground/25",
},
Expand Down Expand Up @@ -38,7 +37,7 @@ function GroupHeader({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
className={cn(
"bg-neutral-subtle/50 text-text-secondary group-data-[variant=danger]/group:bg-danger-subtle/50 group-data-[variant=danger]/group:text-danger group-data-[variant=success]/group:bg-success-subtle/50 group-data-[variant=success]/group:text-success-main group-data-[variant=warning]/group:bg-warning-subtle/50 group-data-[variant=warning]/group:text-warning-main flex items-center gap-2 px-5 py-3 group-data-[size=small]/group:px-3 group-data-[size=small]/group:py-2",
"bg-neutral-subtle/50 text-text-secondary group-data-[variant=success]/group:bg-success-subtle/50 group-data-[variant=success]/group:text-success-main group-data-[variant=warning]/group:bg-warning-subtle/50 group-data-[variant=warning]/group:text-warning-main flex items-center gap-2 px-5 py-3 group-data-[size=small]/group:px-3 group-data-[size=small]/group:py-2",
className,
)}
{...props}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export default function LoadStylesButton() {
>
<Button className="min-w-28" disabled={isPending}>
<UploadIcon />
Load from File
Load
</Button>
</FileButton>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ export default function ResetCustomStylesButton() {
return (
<AlertDialog>
<AlertDialogTrigger asChild>
<Button variant="danger" className="min-w-28">
<Button
variant="danger"
className="min-w-28"
aria-label="Reset your styles"
>
<Trash2Icon />
Reset Your Styles
Reset
</Button>
</AlertDialogTrigger>
<AlertDialogContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ export default function ResetSharedStylesButton() {
return (
<AlertDialog>
<AlertDialogTrigger asChild>
<Button variant="danger" className="min-w-28">
<Button
variant="danger"
className="min-w-28"
aria-label="Reset shared styles"
>
<Trash2Icon />
Reset Shared Styles
Reset
</Button>
</AlertDialogTrigger>
<AlertDialogContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function renderButton() {
}

function saveButton() {
return screen.getByRole("button", { name: "Save to File" });
return screen.getByRole("button", { name: "Save" });
}

describe("SaveStylesButton", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default function SaveStylesButton() {
disabled={isPending}
>
<DownloadIcon />
Save to File
Save
</Button>
<AlertDialog
open={state.kind !== "closed"}
Expand Down
36 changes: 16 additions & 20 deletions packages/graph-explorer/src/routes/Settings/SettingsStyles.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { useAtomValue } from "jotai";
import { SwatchBookIcon, TriangleAlertIcon } from "lucide-react";
import { SwatchBookIcon } from "lucide-react";

import {
Group,
GroupHeader,
GroupItem,
GroupMedia,
GroupTitle,
LabelledSetting,
SettingsPageDescription,
Expand Down Expand Up @@ -43,7 +42,7 @@ export default function SettingsStyles() {

<Group>
<GroupHeader>
<GroupTitle>Style Sharing</GroupTitle>
<GroupTitle>Manage Your Styles</GroupTitle>
</GroupHeader>
<GroupItem>
<LabelledSetting
Expand All @@ -53,34 +52,31 @@ export default function SettingsStyles() {
<SaveStylesButton />
</LabelledSetting>
</GroupItem>
<GroupItem className="space-y-2">
<GroupItem>
<LabelledSetting
label="Load shared styles"
description="Load styles from a file into your shared styles. New types are added and matching ones are replaced; your own styles are left untouched."
label="Reset your styles"
description="Clear the styles you've set yourself. Shared styles remain."
>
<LoadStylesButton />
<ResetCustomStylesButton />
</LabelledSetting>
<SharedStylesStatus
vertexCount={sharedVertexStyles.size}
edgeCount={sharedEdgeStyles.size}
/>
</GroupItem>
</Group>

<Group variant="danger">
<Group>
<GroupHeader>
<GroupMedia>
<TriangleAlertIcon />
</GroupMedia>
<GroupTitle>Danger Zone</GroupTitle>
<GroupTitle>Manage Shared Styles</GroupTitle>
</GroupHeader>
<GroupItem>
<GroupItem className="space-y-2">
<LabelledSetting
label="Reset your styles"
description="Clear the styles you've set yourself. Shared styles remain."
label="Load shared styles"
description="Load styles from a file into your shared styles. New types are added and matching ones are replaced; your own styles are left untouched."
>
<ResetCustomStylesButton />
<LoadStylesButton />
</LabelledSetting>
<SharedStylesStatus
vertexCount={sharedVertexStyles.size}
edgeCount={sharedEdgeStyles.size}
/>
</GroupItem>
<GroupItem>
<LabelledSetting
Expand Down
Loading