Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,13 @@ export function RuleCell({
status,
reason,
message,
isTest,
setInput,
}: {
emailAccountId: string;
rule: PendingExecutedRules["executedRules"][number]["rule"];
status: ExecutedRuleStatus;
reason?: string | null;
message: ParsedMessage;
isTest: boolean;
setInput: SetInputFunction;
}) {
const { createAssistantUrl } = useAssistantNavigation(emailAccountId);
Expand Down Expand Up @@ -106,6 +104,7 @@ export function RuleCell({
href={createAssistantUrl({
tab: "rule",
ruleId: rule.id,
path: `/assistant/rule/${rule.id}`,
})}
>
View
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,13 @@ export function FixWithChat({
setInput(input);
} else {
// redirect to the assistant page
router.push(createAssistantUrl({ input, tab: "history" }));
router.push(
createAssistantUrl({
input,
tab: "history",
path: "/assistant?tab=history",
}),
);
}

setIsModalOpen(false);
Expand Down
1 change: 0 additions & 1 deletion apps/web/app/(app)/[emailAccountId]/assistant/History.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ function HistoryTable({
status={p.status}
reason={p.reason}
message={p.message}
isTest={false}
setInput={setInput}
/>
{/* <ActionItemsCell actionItems={p.actionItems} /> */}
Expand Down
1 change: 0 additions & 1 deletion apps/web/app/(app)/[emailAccountId]/assistant/Pending.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ function PendingTable({
status={p.status}
reason={p.reason}
message={p.message}
isTest={true}
setInput={setInput}
/>
</TableCell>
Expand Down
19 changes: 5 additions & 14 deletions apps/web/app/(app)/[emailAccountId]/assistant/Rules.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
Trash2Icon,
ToggleRightIcon,
ToggleLeftIcon,
SlidersIcon,
} from "lucide-react";
import { useMemo } from "react";
import { LoadingContent } from "@/components/LoadingContent";
Expand All @@ -36,10 +35,7 @@ import {
TableHeader,
TableRow,
} from "@/components/ui/table";
import {
setRuleRunOnThreadsAction,
setRuleEnabledAction,
} from "@/utils/actions/ai-rule";
import { setRuleEnabledAction } from "@/utils/actions/ai-rule";
import { deleteRuleAction } from "@/utils/actions/rule";
import { conditionsToString } from "@/utils/condition";
import { Badge } from "@/components/Badge";
Expand Down Expand Up @@ -202,6 +198,7 @@ export function Rules({ size = "md" }: { size?: "sm" | "md" }) {
: createAssistantUrl({
tab: "rule",
ruleId: rule.id,
path: `/assistant/rule/${rule.id}`,
});

return (
Expand Down Expand Up @@ -300,6 +297,7 @@ export function Rules({ size = "md" }: { size?: "sm" | "md" }) {
: createAssistantUrl({
tab: "history",
ruleId: rule.id,
path: "/assistant?tab=history",
})
}
target={
Expand Down Expand Up @@ -404,19 +402,12 @@ export function Rules({ size = "md" }: { size?: "sm" | "md" }) {

{hasRules && (
<div className="my-2 flex justify-end gap-2">
{/* <Button asChild variant="outline">
<Link href={prefixPath(emailAccountId, "/assistant?tab=prompt")}>
<Button asChild variant="outline">
<Link href={prefixPath(emailAccountId, "/automation?tab=prompt")}>
<PenIcon className="mr-2 hidden size-4 md:block" />
Add Rule via Prompt
</Link>
</Button> */}
<Button asChild variant="outline">
<Link href={prefixPath(emailAccountId, "/assistant/onboarding")}>
<SlidersIcon className="mr-2 hidden size-4 md:block" />
View Setup
</Link>
</Button>

<Button asChild variant="outline">
<Link href={prefixPath(emailAccountId, "/assistant/rule/create")}>
<PlusIcon className="mr-2 hidden size-4 md:block" />
Expand Down
11 changes: 10 additions & 1 deletion apps/web/app/(app)/[emailAccountId]/automation/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Suspense } from "react";
import { cookies } from "next/headers";
import Link from "next/link";
import { redirect } from "next/navigation";
import { MessageCircleIcon } from "lucide-react";
import { MessageCircleIcon, SlidersIcon } from "lucide-react";
import prisma from "@/utils/prisma";
import { History } from "@/app/(app)/[emailAccountId]/assistant/History";
import { Pending } from "@/app/(app)/[emailAccountId]/assistant/Pending";
Expand Down Expand Up @@ -88,6 +88,15 @@ export default async function AutomationPage({
</div>

<div className="flex items-center gap-2">
<Button asChild variant="outline" size="sm">
<Link
href={prefixPath(emailAccountId, "/assistant/onboarding")}
>
<SlidersIcon className="mr-2 hidden size-4 md:block" />
View Setup
</Link>
</Button>

<OnboardingModal
title="Getting started with AI Personal Assistant"
description={
Expand Down
11 changes: 5 additions & 6 deletions apps/web/hooks/useAssistantNavigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ export function useAssistantNavigation(emailAccountId: string) {
(params: {
tab?: string;
ruleId?: string;
[key: string]: string | undefined;
path: `/${string}`;
input?: string;
// [key: string]: string | undefined;
}) => {
if (isOnAssistantPage) {
// If we're on the assistant page, use current search params as base to preserve existing params
Expand All @@ -34,11 +36,8 @@ export function useAssistantNavigation(emailAccountId: string) {
`/assistant${assistantSearchParamsSerializer(searchParams, params)}`,
);
} else {
// If we're not on the assistant page, just use the new params
return prefixPath(
emailAccountId,
`/assistant${assistantSearchParamsSerializer(params)}`,
);
// If we're not on the assistant page, just use the set path
return prefixPath(emailAccountId, params.path);
}
},
[emailAccountId, isOnAssistantPage, searchParams],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"prettier-plugin-tailwindcss": "0.6.11",
"turbo": "2.5.3"
},
"packageManager": "pnpm@10.8.1+sha512.c50088ba998c67b8ca8c99df8a5e02fd2ae2e2b29aaf238feaa9e124248d3f48f9fb6db2424949ff901cffbb5e0f0cc1ad6aedb602cd29450751d11c35023677",
"packageManager": "pnpm@10.11.0",
"lint-staged": {
"*.{ts,tsx,md}": "prettier --write"
},
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.2.22
v1.2.23