Skip to content

Conversation

@saeedvaziry
Copy link
Member

No description provided.

@saeedvaziry saeedvaziry requested a review from Copilot November 2, 2025 14:05
Copy link
Contributor

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 refactors project selection to use a new reusable ProjectSelect component with infinite scrolling, replacing static project lists that were previously shared globally via Inertia props.

Key changes:

  • Introduced a ProjectSelect component that fetches projects on-demand via API with infinite scroll support
  • Removed projects array from global auth context to reduce payload size
  • Added a new /projects/json API endpoint to support paginated project fetching

Reviewed Changes

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

Show a summary per file
File Description
resources/js/types/index.d.ts Removed projects array from Auth interface
resources/js/pages/servers/components/transfer-server.tsx Replaced inline Select with ProjectSelect component and updated handler signature
resources/js/pages/projects/components/project-form.tsx Simplified useEffect logic for handling defaultOpen prop
resources/js/components/project-switch.tsx Refactored to use ProjectSelect component with controlled state and custom footer
resources/js/components/project-select.tsx New component implementing project selection with infinite scroll and search
app/Http/Middleware/HandleInertiaRequests.php Removed projects array from shared Inertia data
app/Http/Controllers/Project/ProjectController.php Added json endpoint for paginated project fetching
app/Actions/Projects/GetProjects.php New action class to handle project querying with pagination and search

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

});
};

const handleProjectChange = (value: string) => {
Copy link

Copilot AI Nov 2, 2025

Choose a reason for hiding this comment

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

The handleProjectChange function doesn't match the signature expected by ProjectSelect.onValueChange. According to the ProjectSelect interface (line 14 of project-select.tsx), onValueChange expects (value: string, project: Project) => void, but this handler only accepts value: string. Update the signature to include the project parameter: (value: string, project: Project) => void.

Suggested change
const handleProjectChange = (value: string) => {
const handleProjectChange = (value: string, project: any) => {

Copilot uses AI. Check for mistakes.
);

const trigger = (
<Button variant="ghost" className="px-1!">
Copy link

Copilot AI Nov 2, 2025

Choose a reason for hiding this comment

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

Invalid CSS class syntax. The exclamation mark should come after 'px-1', not inside the string. Change 'px-1!' to 'px-1'.

Suggested change
<Button variant="ghost" className="px-1!">
<Button variant="ghost" className="px-1">

Copilot uses AI. Check for mistakes.
@saeedvaziry saeedvaziry merged commit 3de5105 into 3.x Nov 2, 2025
3 checks passed
@saeedvaziry saeedvaziry deleted the project-select branch November 2, 2025 15:10
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