-
Notifications
You must be signed in to change notification settings - Fork 1
Adding Chrome Extension #6
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| chrome.sidePanel | ||
| .setPanelBehavior({ openPanelOnActionClick: true }) | ||
| .catch((error) => console.error(error)); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| { | ||
| "name": "ProdHub Chrome Extension", | ||
| "version": "1.0", | ||
| "manifest_version": 3, | ||
| "description": "ProdHub – your all-in-one side-panel productivity hub. Manage tasks, habits, goals, and your schedule without ever leaving your current tab.", | ||
| "background": { | ||
| "service_worker": "background.js" | ||
| }, | ||
| "permissions": [ | ||
| "sidePanel", | ||
| "identity" | ||
| ], | ||
| "oauth2": { | ||
| "client_id": "357244560688-4ibqpt07g54ns83qtimb2rtsa3p42uur.apps.googleusercontent.com", | ||
| "scopes": [ | ||
| "profile", | ||
| "email", | ||
| "openid" | ||
| ] | ||
| }, | ||
| "host_permissions": [ | ||
| "<all_urls>" | ||
| ], | ||
| "action": { | ||
| "default_title": "Open ProdHub Panel", | ||
| "default_icon": "logo192.png" | ||
| }, | ||
| "side_panel": { | ||
| "default_path": "index.html" | ||
| }, | ||
| "icons": { | ||
| "128": "logo192.png", | ||
| "192": "logo192.png", | ||
| "512": "logo512.png" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ import AllTasksView from './features/tasks/AllTasksView'; | |
| import ScheduleView from './features/schedule/ScheduleView'; | ||
| import HabitTrackerView from './features/habits/HabitTrackerView'; | ||
| import WeeklyReviewView from './features/review/WeeklyReviewView'; | ||
| import { Menu, Book } from 'lucide-react'; | ||
|
|
||
| function HubApp({ user, handleSignOut }) { | ||
| const [projects, setProjects] = useState([]); | ||
|
|
@@ -22,6 +23,7 @@ function HubApp({ user, handleSignOut }) { | |
| const [habitEntries, setHabitEntries] = useState([]); | ||
| const [activeView, setActiveView] = useState('dashboard'); | ||
| const [selectedProjectId, setSelectedProjectId] = useState(null); | ||
| const [isSidebarOpen, setIsSidebarOpen] = useState(false); | ||
|
|
||
| const [syncedEvents, setSyncedEvents] = useState([]); | ||
| const [tokenClient, setTokenClient] = useState(null); | ||
|
|
@@ -101,18 +103,36 @@ function HubApp({ user, handleSignOut }) { | |
| const handleSetView = (view, projectId = null) => { | ||
| setActiveView(view); | ||
| setSelectedProjectId(projectId); | ||
| setIsSidebarOpen(false); // Auto-close sidebar on mobile | ||
| }; | ||
|
|
||
| return ( | ||
| <div className="bg-gray-900 text-gray-100 min-h-screen font-sans flex"> | ||
| <Sidebar | ||
| onViewChange={handleSetView} | ||
| projects={projects} | ||
| goals={goals} | ||
| userId={user.uid} | ||
| handleSignOut={handleSignOut} | ||
| /> | ||
| <main className="flex-1 p-4 sm:p-6 lg:p-8 overflow-y-auto"> | ||
| <div className="bg-gray-900 text-gray-100 min-h-screen font-sans flex flex-col md:flex-row"> | ||
| {/* Mobile Header */} | ||
| <div className="md:hidden flex items-center justify-between p-4 border-b border-gray-700/50 bg-gray-900"> | ||
| <h1 className="text-xl font-bold text-blue-400 flex items-center gap-2"> | ||
| <Book size={20} /> ProdHub | ||
| </h1> | ||
| <button | ||
| onClick={() => setIsSidebarOpen(!isSidebarOpen)} | ||
| className="text-gray-300 hover:text-white p-2 rounded-md hover:bg-gray-800 transition-colors" | ||
| > | ||
| <Menu size={24} /> | ||
| </button> | ||
| </div> | ||
|
|
||
| {/* Sidebar Container */} | ||
| <div className={`${isSidebarOpen ? 'block' : 'hidden'} md:block md:w-64 flex-shrink-0 h-[calc(100vh-73px)] md:h-screen w-full`}> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using a hardcoded magic number like |
||
| <Sidebar | ||
| onViewChange={handleSetView} | ||
| projects={projects} | ||
| goals={goals} | ||
| userId={user.uid} | ||
| handleSignOut={handleSignOut} | ||
| /> | ||
| </div> | ||
|
|
||
| <main className={`${isSidebarOpen ? 'hidden md:block' : 'block'} flex-1 p-4 sm:p-6 lg:p-8 overflow-y-auto max-h-screen`}> | ||
| {activeView === 'dashboard' && ( | ||
| <Dashboard | ||
| projects={projects} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of
<all_urls>inhost_permissionsis extremely broad and generally discouraged unless the extension specifically needs to interact with any website the user visits. For a productivity hub that primarily interacts with Firebase and Google APIs, it is a security best practice to narrow these permissions to specific domains (e.g.,https://*.firebaseio.com/*,https://generativelanguage.googleapis.com/*). Broad permissions can also lead to longer review times or rejection during the Chrome Web Store publishing process.