From add43a48bf8d667b305597c141f56153055a4d33 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Wed, 31 Dec 2025 15:16:44 +0530 Subject: [PATCH 1/2] chore: remove comments from codebase --- backend/controllers/complete_tasks.go | 1 - backend/controllers/controllers_test.go | 8 +------- backend/controllers/delete_task.go | 4 ---- backend/controllers/get_logs.go | 1 - .../HomeComponents/BottomBar/BottomBar.tsx | 2 -- .../src/components/HomeComponents/Hero/Hero.tsx | 1 - .../HomeComponents/Navbar/NavbarMobile.tsx | 4 ---- .../Navbar/__tests__/navbar-utils.test.ts | 1 - .../HomeComponents/Navbar/navbar-utils.ts | 1 - .../HomeComponents/SetupGuide/SetupGuide.tsx | 2 -- .../HomeComponents/Tasks/TaskDialog.tsx | 5 ++--- .../src/components/HomeComponents/Tasks/Tasks.tsx | 15 +-------------- .../HomeComponents/Tasks/UseEditTask.tsx | 1 - .../HomeComponents/Tasks/__tests__/Tasks.test.tsx | 1 - .../Tasks/__tests__/tasks-utils.test.ts | 13 ------------- .../src/components/HomeComponents/Tasks/hooks.ts | 6 +----- .../HomeComponents/Tasks/tasks-utils.ts | 2 -- frontend/src/components/ui/key-button.tsx | 4 +--- 18 files changed, 6 insertions(+), 66 deletions(-) diff --git a/backend/controllers/complete_tasks.go b/backend/controllers/complete_tasks.go index b971f50b..d9dc99b9 100644 --- a/backend/controllers/complete_tasks.go +++ b/backend/controllers/complete_tasks.go @@ -52,7 +52,6 @@ func BulkCompleteTaskHandler(w http.ResponseWriter, r *http.Request) { logStore := models.GetLogStore() - // Create a *single* job for all UUIDs job := Job{ Name: "Bulk Complete Tasks", Execute: func() error { diff --git a/backend/controllers/controllers_test.go b/backend/controllers/controllers_test.go index 921d69c3..619016f2 100644 --- a/backend/controllers/controllers_test.go +++ b/backend/controllers/controllers_test.go @@ -54,7 +54,6 @@ func Test_OAuthHandler(t *testing.T) { func Test_OAuthCallbackHandler(t *testing.T) { app := setup() - // This part of the test requires mocking the OAuth provider which can be complex. Simplified for demonstration. req, err := http.NewRequest("GET", "/auth/callback?code=testcode", nil) assert.NoError(t, err) @@ -62,14 +61,12 @@ func Test_OAuthCallbackHandler(t *testing.T) { handler := http.HandlerFunc(app.OAuthCallbackHandler) handler.ServeHTTP(rr, req) - // Since actual OAuth flow can't be tested in unit test, we are focusing on ensuring no panic assert.NotEqual(t, http.StatusInternalServerError, rr.Code) } func Test_UserInfoHandler(t *testing.T) { app := setup() - // Create a request object to pass to the session store req, err := http.NewRequest("GET", "/api/user", nil) assert.NoError(t, err) @@ -80,7 +77,7 @@ func Test_UserInfoHandler(t *testing.T) { "uuid": "uuid-test", "encryption_secret": "secret-test", } - session.Save(req, httptest.NewRecorder()) // Save the session + session.Save(req, httptest.NewRecorder()) rr := httptest.NewRecorder() handler := http.HandlerFunc(app.UserInfoHandler) @@ -125,7 +122,6 @@ func Test_LogoutHandler(t *testing.T) { } func Test_AddTaskHandler_WithDueDate(t *testing.T) { - // Initialize job queue GlobalJobQueue = NewJobQueue() requestBody := map[string]interface{}{ @@ -151,7 +147,6 @@ func Test_AddTaskHandler_WithDueDate(t *testing.T) { } func Test_AddTaskHandler_WithoutDueDate(t *testing.T) { - // Initialize job queue GlobalJobQueue = NewJobQueue() requestBody := map[string]interface{}{ @@ -197,7 +192,6 @@ func Test_AddTaskHandler_MissingDescription(t *testing.T) { assert.Contains(t, rr.Body.String(), "Description is required") } -// Task Dependencies Tests func Test_AddTaskHandler_WithDependencies(t *testing.T) { GlobalJobQueue = NewJobQueue() diff --git a/backend/controllers/delete_task.go b/backend/controllers/delete_task.go index 5af79555..34fcd628 100644 --- a/backend/controllers/delete_task.go +++ b/backend/controllers/delete_task.go @@ -47,10 +47,6 @@ func DeleteTaskHandler(w http.ResponseWriter, r *http.Request) { return } - // if err := tw.DeleteTaskInTaskwarrior(email, encryptionSecret, uuid, taskuuid); err != nil { - // http.Error(w, err.Error(), http.StatusInternalServerError) - // return - // } logStore := models.GetLogStore() job := Job{ Name: "Delete Task", diff --git a/backend/controllers/get_logs.go b/backend/controllers/get_logs.go index e1faeeb2..42a21886 100644 --- a/backend/controllers/get_logs.go +++ b/backend/controllers/get_logs.go @@ -39,7 +39,6 @@ func SyncLogsHandler(w http.ResponseWriter, r *http.Request) { logStore := models.GetLogStore() logs := logStore.GetLogs(last) - // Return logs as JSON w.Header().Set("Content-Type", "application/json") if err := json.NewEncoder(w).Encode(logs); err != nil { http.Error(w, "Failed to encode logs", http.StatusInternalServerError) diff --git a/frontend/src/components/HomeComponents/BottomBar/BottomBar.tsx b/frontend/src/components/HomeComponents/BottomBar/BottomBar.tsx index b0726065..5dfff819 100644 --- a/frontend/src/components/HomeComponents/BottomBar/BottomBar.tsx +++ b/frontend/src/components/HomeComponents/BottomBar/BottomBar.tsx @@ -24,7 +24,6 @@ const BottomBar: React.FC = ({ }) => { return (
- {/* Nav Links */}
- {/* Filters */} - {/* Mobile-only Sync button (desktop already shows a Sync button with filters) */} + {/* Mobile-only Sync button */}