Skip to content
Open
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
Empty file added .codex
Empty file.
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@docsearch/css": "^3.1.0",
"@docsearch/react": "^3.1.0",
"@types/node": "^18.0.0",
"@types/react": "^17.0.45",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"astro": "^1.4.2",
"preact": "^10.7.3",
Expand Down
10 changes: 5 additions & 5 deletions apps/docs/src/pages/en/website/blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ You will also see the newly added link on the header itself.
3. Click on the pencil icon against the newly added link to edit it as shown above.
4. Change the label (displayed as text on the header block) and the URL (where the user should be taken upon clicking the label on the header) and click `Done` to save.
![Header edit link](/assets/pages/header-edit-link.png)
</details>
</details>

### [Rich Text](#rich-text)

Expand Down Expand Up @@ -69,7 +69,7 @@ The rich text block uses the same text editor available elsewhere on the platfor
2. Click on the floating `link` icon to reveal a text input.
3. In the popup text input, enter the URL as shown below and press <kbd>Enter</kbd>.
![Create a hyperlink in rich text block](/assets/pages/courselit-text-editor-create-links.gif)
</details>
</details>

### [Hero](#hero)

Expand All @@ -95,7 +95,7 @@ Following is how it looks on a page.
4. In the button action, enter the URL the user should be taken to upon clicking.
a. If the URL is from your own school, use its relative form, i.e., `/courses`.
b. If the URL is from some external website, use the absolute (complete) URL, i.e., `https://website.com/courses`.
</details>
</details>

### [Grid](#grid)

Expand Down Expand Up @@ -140,7 +140,7 @@ A grid block comes in handy when you want to show some sort of list, for example
4. In the button action, enter the URL the user should be taken to upon clicking.
a. If the URL is from your own school, use its relative form, i.e., `/courses`.
b. If the URL is from some external website, use the absolute (complete) URL, i.e., `https://website.com/courses`.
</details>
</details>

### [Featured](#featured)

Expand Down Expand Up @@ -322,7 +322,7 @@ In the `Design` panel, you can customize:
- Maximum width
- Vertical padding
- Social media links (Facebook, Twitter, Instagram, LinkedIn, YouTube, Discord, GitHub)
</details>
</details>

## [Shared blocks](#shared-blocks)

Expand Down
36 changes: 18 additions & 18 deletions apps/docs/src/pages/en/website/themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,30 +192,30 @@ The typography editor lets you customize text styles across your website. These
- Header 3: Smaller titles for subsections
- Header 4: Small titles for minor sections
- Preheader: Introductory text that appears above headers
</details>
</details>

<details>
<summary>Subheaders</summary>

- Subheader 1: Primary subheaders for section introductions
- Subheader 2: Secondary subheaders for supporting text
</details>
</details>

<details>
<summary>Body Text</summary>

- Text 1: Main body text for content
- Text 2: Secondary body text for supporting content
- Caption: Small text for image captions and footnotes
</details>
</details>

<details>
<summary>Interactive Elements</summary>

- Link: Text for clickable links
- Button: Text for buttons and calls-to-action
- Input: Text for form fields and search boxes
</details>
</details>

For each text style, you can customize:

Expand Down Expand Up @@ -243,7 +243,7 @@ CourseLit provides a carefully curated selection of professional fonts, organize
- **Mulish**: A geometric sans-serif with a modern feel
- **Nunito**: A well-balanced font with rounded terminals
- **Work Sans**: A clean, modern font with a geometric feel
</details>
</details>

<details>
<summary>Serif Fonts</summary>
Expand All @@ -253,7 +253,7 @@ CourseLit provides a carefully curated selection of professional fonts, organize
- **Playfair Display**: An elegant serif font for headings
- **Roboto Slab**: A serif variant of Roboto
- **Source Serif 4**: A serif font designed for digital reading
</details>
</details>

<details>
<summary>Display Fonts</summary>
Expand All @@ -264,15 +264,15 @@ CourseLit provides a carefully curated selection of professional fonts, organize
- **Rubik**: A sans-serif with a geometric feel
- **Oswald**: A reworking of the classic style
- **Bebas Neue**: A display font with a strong personality
</details>
</details>

<details>
<summary>Modern Fonts</summary>

- **Lato**: A sans-serif font with a warm feel
- **PT Sans**: A font designed for public use
- **Quicksand**: A display sans-serif with rounded terminals
</details>
</details>

Each font is optimized for web use and includes multiple weights for flexibility in design. All fonts support Latin characters and are carefully selected for their readability and professional appearance.

Expand All @@ -290,7 +290,7 @@ The interactives editor allows you to customize the appearance of interactive el
- Shadow effects: From None to 2X Large
- Custom styles: Add your own custom styles using [supported Tailwind classes](#supported-tailwind-classes)
- Disabled state: How the button looks when it can't be clicked
</details>
</details>

<details>
<summary>Link</summary>
Expand All @@ -300,7 +300,7 @@ The interactives editor allows you to customize the appearance of interactive el
- Text shadow: Add depth to your links
- Custom styles: Add your own custom styles using [supported Tailwind classes](#supported-tailwind-classes)
- Disabled state: How the link looks when it can't be clicked
</details>
</details>

<details>
<summary>Card</summary>
Expand All @@ -309,7 +309,7 @@ The interactives editor allows you to customize the appearance of interactive el
- Border style: Choose from various border styles
- Shadow effects: Add depth to your cards
- Custom styles: Add your own custom styles using [supported Tailwind classes](#supported-tailwind-classes)
</details>
</details>

<details>
<summary>Input</summary>
Expand All @@ -320,7 +320,7 @@ The interactives editor allows you to customize the appearance of interactive el
- Shadow effects: Add depth to your input fields
- Custom styles: Add your own custom styles using [supported Tailwind classes](#supported-tailwind-classes)
- Disabled state: How the input looks when it can't be used
</details>
</details>

### 4. Structure

Expand All @@ -332,14 +332,14 @@ The structure editor lets you customize the layout of your pages, like section p
<summary>Page</summary>

- Maximum width options: - 2XL (42rem): Compact layout - 3XL (48rem): Standard layout - 4XL (56rem): Wide layout - 5XL (64rem): Extra wide layout - 6XL (72rem): Full width layout
</details>
</details>

<details>
<summary>Section</summary>

- Horizontal padding: Space on the left and right sides (None to 9X Large)
- Vertical padding: Space on the top and bottom (None to 9X Large)
</details>
</details>

## Publishing Changes

Expand Down Expand Up @@ -387,7 +387,7 @@ When adding custom styles to interactive elements, you can use the following Tai
- `text-6xl`: 6X large text
- `text-7xl`: 7X large text
- `text-8xl`: 8X large text
</details>
</details>

<details>
<summary>Padding</summary>
Expand All @@ -399,7 +399,7 @@ When adding custom styles to interactive elements, you can use the following Tai
#### Horizontal Padding

- `px-4` to `px-20`: Horizontal padding from 1rem to 5rem
</details>
</details>

<details>
<summary>Colors</summary>
Expand Down Expand Up @@ -454,7 +454,7 @@ Variants available: `hover`, `disabled`, `dark`
- `ease-out`: Ease out
- `ease-in-out`: Ease in and out
- `ease-linear`: Linear
</details>
</details>

<details>
<summary>Transforms</summary>
Expand All @@ -481,7 +481,7 @@ Variants available: `hover`, `disabled`, `dark`
- `scale-110`: 110% scale
- `scale-125`: 125% scale
- `scale-150`: 150% scale
</details>
</details>

<details>
<summary>Shadows</summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ export default function LoginForm({
await getUserProfile(address.backend),
);
}
} catch (err) {
console.error("Error during requestCode:", err);
toast({
title: TOAST_TITLE_ERROR,
description: "An unexpected error occurred. Please try again.",
variant: "destructive",
});
} finally {
setLoading(false);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
"use client";

import { EmailTemplate, SequenceType } from "@courselit/common-models";
import { useToast } from "@courselit/components-library";
import { AppState } from "@courselit/state-management";
import { networkAction } from "@courselit/state-management/dist/action-creators";
import { FetchBuilder } from "@courselit/utils";
import { TOAST_TITLE_ERROR } from "@ui-config/strings";
import { useEffect, useState } from "react";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { useRouter, useSearchParams } from "next/navigation";
import { ThunkDispatch } from "redux-thunk";
import { AnyAction } from "redux";
import { AddressContext } from "@components/contexts";
import { useContext } from "react";

interface NewMailPageClientProps {
systemTemplates: EmailTemplate[];
}

const NewMailPageClient = ({ systemTemplates }: NewMailPageClientProps) => {
const address = useContext(AddressContext);
const [templates, setTemplates] = useState<EmailTemplate[]>([]);
const [isLoading, setIsLoading] = useState(false);

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable isLoading.

Copilot Autofix

AI 7 days ago

To fix the problem, remove the unused isLoading state variable and its setter calls, since no rendering or logic depends on it. This avoids maintaining redundant state and eliminates the CodeQL warning.

Concretely, in apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx:

  1. Change the useState declaration on line 24 so that it no longer creates isLoading/setIsLoading. Since neither is used elsewhere, simply remove that line entirely.
  2. In loadTemplates, remove the calls to setIsLoading(true); (line 41) and setIsLoading(false); (line 78 or 79, depending on numbering after edits), as these will no longer be defined and serve no purpose.

No new methods, imports, or definitions are needed. Functionality is unchanged, because nothing depended on isLoading before.

Suggested changeset 1
apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx b/apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx
--- a/apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx
+++ b/apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx
@@ -21,7 +21,6 @@
 const NewMailPageClient = ({ systemTemplates }: NewMailPageClientProps) => {
     const address = useContext(AddressContext);
     const [templates, setTemplates] = useState<EmailTemplate[]>([]);
-    const [isLoading, setIsLoading] = useState(false);
     const { toast } = useToast();
     const router = useRouter();
     const searchParams = useSearchParams();
@@ -38,7 +37,6 @@
     }, []);
 
     const loadTemplates = async () => {
-        setIsLoading(true);
         const query = `
             query GetEmailTemplates {
                 templates: getEmailTemplates {
@@ -75,7 +73,6 @@
             });
         } finally {
             dispatch && dispatch(networkAction(false));
-            setIsLoading(false);
         }
     };
 
EOF
@@ -21,7 +21,6 @@
const NewMailPageClient = ({ systemTemplates }: NewMailPageClientProps) => {
const address = useContext(AddressContext);
const [templates, setTemplates] = useState<EmailTemplate[]>([]);
const [isLoading, setIsLoading] = useState(false);
const { toast } = useToast();
const router = useRouter();
const searchParams = useSearchParams();
@@ -38,7 +37,6 @@
}, []);

const loadTemplates = async () => {
setIsLoading(true);
const query = `
query GetEmailTemplates {
templates: getEmailTemplates {
@@ -75,7 +73,6 @@
});
} finally {
dispatch && dispatch(networkAction(false));
setIsLoading(false);
}
};

Copilot is powered by AI and may make mistakes. Always verify output.
const { toast } = useToast();
const router = useRouter();
const searchParams = useSearchParams();
const dispatch = () => {};

const type = searchParams?.get("type") as SequenceType;

const fetch = new FetchBuilder()
.setUrl(`${address.backend}/api/graph`)
.setIsGraphQLEndpoint(true);

useEffect(() => {
loadTemplates();
}, []);

const loadTemplates = async () => {
setIsLoading(true);
const query = `
query GetEmailTemplates {
templates: getEmailTemplates {
templateId
title
content {
content {
blockType
settings
}
style
meta
}
}
}`;

const fetcher = fetch
.setPayload({
query,
})
.build();

try {
dispatch && dispatch(networkAction(true));

Check warning

Code scanning / CodeQL

Superfluous trailing arguments Warning

Superfluous argument passed to
function dispatch
.

Copilot Autofix

AI 7 days ago

In general, to fix a “superfluous trailing arguments” issue, either remove the unused arguments or ensure the callee’s signature and implementation actually make use of them. In this case, the argument to dispatch is semantically important (it is an action from networkAction(true/false)), so the correct fix is to make dispatch accept and use that argument instead of being a no-op function.

Concretely, in apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx, replace the stub const dispatch = () => {}; with a proper Redux dispatch obtained from the store or from a hook. Since we already import AppState, ThunkDispatch, and AnyAction, the most minimal, functionality-preserving change within this file is to import useDispatch from react-redux and use it to get a correctly typed dispatch function:

  • Add import { useDispatch } from "react-redux"; alongside the other imports.
  • Change line 28 from const dispatch = () => {}; to:
const dispatch: ThunkDispatch<AppState, unknown, AnyAction> = useDispatch();

This way, dispatch(networkAction(true)) and dispatch(networkAction(false)) become meaningful calls to the Redux dispatch function, the argument is no longer superfluous, and existing behavior (intended network action toggling) is preserved rather than removed.

Suggested changeset 2
apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx b/apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx
--- a/apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx
+++ b/apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx
@@ -13,6 +13,7 @@
 import { AnyAction } from "redux";
 import { AddressContext } from "@components/contexts";
 import { useContext } from "react";
+import { useDispatch } from "react-redux";
 
 interface NewMailPageClientProps {
     systemTemplates: EmailTemplate[];
@@ -25,7 +26,7 @@
     const { toast } = useToast();
     const router = useRouter();
     const searchParams = useSearchParams();
-    const dispatch = () => {};
+    const dispatch: ThunkDispatch<AppState, unknown, AnyAction> = useDispatch();
 
     const type = searchParams?.get("type") as SequenceType;
 
EOF
@@ -13,6 +13,7 @@
import { AnyAction } from "redux";
import { AddressContext } from "@components/contexts";
import { useContext } from "react";
import { useDispatch } from "react-redux";

interface NewMailPageClientProps {
systemTemplates: EmailTemplate[];
@@ -25,7 +26,7 @@
const { toast } = useToast();
const router = useRouter();
const searchParams = useSearchParams();
const dispatch = () => {};
const dispatch: ThunkDispatch<AppState, unknown, AnyAction> = useDispatch();

const type = searchParams?.get("type") as SequenceType;

apps/web/package.json
Outside changed files

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/apps/web/package.json b/apps/web/package.json
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -102,7 +102,8 @@
         "tailwind-merge": "^2.5.4",
         "tailwindcss-animate": "^1.0.7",
         "xml2js": "^0.6.2",
-        "zod": "^3.24.1"
+        "zod": "^3.24.1",
+        "react-redux": "^9.2.0"
     },
     "devDependencies": {
         "@eslint/eslintrc": "^3.3.1",
EOF
@@ -102,7 +102,8 @@
"tailwind-merge": "^2.5.4",
"tailwindcss-animate": "^1.0.7",
"xml2js": "^0.6.2",
"zod": "^3.24.1"
"zod": "^3.24.1",
"react-redux": "^9.2.0"
},
"devDependencies": {
"@eslint/eslintrc": "^3.3.1",
This fix introduces these dependencies
Package Version Security advisories
react-redux (npm) 9.2.0 None
Copilot is powered by AI and may make mistakes. Always verify output.
const response = await fetcher.exec();
if (response.templates) {
setTemplates(response.templates);
}
} catch (e: any) {
toast({
title: TOAST_TITLE_ERROR,
description: e.message,
variant: "destructive",
});
} finally {
dispatch && dispatch(networkAction(false));

Check warning

Code scanning / CodeQL

Superfluous trailing arguments Warning

Superfluous argument passed to
function dispatch
.

Copilot Autofix

AI 7 days ago

In general, to fix superfluous trailing arguments, either (a) remove the extra arguments if they truly are not needed, or (b) update the function so it correctly accepts and uses those arguments. Here, calls like dispatch(networkAction(true)) are intended to dispatch Redux actions; the problem is that dispatch is currently a zero-argument no-op. Removing the argument would only hide the intent and keep the code from dispatching anything, so the correct fix is to replace the stub with a real dispatch that accepts an action argument.

The best fix with minimal functional change is to obtain a proper Redux dispatch from the Redux store using the useDispatch hook from react-redux, typed as ThunkDispatch<AppState, null, AnyAction> to match the existing imports. Then replace const dispatch = () => {}; with const dispatch = useDispatch<ThunkDispatch<AppState, null, AnyAction>>();. This makes dispatch a function that expects an action (or thunk) argument, so the existing calls with networkAction(true/false) become meaningful and no longer have superfluous arguments.

Concretely:

  • In apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx, add an import for useDispatch from react-redux alongside the other imports.
  • Replace the line const dispatch = () => {}; with a typed useDispatch call, e.g. const dispatch = useDispatch<ThunkDispatch<AppState, null, AnyAction>>();.
    No other changes are required in the shown snippet.
Suggested changeset 1
apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx b/apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx
--- a/apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx
+++ b/apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx
@@ -13,6 +13,7 @@
 import { AnyAction } from "redux";
 import { AddressContext } from "@components/contexts";
 import { useContext } from "react";
+import { useDispatch } from "react-redux";
 
 interface NewMailPageClientProps {
     systemTemplates: EmailTemplate[];
@@ -25,7 +26,7 @@
     const { toast } = useToast();
     const router = useRouter();
     const searchParams = useSearchParams();
-    const dispatch = () => {};
+    const dispatch = useDispatch<ThunkDispatch<AppState, null, AnyAction>>();
 
     const type = searchParams?.get("type") as SequenceType;
 
EOF
@@ -13,6 +13,7 @@
import { AnyAction } from "redux";
import { AddressContext } from "@components/contexts";
import { useContext } from "react";
import { useDispatch } from "react-redux";

interface NewMailPageClientProps {
systemTemplates: EmailTemplate[];
@@ -25,7 +26,7 @@
const { toast } = useToast();
const router = useRouter();
const searchParams = useSearchParams();
const dispatch = () => {};
const dispatch = useDispatch<ThunkDispatch<AppState, null, AnyAction>>();

const type = searchParams?.get("type") as SequenceType;

Copilot is powered by AI and may make mistakes. Always verify output.
setIsLoading(false);
}
};

const createSequence = async (template: EmailTemplate) => {
const mutation = `
mutation createSequence(
$type: SequenceType!,
$title: String!,
$content: String!
) {
sequence: createSequence(type: $type, title: $title, content: $content) {
sequenceId
}
}
`;
const fetch = new FetchBuilder()
.setUrl(`${address.backend}/api/graph`)
.setPayload({
query: mutation,
variables: {
type: type.toUpperCase(),
title: template.title,
content: JSON.stringify(template.content),
},
})
.setIsGraphQLEndpoint(true)
.build();
try {
dispatch &&
(dispatch as ThunkDispatch<AppState, null, AnyAction>)(
networkAction(true),

Check warning

Code scanning / CodeQL

Superfluous trailing arguments Warning

Superfluous argument passed to
function dispatch
.

Copilot Autofix

AI 7 days ago

To fix this, we should ensure that dispatch is actually a Redux Thunk dispatch function rather than a no-op. That way, calling dispatch(networkAction(true)) and dispatch(networkAction(false)) is both type-correct and functionally meaningful, and the argument to networkAction is no longer “superfluous” in practice.

Concretely, in apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx:

  1. Replace the placeholder const dispatch = () => {}; with a real dispatch obtained from the Redux store, using useDispatch from react-redux and typing it as ThunkDispatch<AppState, null, AnyAction>.
  2. Add the necessary import for useDispatch from react-redux.

This preserves the existing behavior intent (toggling network state before/after the async call) without changing other logic.

Suggested changeset 1
apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx b/apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx
--- a/apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx
+++ b/apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx
@@ -13,6 +13,7 @@
 import { AnyAction } from "redux";
 import { AddressContext } from "@components/contexts";
 import { useContext } from "react";
+import { useDispatch } from "react-redux";
 
 interface NewMailPageClientProps {
     systemTemplates: EmailTemplate[];
@@ -25,7 +26,7 @@
     const { toast } = useToast();
     const router = useRouter();
     const searchParams = useSearchParams();
-    const dispatch = () => {};
+    const dispatch = useDispatch<ThunkDispatch<AppState, null, AnyAction>>();
 
     const type = searchParams?.get("type") as SequenceType;
 
EOF
@@ -13,6 +13,7 @@
import { AnyAction } from "redux";
import { AddressContext } from "@components/contexts";
import { useContext } from "react";
import { useDispatch } from "react-redux";

interface NewMailPageClientProps {
systemTemplates: EmailTemplate[];
@@ -25,7 +26,7 @@
const { toast } = useToast();
const router = useRouter();
const searchParams = useSearchParams();
const dispatch = () => {};
const dispatch = useDispatch<ThunkDispatch<AppState, null, AnyAction>>();

const type = searchParams?.get("type") as SequenceType;

Copilot is powered by AI and may make mistakes. Always verify output.
);
const response = await fetch.exec();
if (response.sequence && response.sequence.sequenceId) {
router.push(
`/dashboard/mails/${type}/${response.sequence.sequenceId}`,
);
}
} catch (err) {
toast({
title: TOAST_TITLE_ERROR,
description: err.message,
variant: "destructive",
});
} finally {
dispatch &&
(dispatch as ThunkDispatch<AppState, null, AnyAction>)(
networkAction(false),

Check warning

Code scanning / CodeQL

Superfluous trailing arguments Warning

Superfluous argument passed to
function dispatch
.

Copilot Autofix

AI 7 days ago

In general, to fix “superfluous trailing arguments” you either (a) remove the unused arguments from the call site, or (b) update the function so it actually accepts and uses those arguments. Here, dispatch is clearly intended to receive actions created by networkAction, matching Redux usage already present elsewhere in the codebase (as suggested by the imports from @courselit/state-management and use of ThunkDispatch). Removing the arguments would hide the underlying bug (that network actions are never dispatched). The best fix is to replace the dummy dispatch implementation with a proper one retrieved from Redux.

Concretely, in apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx, replace const dispatch = () => {}; with a typed Redux dispatch from useDispatch (from react-redux), using the existing ThunkDispatch<AppState, null, AnyAction> type. This way, dispatch(networkAction(true)) and dispatch(networkAction(false)) become valid calls whose argument is actually consumed, eliminating the “superfluous argument” condition and restoring the intended behavior. To implement this, add an import for useDispatch from react-redux, then define const dispatch: ThunkDispatch<AppState, null, AnyAction> = useDispatch(); (or similar) in place of the stub. No other call sites need to change.

Suggested changeset 2
apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx b/apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx
--- a/apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx
+++ b/apps/web/app/(with-contexts)/dashboard/mails/new/new-mail-page-client.tsx
@@ -13,6 +13,7 @@
 import { AnyAction } from "redux";
 import { AddressContext } from "@components/contexts";
 import { useContext } from "react";
+import { useDispatch } from "react-redux";
 
 interface NewMailPageClientProps {
     systemTemplates: EmailTemplate[];
@@ -25,7 +26,7 @@
     const { toast } = useToast();
     const router = useRouter();
     const searchParams = useSearchParams();
-    const dispatch = () => {};
+    const dispatch: ThunkDispatch<AppState, null, AnyAction> = useDispatch();
 
     const type = searchParams?.get("type") as SequenceType;
 
EOF
@@ -13,6 +13,7 @@
import { AnyAction } from "redux";
import { AddressContext } from "@components/contexts";
import { useContext } from "react";
import { useDispatch } from "react-redux";

interface NewMailPageClientProps {
systemTemplates: EmailTemplate[];
@@ -25,7 +26,7 @@
const { toast } = useToast();
const router = useRouter();
const searchParams = useSearchParams();
const dispatch = () => {};
const dispatch: ThunkDispatch<AppState, null, AnyAction> = useDispatch();

const type = searchParams?.get("type") as SequenceType;

apps/web/package.json
Outside changed files

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/apps/web/package.json b/apps/web/package.json
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -102,7 +102,8 @@
         "tailwind-merge": "^2.5.4",
         "tailwindcss-animate": "^1.0.7",
         "xml2js": "^0.6.2",
-        "zod": "^3.24.1"
+        "zod": "^3.24.1",
+        "react-redux": "^9.2.0"
     },
     "devDependencies": {
         "@eslint/eslintrc": "^3.3.1",
EOF
@@ -102,7 +102,8 @@
"tailwind-merge": "^2.5.4",
"tailwindcss-animate": "^1.0.7",
"xml2js": "^0.6.2",
"zod": "^3.24.1"
"zod": "^3.24.1",
"react-redux": "^9.2.0"
},
"devDependencies": {
"@eslint/eslintrc": "^3.3.1",
This fix introduces these dependencies
Package Version Security advisories
react-redux (npm) 9.2.0 None
Copilot is powered by AI and may make mistakes. Always verify output.
);
}
};

const onTemplateClick = (template: EmailTemplate) => {
createSequence(template);
};

return (
<div className="p-8">
<h1 className="text-4xl font-semibold mb-8">Choose a template</h1>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
{[...systemTemplates, ...templates].map((template) => (
<Card
key={template.templateId}
className="cursor-pointer hover:shadow-lg transition-shadow"
onClick={() => onTemplateClick(template)}
>
<CardHeader>
<CardTitle>{template.title}</CardTitle>
</CardHeader>
<CardContent>
<div className="h-48 bg-gray-200 flex items-center justify-center">
<p className="text-gray-500">Preview</p>
</div>
</CardContent>
</Card>
))}
</div>
</div>
);
};

export default NewMailPageClient;
Loading
Loading