Skip to content

Commit 7359159

Browse files
authored
Merge pull request #863 from trycompai/claudio/ui-tweaks-2
[dev] [claudfuen] claudio/ui-tweaks-2
2 parents b513919 + 22e72ef commit 7359159

21 files changed

Lines changed: 205 additions & 263 deletions

File tree

apps/app/src/app/(app)/[orgId]/controls/[controlId]/components/RequirementsTable.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ interface RequirementsTableProps {
4141
title={"Name"}
4242
/>
4343
),
44+
4445
cell: ({ row }) => {
4546
return (
46-
<span>
47+
<span className="line-clamp-2 truncate max-w-[600px] h-10 text-wrap">
4748
{row.original.requirement.name}
4849
</span>
4950
);
@@ -67,7 +68,7 @@ interface RequirementsTableProps {
6768
),
6869
cell: ({ row }) => {
6970
return (
70-
<span className="text-muted-foreground">
71+
<span className="line-clamp-2 truncate max-w-[600px] h-10 text-wrap">
7172
{row.original.requirement.description}
7273
</span>
7374
);

apps/app/src/app/(app)/[orgId]/frameworks/[frameworkInstanceId]/components/FrameworkRequirements.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export function FrameworkRequirements({
5252
<DataTableColumnHeader column={column} title={"Name"} />
5353
),
5454
cell: ({ row }) => (
55-
<span className="capitalize line-clamp-1">
55+
<span className="line-clamp-2 truncate max-w-[300px]">
5656
{row.original.name}
5757
</span>
5858
),
@@ -76,7 +76,7 @@ export function FrameworkRequirements({
7676
/>
7777
),
7878
cell: ({ row }) => (
79-
<span className="capitalize line-clamp-1">
79+
<span className="line-clamp-2 truncate max-w-[300px]">
8080
{row.original.description}
8181
</span>
8282
),

apps/app/src/app/(app)/[orgId]/frameworks/[frameworkInstanceId]/requirements/[requirementKey]/components/RequirementControls.tsx

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

33
import type { FrameworkEditorRequirement } from "@comp/db/types";
4-
import { Card, CardContent, CardHeader, CardTitle } from "@comp/ui/card";
5-
import { FrameworkInstanceWithControls } from "../../../../types";
4+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@comp/ui/card";
65
import { RequirementControlsTable } from "./table/RequirementControlsTable";
76
import type { Control, RequirementMap, Task } from "@comp/db/types";
87

@@ -21,30 +20,14 @@ export function RequirementControls({
2120
<div className="space-y-6">
2221
<Card>
2322
<CardHeader>
24-
<CardTitle className="flex items-center justify-between">
25-
<div>
26-
<span className="text-sm text-muted-foreground">
27-
{"Requirement"}
28-
</span>
29-
<h1 className="text-2xl font-semibold">
30-
{requirement.name}
31-
</h1>
32-
</div>
33-
</CardTitle>
23+
<CardTitle>{requirement.name}</CardTitle>
24+
<CardDescription>{requirement.description}</CardDescription>
3425
</CardHeader>
35-
<CardContent>
36-
<p className="text-sm text-muted-foreground">
37-
{requirement.description}
38-
</p>
39-
</CardContent>
4026
</Card>
4127

4228
<Card>
4329
<CardHeader>
44-
<CardTitle>
45-
{"Controls"} (
46-
{relatedControls.length})
47-
</CardTitle>
30+
<CardTitle>Controls ({relatedControls.length})</CardTitle>
4831
</CardHeader>
4932
<CardContent>
5033
<RequirementControlsTable

apps/app/src/app/(app)/[orgId]/frameworks/[frameworkInstanceId]/requirements/[requirementKey]/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ export default async function RequirementPage({ params }: PageProps) {
9393

9494
console.log("relatedControls", relatedControls);
9595

96+
const maxLabelLength = 40;
97+
9698
return (
9799
<PageWithBreadcrumb
98100
breadcrumbs={[
@@ -102,7 +104,7 @@ export default async function RequirementPage({ params }: PageProps) {
102104
href: `/${organizationId}/frameworks/${frameworkInstanceId}`,
103105
},
104106
{
105-
label: currentRequirementDetails.name,
107+
label: currentRequirementDetails.name.length > maxLabelLength ? `${currentRequirementDetails.name.slice(0, maxLabelLength)}...` : currentRequirementDetails.name,
106108
dropdown: siblingRequirementsDropdown,
107109
current: true,
108110
},

apps/app/src/app/(app)/[orgId]/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default async function Layout({
6262
)}
6363
<Header />
6464
<div
65-
className="px-4 mx-auto py-4"
65+
className="px-4 mx-auto py-4 textured-background"
6666
style={{ minHeight: `calc(100vh - ${pixelsOffset}px)` }}
6767
>
6868
{children}

apps/app/src/app/(app)/[orgId]/policies/(overview)/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default async function PoliciesOverview() {
1212

1313
return (
1414
<Suspense fallback={<Loading />}>
15-
<div className="space-y-4 sm:space-y-8">
15+
<div className="space-y-4 sm:space-y-8 py-4">
1616
<div className="grid grid-cols-1 gap-4 lg:grid-cols-2">
1717
<PolicyStatusChart data={overview} />
1818
<PolicyAssigneeChart data={overview?.assigneeData} />

apps/app/src/app/(app)/[orgId]/policies/[policyId]/layout.tsx

Lines changed: 0 additions & 29 deletions
This file was deleted.

apps/app/src/app/(app)/[orgId]/policies/all/layout.tsx

Lines changed: 0 additions & 29 deletions
This file was deleted.

apps/app/src/app/(app)/[orgId]/policies/(overview)/layout.tsx renamed to apps/app/src/app/(app)/[orgId]/policies/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default async function Layout({ children, params }: LayoutProps) {
99
const { orgId } = await params;
1010

1111
return (
12-
<div className="max-w-[1200px] m-auto flex flex-col gap-4">
12+
<div className="max-w-[1200px] m-auto flex flex-col">
1313
<SecondaryMenu
1414
items={[
1515
{

apps/app/src/components/ai/chat-button.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,20 @@ import { cn } from "@comp/ui/cn";
66
import { useQueryState } from "nuqs";
77

88
export function AssistantButton() {
9-
const isDesktop = useMediaQuery("(min-width: 768px)");
9+
1010
const [, setAssistantOpen] = useQueryState("assistant", {
1111
history: "push",
1212
parse: (value) => value === "true",
1313
serialize: (value) => value.toString(),
1414
});
1515

16-
if (!isDesktop) {
17-
return null;
18-
}
19-
2016
return (
2117
<Button
2218
variant="ghost"
2319
size="default"
24-
// className={cn(
25-
// "relative w-full max-w-sm justify-start text-muted-foreground",
26-
// "hover:bg-accent hover:text-accent-foreground"
27-
// )}
2820
onClick={() => setAssistantOpen(true)}
2921
>
30-
<span className="truncate">Ask Comp AI a question...</span>
22+
<span className="truncate">Ask a question...</span>
3123
<kbd className="ml-auto flex h-5 items-center gap-1 rounded-sm border bg-muted px-1.5 font-mono text-[10px] font-medium">
3224
<span className="text-xs"></span>K
3325
</kbd>

0 commit comments

Comments
 (0)