-
Notifications
You must be signed in to change notification settings - Fork 37
Fix issues, optimize data structures, and expand features #356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
RohanExploit
merged 5 commits into
main
from
fix-app-issues-optimize-features-13587865994661549961
Feb 9, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a225332
Fix verify endpoint, optimize models, and expand detection features
google-labs-jules[bot] 92fa251
Fix missing frontend components and API imports for deployment
google-labs-jules[bot] 314b91a
Fix frontend build by cleaning up unused imports and duplicate depend…
google-labs-jules[bot] d5d33e4
Fix critical logic errors in AuthContext and VoiceInput
google-labs-jules[bot] 1d58df5
Merge branch 'main' into fix-app-issues-optimize-features-13587865994…
RohanExploit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,22 @@ | ||
| import client from './client'; | ||
| import { apiClient } from './client'; | ||
|
|
||
| export const authApi = { | ||
| login: async (email, password) => { | ||
| // Determine if using FormData or JSON based on backend implementation | ||
| // Plan used JSON: {email, password} -> /auth/login | ||
| // But router also supports /auth/token with FormData. | ||
| // Let's use JSON endpoint /auth/login for simplicity in React | ||
| const response = await client.post('/auth/login', { email, password }); | ||
| return response.data; | ||
| const response = await apiClient.post('/auth/login', { email, password }); | ||
| return response; | ||
| }, | ||
|
|
||
| signup: async (userData) => { | ||
| const response = await client.post('/auth/signup', userData); | ||
| return response.data; | ||
| const response = await apiClient.post('/auth/signup', userData); | ||
| return response; | ||
| }, | ||
|
|
||
| me: async () => { | ||
| const response = await client.get('/auth/me'); | ||
| return response.data; | ||
| const response = await apiClient.get('/auth/me'); | ||
| return response; | ||
| } | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| import React, { useState } from 'react'; | ||
| import { useTranslation } from 'react-i18next'; | ||
| import { Link, useNavigate } from 'react-router-dom'; | ||
| import { Menu, User, LogOut } from 'lucide-react'; | ||
| import { useAuth } from '../contexts/AuthContext'; | ||
|
|
||
| const AppHeader = () => { | ||
| const navigate = useNavigate(); | ||
| const { user, logout } = useAuth(); // useAuth returns user, not currentUser | ||
| const [isMenuOpen, setIsMenuOpen] = useState(false); | ||
|
|
||
| const handleLogout = async () => { | ||
| try { | ||
| await logout(); | ||
| navigate('/login'); | ||
| } catch (error) { | ||
| console.error('Failed to log out', error); | ||
| } | ||
| }; | ||
|
|
||
| return ( | ||
| <header className="bg-white shadow-sm sticky top-0 z-40"> | ||
| <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"> | ||
| <div className="flex justify-between h-16 items-center"> | ||
| <div className="flex items-center cursor-pointer" onClick={() => navigate('/')}> | ||
| <span className="text-2xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-orange-500 via-orange-400 to-green-500 drop-shadow-sm"> | ||
| VishwaGuru | ||
| </span> | ||
| </div> | ||
|
|
||
| <div className="flex items-center gap-4"> | ||
| {user ? ( | ||
| <div className="relative"> | ||
| <button onClick={() => setIsMenuOpen(!isMenuOpen)} className="flex items-center gap-2 text-gray-700 hover:text-blue-600 focus:outline-none"> | ||
| <div className="bg-blue-100 p-2 rounded-full"> | ||
| <User size={20} className="text-blue-600" /> | ||
| </div> | ||
| <span className="hidden sm:inline font-medium text-sm">{user.email}</span> | ||
| </button> | ||
|
|
||
| {isMenuOpen && ( | ||
| <div className="absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1 ring-1 ring-black ring-opacity-5 z-50"> | ||
| <Link to="/my-reports" className="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" onClick={() => setIsMenuOpen(false)}>My Reports</Link> | ||
| <button onClick={handleLogout} className="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 flex items-center gap-2"> | ||
RohanExploit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <LogOut size={14} /> Logout | ||
| </button> | ||
RohanExploit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </div> | ||
| )} | ||
| </div> | ||
| ) : ( | ||
| <Link to="/login" className="text-sm font-medium text-blue-600 hover:text-blue-500 px-4 py-2 rounded-full hover:bg-blue-50 transition-colors">Login</Link> | ||
| )} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </header> | ||
| ); | ||
| }; | ||
|
|
||
| export default AppHeader; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import React from 'react'; | ||
| import ChatWidget from './ChatWidget'; | ||
| import VoiceInput from './VoiceInput'; | ||
|
|
||
| const FloatingButtonsManager = ({ setView }) => { | ||
| const handleVoiceCommand = (transcript) => { | ||
| console.log("Voice command:", transcript); | ||
RohanExploit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const lower = transcript.toLowerCase(); | ||
|
|
||
| // Simple command mapping | ||
| if (lower.includes('home')) setView('home'); | ||
| else if (lower.includes('report') || lower.includes('issue')) setView('report'); | ||
| else if (lower.includes('map')) setView('map'); | ||
| else if (lower.includes('pothole')) setView('pothole'); | ||
| else if (lower.includes('garbage')) setView('garbage'); | ||
| else if (lower.includes('vandalism') || lower.includes('graffiti')) setView('vandalism'); | ||
| else if (lower.includes('flood') || lower.includes('water')) setView('flood'); | ||
| }; | ||
RohanExploit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| return ( | ||
| <> | ||
| {/* Voice Input Button - Positioned above Chat Widget */} | ||
| <div className="fixed bottom-24 right-5 z-50"> | ||
| <VoiceInput onTranscript={handleVoiceCommand} /> | ||
| </div> | ||
|
|
||
| {/* Chat Widget - Self-positioned at bottom-right */} | ||
| <ChatWidget /> | ||
| </> | ||
| ); | ||
| }; | ||
|
|
||
| export default FloatingButtonsManager; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import React from 'react'; | ||
|
|
||
| const LoadingSpinner = ({ size = 'md', variant = 'primary' }) => { | ||
| const sizeClasses = { | ||
| sm: 'h-4 w-4', | ||
| md: 'h-8 w-8', | ||
| lg: 'h-12 w-12', | ||
| xl: 'h-16 w-16' | ||
| }; | ||
|
|
||
| const variantClasses = { | ||
| primary: 'border-blue-600', | ||
| secondary: 'border-gray-600', | ||
| white: 'border-white' | ||
| }; | ||
|
|
||
| return ( | ||
| <div className={`animate-spin rounded-full border-b-2 border-t-2 border-r-2 border-transparent ${sizeClasses[size]} ${variantClasses[variant]}`}></div> | ||
| ); | ||
RohanExploit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
|
|
||
| export default LoadingSpinner; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.