Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
118 changes: 118 additions & 0 deletions .github/workflows/nextjs_bundle_analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

name: 'Next.js Bundle Analysis'

on:
pull_request:
push:
branches:
- main # change this if your default branch is named differently
workflow_dispatch:

defaults:
run:
# change this if your nextjs app does not live at the root of the repo
working-directory: ./

permissions:
contents: read # for checkout repository
actions: read # for fetching base branch bundle stats
pull-requests: write # for comments

jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Update GitHub Actions to supported major versions (actionlint)
The workflow uses older action majors flagged by actionlint. Upgrade to current majors compatible with hosted runners.

Apply:

-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
...
-      - name: Restore next build
-        uses: actions/cache@v3
+      - name: Restore next build
+        uses: actions/cache@v4
...
-      - name: Download base branch bundle stats
-        uses: dawidd6/action-download-artifact@v2
+      - name: Download base branch bundle stats
+        uses: dawidd6/action-download-artifact@v6

Also applies to: 36-36, 63-63

🧰 Tools
🪛 actionlint (1.7.7)

27-27: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
In .github/workflows/nextjs_bundle_analysis.yml at lines 27, 36, and 63, the
GitHub Actions use older major versions flagged by actionlint. Update the action
versions to their latest supported major versions compatible with hosted runners
by changing the version tags (e.g., from v2 to v3 or the latest stable major)
for all actions used at these lines.


- name: Install Bun
uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: bun install

Comment on lines +32 to +34
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Make dependency installation reproducible in CI
Use Bun’s lockfile-enforced mode to avoid drift across runs.

-      - name: Install dependencies
-        run: bun install
+      - name: Install dependencies
+        run: bun install --frozen-lockfile --no-progress

Optional: cache Bun’s global package data to speed up installs. I can add that if desired.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Install dependencies
run: bun install
- name: Install dependencies
run: bun install --frozen-lockfile --no-progress
🤖 Prompt for AI Agents
In .github/workflows/nextjs_bundle_analysis.yml at lines 32 to 34, the
dependency installation step uses "bun install" without enforcing the lockfile,
which can cause non-reproducible installs. Modify the command to "bun install
--frozen-lockfile" to ensure the lockfile is strictly respected during
installation. Optionally, consider adding caching for Bun’s global package data
to speed up subsequent installs.

- name: Restore next build
uses: actions/cache@v3
id: restore-build-cache
env:
cache-name: cache-next-build
with:
# if you use a custom build directory, replace all instances of `.next` in this file with your build directory
# ex: if your app builds to `dist`, replace `.next` with `dist`
path: .next/cache
# change this if you prefer a more strict cache
key: ${{ runner.os }}-build-${{ env.cache-name }}

Comment on lines +35 to +46
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Harden Next.js build cache key to prevent stale caches
Current key is constant, risking incorrect cache hits. Include lockfile hash and os.

       - name: Restore next build
         uses: actions/cache@v4
         id: restore-build-cache
         env:
           cache-name: cache-next-build
         with:
           # if you use a custom build directory, replace all instances of `.next` in this file with your build directory
           # ex: if your app builds to `dist`, replace `.next` with `dist`
           path: .next/cache
           # change this if you prefer a more strict cache
-          key: ${{ runner.os }}-build-${{ env.cache-name }}
+          key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/bun.lockb', '**/package-lock.json', '**/pnpm-lock.yaml', '**/yarn.lock') }}
+          restore-keys: |
+            ${{ runner.os }}-${{ env.cache-name }}-
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Restore next build
uses: actions/cache@v3
id: restore-build-cache
env:
cache-name: cache-next-build
with:
# if you use a custom build directory, replace all instances of `.next` in this file with your build directory
# ex: if your app builds to `dist`, replace `.next` with `dist`
path: .next/cache
# change this if you prefer a more strict cache
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Restore next build
uses: actions/cache@v4
id: restore-build-cache
env:
cache-name: cache-next-build
with:
# if you use a custom build directory, replace all instances of `.next` in this file with your build directory
# ex: if your app builds to `dist`, replace `.next` with `dist`
path: .next/cache
# change this if you prefer a more strict cache
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/bun.lockb', '**/package-lock.json', '**/pnpm-lock.yaml', '**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-
🧰 Tools
🪛 actionlint (1.7.7)

36-36: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
In .github/workflows/nextjs_bundle_analysis.yml around lines 35 to 46, the cache
key for restoring the Next.js build is too generic and can cause stale cache
hits. Update the cache key to include a hash of the lockfile (e.g.,
package-lock.json or yarn.lock) and the runner OS to ensure the cache is
invalidated when dependencies change. This will make the cache key unique per
dependency state and OS, preventing incorrect cache usage.

- name: Build next.js app
# change this if your site requires a custom build command
run: bun run build

# Here's the first place where next-bundle-analysis' own script is used
# This step pulls the raw bundle stats for the current bundle
- name: Analyze bundle
run: bunx -p nextjs-bundle-analysis report

Comment on lines +54 to +55
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Pin nextjs-bundle-analysis tool version for deterministic results
Ephemeral bunx pulls latest, which can change behaviour. Pin the version (or add as devDependency).

-        run: bunx -p nextjs-bundle-analysis report
+        run: bunx -p nextjs-bundle-analysis@0.7.0 report

Same for compare below.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
run: bunx -p nextjs-bundle-analysis report
run: bunx -p nextjs-bundle-analysis@0.7.0 report
🤖 Prompt for AI Agents
In .github/workflows/nextjs_bundle_analysis.yml at lines 54-55, the command uses
bunx to run nextjs-bundle-analysis without specifying a version, causing
non-deterministic results due to ephemeral latest pulls. Fix this by pinning the
nextjs-bundle-analysis tool version explicitly in the command or by adding it as
a devDependency in package.json and referencing that fixed version in the
workflow. Apply the same version pinning approach to the compare command
mentioned below in the file.

- name: Upload bundle
uses: actions/upload-artifact@v3
with:
name: bundle
path: .next/analyze/__bundle_analysis.json

- name: Download base branch bundle stats
uses: dawidd6/action-download-artifact@v2
if: success() && github.event.number
with:
workflow: nextjs_bundle_analysis.yml
branch: ${{ github.event.pull_request.base.ref }}
path: .next/analyze/base

# And here's the second place - this runs after we have both the current and
# base branch bundle stats, and will compare them to determine what changed.
# There are two configurable arguments that come from package.json:
#
# - budget: optional, set a budget (bytes) against which size changes are measured
# it's set to 350kb here by default, as informed by the following piece:
# https://infrequently.org/2021/03/the-performance-inequality-gap/
#
# - red-status-percentage: sets the percent size increase where you get a red
# status indicator, defaults to 20%
#
# Either of these arguments can be changed or removed by editing the `nextBundleAnalysis`
# entry in your package.json file.
- name: Compare with base branch bundle
if: success() && github.event.number
run: ls -laR .next/analyze/base && bunx -p nextjs-bundle-analysis compare

- name: Get Comment Body
id: get-comment-body
if: success() && github.event.number
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
run: |
echo "body<<EOF" >> $GITHUB_OUTPUT
echo "$(cat .next/analyze/__bundle_analysis_comment.txt)" >> $GITHUB_OUTPUT
echo EOF >> $GITHUB_OUTPUT

- name: Find Comment
uses: peter-evans/find-comment@v2
if: success() && github.event.number
id: fc
with:
issue-number: ${{ github.event.number }}
body-includes: '<!-- __NEXTJS_BUNDLE -->'

- name: Create Comment
uses: peter-evans/create-or-update-comment@v2
if: success() && github.event.number && steps.fc.outputs.comment-id == 0
with:
issue-number: ${{ github.event.number }}
body: ${{ steps.get-comment-body.outputs.body }}

- name: Update Comment
uses: peter-evans/create-or-update-comment@v2
if: success() && github.event.number && steps.fc.outputs.comment-id != 0
with:
issue-number: ${{ github.event.number }}
body: ${{ steps.get-comment-body.outputs.body }}
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace
506 changes: 326 additions & 180 deletions bun.lock

Large diffs are not rendered by default.

22 changes: 14 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
"format": "ultracite format"
},
"dependencies": {
"@ai-sdk/anthropic": "^1.2.12",
"@ai-sdk/google": "^1.2.19",
"@ai-sdk/groq": "^1.2.9",
"@ai-sdk/openai": "^1.3.22",
"@ai-sdk/react": "^1.2.12",
"@ai-sdk/anthropic": "^2.0.1",
"@ai-sdk/google": "^1.2.22",
"@ai-sdk/groq": "^2.0.4",
"@ai-sdk/openai": "^1.3.24",
"@ai-sdk/react": "^2.0.9",
"@ai-sdk/ui-utils": "^1.2.11",
"@ai-sdk/xai": "^1.2.16",
"@ai-sdk/xai": "^1.2.18",
"@aws-sdk/client-s3": "^3.826.0",
"@biomejs/biome": "2.0.6",
"@logto/next": "^4.2.4",
Expand All @@ -26,7 +26,7 @@
"@radix-ui/react-label": "^2.1.7",
"@radix-ui/react-separator": "^1.1.7",
"@radix-ui/react-slot": "^1.2.3",
"ai": "^4.3.16",
"ai": "^4.3.19",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"daisyui": "^5.0.43",
Expand All @@ -47,7 +47,7 @@
"sonner": "^2.0.5",
"tailwind-merge": "^3.3.0",
"tailwind-variants": "^1.0.0",
"zod": "^3.25.56"
"zod": "^3.25.76"
},
"devDependencies": {
"@tailwindcss/postcss": "^4.1.8",
Expand All @@ -59,5 +59,11 @@
"tw-animate-css": "^1.3.4",
"typescript": "^5",
"ultracite": "5.0.32"
},
"nextBundleAnalysis": {
"budget": null,
"budgetPercentIncreaseRed": 20,
"minimumChangeThreshold": 0,
"showDetails": true
}
Comment on lines +65 to 70
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Confirm nextjs-bundle-analysis config keys; avoid budget: null if unsupported

Ensure the tool reads these exact keys from package.json. If budget is optional, omit it rather than setting to null to prevent parsing issues.

Please check the tool’s expected package.json schema:

If budget should be omitted, apply:

   "nextBundleAnalysis": {
-    "budget": null,
     "budgetPercentIncreaseRed": 20,
     "minimumChangeThreshold": 0,
     "showDetails": true
   }

🌐 Web query:

What configuration keys does "nextjs-bundle-analysis" read from package.json, and are "budgetPercentIncreaseRed", "minimumChangeThreshold", and "showDetails" valid? Should "budget" be omitted or set to null?

💡 Result:

The "nextjs-bundle-analysis" GitHub Action reads configuration from the "nextBundleAnalysis" key in your project's package.json[1]. It accepts only specific configuration keys, and their validity is determined by the documented options. Based on available documentation, here are the answers to your key questions:

Supported package.json Configuration Keys

The action specifically mentions the following keys under "nextBundleAnalysis"[1]:

  • showDetails (boolean): Valid; controls whether detailed sections are rendered in the bundle analysis comment (default: true)[1].
  • buildOutputDirectory (string): Valid; for specifying the custom Next.js build output directory. Default is .next[1].

Validity of Specific Keys

Key Valid Notes
showDetails Yes Directly documented as an option controlling UI detail[1].
budgetPercentIncreaseRed No Not mentioned or documented as a supported key[1].
minimumChangeThreshold No Not mentioned or documented as a supported key[1].

No current documentation supports budgetPercentIncreaseRed or minimumChangeThreshold as valid configuration keys for "nextjs-bundle-analysis" in package.json[1]. If these are present, they may be ignored or unsupported by the tool.

Handling the budget Key

The documentation refers only to performance budgets in general but does not specify a budget property in the package.json configuration section[1]. The workflow might contain details relating to budgets, but there is no mention that setting "budget": null in package.json is required or supported. If a budget key is present without clear documentation, it's safest to omit it rather than set it to null[1].

Summary

  • You should only include well-documented keys (showDetails, buildOutputDirectory) in "nextBundleAnalysis" within package.json[1].
  • The keys budgetPercentIncreaseRed, minimumChangeThreshold, and a plain budget key are not valid according to current GitHub and npm documentation[1]. They should be omitted unless updated documentation specifically adds support.
  • Use "showDetails" for controlling display detail, and "buildOutputDirectory" to set your build output location[1].

If you need advanced budgeting features, you may need to configure these within the GitHub workflow file itself, not in the package.json[1].

Citations:


Update unsupported nextBundleAnalysis keys in package.json

Only the documented options (showDetails and buildOutputDirectory) are read from nextBundleAnalysis. Remove the unsupported keys (budget, budgetPercentIncreaseRed, minimumChangeThreshold) to avoid them being ignored or causing parsing issues.

• In package.json under "nextBundleAnalysis":
– Keep: showDetails (boolean)
– Optionally add: buildOutputDirectory (string, default: .next)
– Remove: budget, budgetPercentIncreaseRed, minimumChangeThreshold

Suggested diff:

 "nextBundleAnalysis": {
-  "budget": null,
-  "budgetPercentIncreaseRed": 20,
-  "minimumChangeThreshold": 0,
   "showDetails": true
 }

If you require performance budgets, configure them within your GitHub workflow rather than in the package.json.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"nextBundleAnalysis": {
"budget": null,
"budgetPercentIncreaseRed": 20,
"minimumChangeThreshold": 0,
"showDetails": true
}
"nextBundleAnalysis": {
"showDetails": true
}
🤖 Prompt for AI Agents
In package.json lines 63 to 68, the nextBundleAnalysis section contains
unsupported keys budget, budgetPercentIncreaseRed, and minimumChangeThreshold
that should be removed because only showDetails and buildOutputDirectory are
valid. Remove these unsupported keys and optionally add buildOutputDirectory if
needed, keeping showDetails as is. This will prevent parsing issues and ensure
only recognized options are present.

}
4 changes: 1 addition & 3 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
]
"extends": ["config:recommended"]
}
111 changes: 100 additions & 11 deletions src/app/(chat)/template.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
import { getLogtoContext } from '@logto/next/server-actions';
import Link from 'next/link';
import { redirect } from 'next/navigation';
import type * as React from 'react';
import type { ReactNode } from 'react';
import {
SidebarInset,
SidebarProvider,
SidebarTrigger,
} from '@/components/animate-ui/radix/sidebar';
LuImage as ImageIcon,
LuBot,
LuFile,
LuHouse,
LuLogOut,
LuMenu,
LuMessageCircle,
LuMessageSquareHeart,
LuSettings,
LuShare,
} from 'react-icons/lu';
import KawaiiLogo from '@/assets/img/mikan-vtube.svg';
import { ChatSidebar } from '@/components/sidebar';
import { logtoConfig } from '@/lib/auth';
import { prisma } from '@/lib/prisma';

export default async function ChatLayout({
children,
}: {
children: React.ReactNode;
children: ReactNode;
}) {
const { claims } = await getLogtoContext(logtoConfig);

Expand Down Expand Up @@ -53,10 +62,90 @@ export default async function ChatLayout({
};

return (
<SidebarProvider>
<ChatSidebar data={data} />
<SidebarTrigger className={'mt-3 ml-3 hover:bg-secondary'} />
<SidebarInset>{children}</SidebarInset>
</SidebarProvider>
<>
<div className="drawer">
<input className="drawer-toggle" id="my-drawer-3" type="checkbox" />
<div className="drawer-content flex flex-col">
<div className="navbar sticky top-0 z-40 w-full bg-base-300">
<div className="flex-none">
<label
aria-label="open sidebar"
className="btn btn-square btn-ghost"
htmlFor="my-drawer-3"
>
<LuMenu className="inline-block h-6 w-6" />
</label>
</div>
<div className="mx-2 flex-1 px-2">
<a className="flex space-x-3 font-bold text-xl normal-case">
<img
alt="MikanDev Logo"
className="mr-3 h-8 w-auto"
src={KawaiiLogo.src}
/>
Chat
</a>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The <a> tag is used here but doesn't have an href attribute, making it non-functional as a link and semantically incorrect. Since this element appears to be a title/branding element and not a link, using a <div> would be more appropriate for semantic HTML.

              <div className="flex space-x-3 font-bold text-xl normal-case">
                <img
                  alt="MikanDev Logo"
                  className="mr-3 h-8 w-auto"
                  src={KawaiiLogo.src}
                />
                Chat
              </div>

</div>
<div className="hidden flex-none lg:block">
<ul className="menu menu-horizontal">
<Link href={'/settings/models'}>
<button className={'btn btn-ghost'}>
<LuBot className="inline-block h-6 w-6" />
Models
</button>
</Link>
<Link href={'/settings/files'}>
<button className={'btn btn-ghost'}>
<LuFile className="inline-block h-6 w-6" />
Files
</button>
</Link>
<Link href={'/settings/shared'}>
<button className={'btn btn-ghost'}>
<LuShare className="inline-block h-6 w-6" />
Shared chats
</button>
</Link>
<Link href={'/logout'} prefetch={false}>
<button className={'btn btn-ghost'}>
<LuLogOut className="inline-block h-6 w-6" />
Logout
</button>
</Link>
</ul>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The <ul> element has <Link> components as its direct children, which is invalid HTML. <ul> elements should only contain <li> elements as direct children. This can cause issues with accessibility and rendering. Additionally, wrapping a <button> inside a <Link> is an anti-pattern. The <Link> component can be styled directly to look like a button.

              <ul className="menu menu-horizontal">
                <li>
                  <Link href={'/settings/models'} className={'btn btn-ghost'}>
                    <LuBot className="inline-block h-6 w-6" />
                    Models
                  </Link>
                </li>
                <li>
                  <Link href={'/settings/files'} className={'btn btn-ghost'}>
                    <LuFile className="inline-block h-6 w-6" />
                    Files
                  </Link>
                </li>
                <li>
                  <Link href={'/settings/shared'} className={'btn btn-ghost'}>
                    <LuShare className="inline-block h-6 w-6" />
                    Shared chats
                  </Link>
                </li>
                <li>
                  <Link href={'/logout'} prefetch={false} className={'btn btn-ghost'}>
                    <LuLogOut className="inline-block h-6 w-6" />
                    Logout
                  </Link>
                </li>
              </ul>

</div>
</div>
{children}
</div>
<div className="drawer-side z-60">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Invalid Tailwind class z-60

Tailwind defaults don’t include z-60. Use z-50 or an arbitrary value z-[60].

-        <div className="drawer-side z-60">
+        <div className="drawer-side z-50">
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div className="drawer-side z-60">
<div className="drawer-side z-50">
🤖 Prompt for AI Agents
In src/app/(chat)/template.tsx at line 120, the Tailwind class `z-60` is invalid
because Tailwind's default scale does not include `z-60`. Replace `z-60` with
either the closest valid default class `z-50` or use an arbitrary value syntax
like `z-[60]` to apply the desired z-index.

<label
aria-label="close sidebar"
className="drawer-overlay"
htmlFor="my-drawer-3"
/>
<ul className="menu flex min-h-screen w-80 flex-col bg-base-200 p-4">
<ChatSidebar data={data} />
<div className="card mt-auto shadow-xl">
<div className="card-body">
<div className="flex items-center">
<div className="avatar">
<div className="w-12 rounded-full">
<img
alt={data.user.name}
src={data.user.avatar || '/default-avatar.png'}
/>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The <img> tag for the user avatar is missing width and height attributes. This can lead to Cumulative Layout Shift (CLS) as the browser has to reflow the page once the image is loaded. It's a best practice to always include these attributes to improve performance and user experience.

                      <img
                        alt={data.user.name}
                        src={data.user.avatar || '/default-avatar.png'}
                        width={48}
                        height={48}
                      />

</div>
</div>
<div className="ml-3">
<h2 className="card-title">{data.user.name}</h2>
<p className="text-gray-500 text-sm">UID {data.user.id}</p>
</div>
</div>
</div>
</div>
</ul>
</div>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

⚠️ Potential issue

Invalid

    children: ChatSidebar renders a
    , not
  • Your outer <ul> has a direct child <ChatSidebar/> which renders a <div>. That’s invalid HTML and breaks accessibility. Wrap with a non-list container and let ChatSidebar own its list.

    -          <ul className="menu flex min-h-screen w-80 flex-col bg-base-200 p-4">
    -            <ChatSidebar data={data} />
    -            <div className="card mt-auto shadow-xl">
    +          <div className="flex min-h-screen w-80 flex-col bg-base-200 p-4">
    +            <ChatSidebar data={data} />
    +            <div className="card mt-auto shadow-xl">
                   <div className="card-body">
                     <div className="flex items-center">
                       <div className="avatar">
                         <div className="w-12 rounded-full">
                           <img
                             alt={data.user.name}
                             src={data.user.avatar || '/default-avatar.png'}
                           />
                         </div>
                       </div>
                       <div className="ml-3">
                         <h2 className="card-title">{data.user.name}</h2>
                         <p className="text-gray-500 text-sm">UID {data.user.id}</p>
                       </div>
                     </div>
                   </div>
                 </div>
    -          </ul>
    +          </div>
    📝 Committable suggestion

    ‼️ IMPORTANT
    Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

    Suggested change
    <ul className="menu flex min-h-screen w-80 flex-col bg-base-200 p-4">
    <ChatSidebar data={data} />
    <div className="card mt-auto shadow-xl">
    <div className="card-body">
    <div className="flex items-center">
    <div className="avatar">
    <div className="w-12 rounded-full">
    <img
    alt={data.user.name}
    src={data.user.avatar || '/default-avatar.png'}
    />
    </div>
    </div>
    <div className="ml-3">
    <h2 className="card-title">{data.user.name}</h2>
    <p className="text-gray-500 text-sm">UID {data.user.id}</p>
    </div>
    </div>
    </div>
    </div>
    </ul>
    </div>
    <div className="flex min-h-screen w-80 flex-col bg-base-200 p-4">
    <ChatSidebar data={data} />
    <div className="card mt-auto shadow-xl">
    <div className="card-body">
    <div className="flex items-center">
    <div className="avatar">
    <div className="w-12 rounded-full">
    <img
    alt={data.user.name}
    src={data.user.avatar || '/default-avatar.png'}
    />
    </div>
    </div>
    <div className="ml-3">
    <h2 className="card-title">{data.user.name}</h2>
    <p className="text-gray-500 text-sm">UID {data.user.id}</p>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    🤖 Prompt for AI Agents
    In src/app/(chat)/template.tsx around lines 126 to 147, the <ul> element has a
    direct child <ChatSidebar> component that renders a <div>, which is invalid HTML
    because <ul> should only have <li> children. To fix this, replace the outer <ul>
    with a non-list container element like a <div> or <nav> that can contain
    <ChatSidebar> and other div elements, and ensure that ChatSidebar manages its
    own list structure internally.
    

</div>
</>
);
}
11 changes: 1 addition & 10 deletions src/app/(public)/template.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
import type * as React from 'react';
import {
SidebarInset,
SidebarProvider,
SidebarTrigger,
} from '@/components/animate-ui/radix/sidebar';

export default async function ShareLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<SidebarProvider>
<SidebarInset>{children}</SidebarInset>
</SidebarProvider>
);
return <>{children}</>;
}
41 changes: 0 additions & 41 deletions src/app/(settings)/template.tsx

This file was deleted.

Loading
Loading