Skip to content

Comments

Demo beetle#17

Open
AkshataSolapurkar wants to merge 5 commits intoJobflow-AI:mainfrom
AkshataSolapurkar:demo-beetle
Open

Demo beetle#17
AkshataSolapurkar wants to merge 5 commits intoJobflow-AI:mainfrom
AkshataSolapurkar:demo-beetle

Conversation

@AkshataSolapurkar
Copy link
Collaborator

No description provided.

@Jobflow-AI Jobflow-AI deleted a comment from beetle-ai bot Jan 2, 2026
@shivang-16
Copy link
Member

@beetle-ai review

@beetle-ai
Copy link

beetle-ai bot commented Jan 2, 2026

Summary by Beetle

This pull request introduces significant new features and UI enhancements to the application. The core improvements include full chat management functionality (fetch, rename, delete) in the sidebar and a new job scraping feature on the dashboard. Additionally, the user interface has been polished with a new reusable GlowButton component and decorative visual effects on the hero section.

📁 File Changes Summary (Consolidated across all commits):

File Status Changes Description
src/actions/chat_actions.ts Modified +89/-2 Added new functions (deleteById, renameChatById, fetchChats) to handle API requests for deleting, renaming, and fetching user chats from the backend.
src/app/(root)/(chat)/_components/heroSection.tsx Modified +77/-13 Enhanced the hero section's visual appeal by adding a decorative "green glow" effect and replacing the previous suggestion buttons with the new, more stylish GlowButton component.
src/app/(root)/(chat)/_components/sidebar.tsx Modified +167/-15 Overhauled the sidebar from a static component to a fully dynamic and interactive chat management panel. It now fetches chats from the API and allows users to search, rename, and delete them.
src/app/(root)/dashboard/_components/Dashboard.tsx Modified +41/-1 Added a "Scrape & Create Jobs" button and corresponding logic to the dashboard, allowing users to trigger a job scraping process and refresh the job list.
src/app/globals.css Modified +29/-0 Added global CSS for a new .glow-effect to support the GlowButton and applied a smooth transition effect to all buttons and links for better UX.
src/components/ui/glowButton.tsx Added +49/-0 A new reusable GlowButton component was created to provide a stylized button with gradient and glow effects, enhancing the overall UI consistency and appeal.
tailwind.config.ts Modified +27/-19 Updated the Tailwind CSS configuration to include new glow theme colors and removed an unused slide-in-right animation as part of a minor cleanup.

Total Changes: 7 files changed, +479 additions, -68 deletions

🗺️ Walkthrough:

sequenceDiagram
participant User
participant Sidebar Component
participant API Actions
participant Backend API
Note over Sidebar Component: Initial component load
Sidebar Component->>API Actions: fetchChats()
API Actions->>Backend API: GET /api/chat/all
Backend API-->>API Actions: Returns list of chats
API Actions-->>Sidebar Component: Provides chat data
Sidebar Component->>User: Displays the fetched chat list
Note over User, Sidebar Component: User renames a chat
User->>Sidebar Component: Clicks rename icon on a chat
Sidebar Component->>Sidebar Component: Enters edit mode, shows input field
User->>Sidebar Component: Types new name and saves
Sidebar Component->>API Actions: renameChatById(chatId, newName)
API Actions->>Backend API: PUT /api/chat/rename
Backend API-->>API Actions: Returns success confirmation
API Actions-->>Sidebar Component: Success response
Sidebar Component->>User: Updates chat name in the UI
Note over User, Sidebar Component: User deletes a chat
User->>Sidebar Component: Clicks delete icon on a chat
User->>Sidebar Component: Confirms deletion action
Sidebar Component->>API Actions: deleteById('/api/chat/delete?id=...')
API Actions->>Backend API: DELETE /api/chat/delete
Backend API-->>API Actions: Returns success confirmation
API Actions-->>Sidebar Component: Success response
Sidebar Component->>User: Removes chat from the UI list
Loading

🎯 Key Changes:

  • Full Chat Management: The sidebar is now a dynamic component that allows users to fetch, search, rename, and delete their chats, with API integration and toast notifications for feedback.
  • Job Scraping Feature: A new "Scrape & Create Jobs" button has been added to the dashboard, enabling users to trigger a backend process to find and add new job listings.
  • New GlowButton Component: A reusable and visually appealing GlowButton has been created and implemented in the hero section to improve the UI.
  • UI & Visual Enhancements: The hero section now features a subtle "green glow" effect for a more modern look, and global styles have been added for smoother transitions on interactive elements.
  • API Actions Expansion: The chat_actions.ts file has been significantly expanded with new functions to support the chat management features, centralizing API logic.
⚙️ Settings

Severity Threshold: Medium — Balanced feedback — medium and high severity issues only.Change in Settings
Custom Rules: Define your own review rules — Set Custom Rules
PR Summary: Configure PR summary — Change in Settings

📖 User Guide
  • Once repos are connected, PR analysis is automatically enabled. You can disable analysis for this repo from beetleai.dev/analysis
  • Comment @beetle-ai review on any PR to start analysis manually
  • Comment @beetle-ai stop to stop any ongoing analysis

Follow us: Beetle · X · LinkedIn

Comment on lines +59 to +60
const data = await response.json();
return data;
Copy link

Choose a reason for hiding this comment

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

The function may incorrectly throw an error on a successful deletion. A DELETE request can successfully complete with a 204 No Content status code, which means the response body will be empty. Attempting to call response.json() on an empty body will cause a JSON parsing error, making the function throw even though the operation succeeded on the backend.

Confidence: 5/5

Suggested Fix
Suggested change
const data = await response.json();
return data;
if (response.status === 204) {
return null;
}
return response.json();

To fix this, check if the response status is 204. If it is, you can return null or another indicator of success, avoiding the attempt to parse a non-existent JSON body. This ensures that successful deletions are handled correctly.

Prompt for AI

Copy this prompt to your AI IDE to fix this issue locally:

In src/actions/chat_actions.ts around line 59, the code unconditionally calls response.json(), which will fail for successful DELETE requests that return a 204 No Content status. Before calling response.json(), add a check for `response.status === 204`. If it's true, return null to indicate success without a body. Otherwise, proceed to call and return `response.json()`.

📍 This suggestion applies to lines 59-60

Co-authored-by: beetle-ai[bot] <221859081+beetle-ai[bot]@users.noreply.github.com>
@beetle-ai
Copy link

beetle-ai bot commented Jan 2, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @beetle-ai review command.

⚙️ Settings

Severity Threshold: Medium — Balanced feedback — medium and high severity issues only.Change in Settings
Custom Rules: Define your own review rules — Set Custom Rules
PR Summary: Configure PR summary — Change in Settings

📖 User Guide
  • Once repos are connected, PR analysis is automatically enabled. You can disable analysis for this repo from beetleai.dev/analysis
  • Comment @beetle-ai review on any PR to start analysis manually
  • Comment @beetle-ai stop to stop any ongoing analysis

Follow us: Beetle · X · LinkedIn

Co-authored-by: beetle-ai[bot] <221859081+beetle-ai[bot]@users.noreply.github.com>
@beetle-ai
Copy link

beetle-ai bot commented Jan 2, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @beetle-ai review command.

⚙️ Settings

Severity Threshold: Medium — Balanced feedback — medium and high severity issues only.Change in Settings
Custom Rules: Define your own review rules — Set Custom Rules
PR Summary: Configure PR summary — Change in Settings

📖 User Guide
  • Once repos are connected, PR analysis is automatically enabled. You can disable analysis for this repo from beetleai.dev/analysis
  • Comment @beetle-ai review on any PR to start analysis manually
  • Comment @beetle-ai stop to stop any ongoing analysis

Follow us: Beetle · X · LinkedIn

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new GlowButton component, refactors the chat sidebar to use dynamic data from the backend, adds job scraping functionality to the dashboard, and enhances the hero section with additional light ray effects. The PR title "Demo beetle" suggests this might be a demonstration or feature branch.

Key Changes

  • Introduces a new GlowButton UI component with glow effects and multiple size/variant options
  • Refactors sidebar from static JSON data to dynamic chat management with CRUD operations (fetch, rename, delete)
  • Adds scraping functionality to Dashboard with a new button to trigger job scraping

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 17 comments.

Show a summary per file
File Description
tailwind.config.ts Adds glow color theme and reformats keyframes/animations (removes slide-in-right animation)
src/components/ui/glowButton.tsx New button component with gradient background and glow styling
src/app/globals.css Adds global button/link transitions and glow-effect CSS class
src/app/(root)/dashboard/_components/Dashboard.tsx Adds scraping button and handler to trigger job scraping
src/app/(root)/(chat)/_components/sidebar.tsx Refactored to fetch chats from API with rename/delete functionality
src/app/(root)/(chat)/_components/heroSection.tsx Replaces hardcoded buttons with GlowButton components and expands light ray effects
src/actions/chat_actions.ts Adds new API functions for fetching, deleting, and renaming chats

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +55 to +86
glow: {
blue: '#53ffe9',
dark: '#121212'
}
},
borderRadius: {
lg: "var(--radius)",
md: "calc(var(--radius) - 2px)",
sm: "calc(var(--radius) - 4px)",
},
keyframes: {
"accordion-down": {
from: { height: "0" },
to: { height: "var(--radix-accordion-content-height)" },
},
"accordion-up": {
from: { height: "var(--radix-accordion-content-height)" },
to: { height: "0" },
},
'slide-in-right': {
'0%': { transform: 'translateX(100%)', opacity: '0' },
'100%': { transform: 'translateX(0)', opacity: '1' },
},
},
animation: {
"accordion-down": "accordion-down 0.2s ease-out",
"accordion-up": "accordion-up 0.2s ease-out",
'slide-in-right': 'slide-in-right 0.5s ease-out forwards',
},
keyframes: {
'accordion-down': {
from: {
height: '0'
},
to: {
height: 'var(--radix-accordion-content-height)'
}
},
'accordion-up': {
from: {
height: 'var(--radix-accordion-content-height)'
},
to: {
height: '0'
}
},
},
animation: {
'accordion-down': 'accordion-down 0.2s ease-out',
'accordion-up': 'accordion-up 0.2s ease-out'
}
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

Inconsistent indentation: tabs are being used here, while the rest of the file uses spaces (2 spaces). This creates a mixed indentation style that should be consistent throughout the file. The existing color definitions above use spaces.

Copilot uses AI. Check for mistakes.
},
"bg-gradient-to-r from-[#53ffe9]/60 via-[#53ffe9]/20 to-black",
"border-r-1 border-t-1 border-b-1 border-[#282828]",
"border-l-0 rounded-l-full rounded-r-full",
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

Redundant border-radius classes: both 'rounded-l-full' and 'rounded-r-full' are specified along with 'rounded-full' on line 19. The 'rounded-full' class already applies full rounding to all corners, making the additional directional classes unnecessary.

Suggested change
"border-l-0 rounded-l-full rounded-r-full",
"border-l-0",

Copilot uses AI. Check for mistakes.
Comment on lines +106 to +108
button, a {
@apply transition-all duration-300;
}
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

Global selector 'button, a' applies transitions to all buttons and links, which could have unintended consequences. This might conflict with specific component behaviors or third-party libraries. Consider being more specific with the selector or using a class-based approach for better control.

Copilot uses AI. Check for mistakes.
Comment on lines +65 to +86
keyframes: {
'accordion-down': {
from: {
height: '0'
},
to: {
height: 'var(--radix-accordion-content-height)'
}
},
'accordion-up': {
from: {
height: 'var(--radix-accordion-content-height)'
},
to: {
height: '0'
}
},
},
animation: {
'accordion-down': 'accordion-down 0.2s ease-out',
'accordion-up': 'accordion-up 0.2s ease-out'
}
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The 'slide-in-right' animation was removed but it's not clear if this animation was intentionally removed or if it's still needed elsewhere. Since no references to this animation exist in the codebase, the removal appears safe. However, if this is part of a demo feature (as suggested by the PR title "Demo beetle"), consider documenting why it was removed.

Copilot uses AI. Check for mistakes.
variant?: 'primary' | 'secondary';
size?: 'default' | 'sm' | 'lg';
className?: string;
leftIcon?: React.ReactNode;
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The leftIcon prop is defined in the interface but not used in the only place where GlowButton is rendered (heroSection.tsx line 240-246). Consider removing this unused prop or implementing it where needed.

Copilot uses AI. Check for mistakes.
Comment on lines +33 to +36
{leftIcon && <span className="text-[#0070F3]">{leftIcon}</span>}
{variant === 'primary' ? (
<>
<span className="font-semibold text-[#0070F3]">{children}</span>
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

Hardcoded color values are used instead of the glow theme colors defined in tailwind.config.ts. The color '#53ffe9' is duplicated here and in the config, and '#0070F3' is used but not defined in the theme. Consider using theme colors (e.g., 'text-glow-blue') for consistency and maintainability.

Suggested change
{leftIcon && <span className="text-[#0070F3]">{leftIcon}</span>}
{variant === 'primary' ? (
<>
<span className="font-semibold text-[#0070F3]">{children}</span>
{leftIcon && <span className="text-glow-blue">{leftIcon}</span>}
{variant === 'primary' ? (
<>
<span className="font-semibold text-glow-blue">{children}</span>

Copilot uses AI. Check for mistakes.
const handleScrapeAndCreateJobs = async () => {
setScraping(true);
try {
const data = await scrapeAndCreateJobs();
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The data variable returned from scrapeAndCreateJobs is not used. Consider either using this data to provide feedback to the user (e.g., showing the number of jobs scraped) or removing the assignment if the response data isn't needed.

Suggested change
const data = await scrapeAndCreateJobs();
await scrapeAndCreateJobs();

Copilot uses AI. Check for mistakes.
description?: string
}

const sidebar = () => {
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

Component name 'sidebar' doesn't follow React naming conventions. React components should be PascalCase (e.g., 'Sidebar'). While this works, it's inconsistent with other components in the same directory like 'Navbar', 'HeroSection', and 'InitialCard'.

Copilot uses AI. Check for mistakes.
Comment on lines +46 to +59
const handleDelete = async (chatId: string) => {
if (!confirm('Are you sure you want to delete this chat?')) {
return
}

try {
await deleteById(`/api/chat/delete?id=${chatId}`)
toast.success('Chat deleted successfully')
// Remove the chat from the list
setChats(chats.filter(chat => chat.id !== chatId))
} catch (error) {
console.error('Error deleting chat:', error)
toast.error('Failed to delete chat')
}
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

Missing accessibility: The confirm dialog for delete uses the browser's native confirm() which isn't keyboard-friendly and provides poor UX. Consider using a proper modal/dialog component that's accessible and consistent with the rest of the UI design.

Suggested change
const handleDelete = async (chatId: string) => {
if (!confirm('Are you sure you want to delete this chat?')) {
return
}
try {
await deleteById(`/api/chat/delete?id=${chatId}`)
toast.success('Chat deleted successfully')
// Remove the chat from the list
setChats(chats.filter(chat => chat.id !== chatId))
} catch (error) {
console.error('Error deleting chat:', error)
toast.error('Failed to delete chat')
}
const handleDelete = (chatId: string) => {
const toastId = toast.custom((t) => (
<div
role="dialog"
aria-modal="true"
aria-labelledby={`confirm-delete-${chatId}`}
className="rounded-md bg-white shadow-lg border border-gray-200 p-4 max-w-sm w-full"
>
<p id={`confirm-delete-${chatId}`} className="text-sm text-gray-900">
Are you sure you want to delete this chat?
</p>
<div className="mt-4 flex justify-end gap-2">
<button
type="button"
className="px-3 py-1.5 text-sm rounded-md border border-gray-300 bg-white text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-400"
onClick={() => {
toast.dismiss(t.id)
}}
>
Cancel
</button>
<button
type="button"
className="px-3 py-1.5 text-sm rounded-md bg-red-600 text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500"
onClick={async () => {
try {
await deleteById(`/api/chat/delete?id=${chatId}`)
toast.success('Chat deleted successfully')
setChats((prevChats) => prevChats.filter((chat) => chat.id !== chatId))
} catch (error) {
console.error('Error deleting chat:', error)
toast.error('Failed to delete chat')
} finally {
toast.dismiss(t.id)
}
}}
>
Delete
</button>
</div>
</div>
), {
id: `confirm-delete-${chatId}`,
duration: Infinity,
})
return toastId

Copilot uses AI. Check for mistakes.
Comment on lines +55 to +58
glow: {
blue: '#53ffe9',
dark: '#121212'
}
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The glow colors defined here (glow.blue and glow.dark) are not used anywhere in the codebase. These colors appear to be unused configuration that should either be utilized or removed to keep the configuration clean.

Suggested change
glow: {
blue: '#53ffe9',
dark: '#121212'
}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants