Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ Format: weekly entries grouped by feature area.

---

## 2026-04-03 — Dead Code Cleanup

### Changed
- Remove 6 unused files and 11 unused exports across monorepo (~762 lines)
- Remove superseded per-type reminder schemas in favor of unified `CreateReminderSchema`
- Un-export internal-only `ReminderTargetTypeSchema` and `ReminderStatusSchema`

---

## 2026-04-03 — Clean Code Audit

### Changed
Expand Down
5 changes: 0 additions & 5 deletions apps/desktop/src/main/database/fts-tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,6 @@ export function clearFtsTasksTable(db: DrizzleDb): void {
db.run(sql`DELETE FROM fts_tasks`)
}

export function getFtsTasksCount(db: DrizzleDb): number {
const result = db.get<{ count: number }>(sql`SELECT COUNT(*) as count FROM fts_tasks`)
return result?.count ?? 0
}

export function initializeFtsTasks(db: DrizzleDb): void {
createFtsTasksTable(db)
createFtsTasksTriggers(db)
Expand Down
7 changes: 0 additions & 7 deletions apps/desktop/src/main/ipc/handler-utils.ts

This file was deleted.

25 changes: 0 additions & 25 deletions apps/desktop/src/main/lib/reminders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -713,31 +713,6 @@ export function isSchedulerRunning(): boolean {
return schedulerInterval !== null
}

// ============================================================================
// Cleanup
// ============================================================================

/**
* Delete all reminders for a target (used when target is deleted)
* @param targetType - Type of target
* @param targetId - ID of the target
* @returns Number of reminders deleted
*/
export function deleteRemindersForTarget(targetType: string, targetId: string): number {
const db = getDatabase()

const result = db
.delete(reminders)
.where(and(eq(reminders.targetType, targetType), eq(reminders.targetId, targetId)))
.run()

if (result.changes > 0) {
logger.info(`Deleted ${result.changes} reminders for ${targetType}:${targetId}`)
}

return result.changes
}

/**
* Count pending reminders (for badge display)
* @returns Number of pending reminders
Expand Down
48 changes: 0 additions & 48 deletions apps/desktop/src/renderer/src/hooks/use-account-info.ts

This file was deleted.

72 changes: 0 additions & 72 deletions apps/desktop/src/renderer/src/hooks/use-backup-settings.ts

This file was deleted.

76 changes: 0 additions & 76 deletions apps/desktop/src/renderer/src/hooks/use-devices.ts

This file was deleted.

14 changes: 0 additions & 14 deletions apps/desktop/src/renderer/src/hooks/use-inbox-mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,20 +176,6 @@ export function useConvertToTask() {
})
}

export function useLinkToNote() {
const queryClient = useQueryClient()

return useMutation({
mutationFn: ({ itemId, noteId }: { itemId: string; noteId: string }) =>
inboxService.linkToNote(itemId, noteId),
onSuccess: (_, { itemId }) => {
void queryClient.invalidateQueries({ queryKey: inboxKeys.item(itemId) })
void queryClient.invalidateQueries({ queryKey: inboxKeys.lists() })
void queryClient.invalidateQueries({ queryKey: inboxKeys.stats() })
}
})
}

// =============================================================================
// Tag Mutations
// =============================================================================
Expand Down
10 changes: 0 additions & 10 deletions apps/desktop/src/renderer/src/hooks/use-inbox-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
onInboxSnoozeDue,
onInboxTranscriptionComplete,
onInboxMetadataComplete,
onInboxProcessingError,
onInboxSnoozed,
type InboxListInput
} from '@/services/inbox-service'
Expand Down Expand Up @@ -415,12 +414,3 @@ export function useInboxFilingHistory(options?: {
staleTime: ITEM_STALE_TIME
})
}

export function useInboxProcessingErrors(
callback: (event: { id: string; operation: string; error: string }) => void
): void {
useEffect(() => {
const unsub = onInboxProcessingError(callback)
return unsub
}, [callback])
}
4 changes: 1 addition & 3 deletions apps/desktop/src/renderer/src/hooks/use-inbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ export {
useInboxPatterns,
useInboxStaleThreshold,
useInboxArchived,
useInboxFilingHistory,
useInboxProcessingErrors
useInboxFilingHistory
} from './use-inbox-queries'
export type {
UseInboxListOptions,
Expand All @@ -33,7 +32,6 @@ export {
useFileInboxItem,
useConvertToNote,
useConvertToTask,
useLinkToNote,
useAddInboxTag,
useRemoveInboxTag,
useSnoozeInboxItem,
Expand Down
25 changes: 0 additions & 25 deletions apps/desktop/src/renderer/src/hooks/use-is-item-active.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,29 +82,4 @@ export const useIsItemActive = () => {
return isActiveItem
}

/**
* Hook that returns the active tab identity for components that need
* to react to active tab changes (e.g., highlighting)
*
* Use this when you need to RE-RENDER on active tab change.
* Use useIsItemActive when you just need to CHECK if something is active.
*/
export const useActiveTabIdentity = (): ActiveTabIdentity | null => {
const { state } = useTabs()

return useMemo((): ActiveTabIdentity | null => {
const group = state.tabGroups[state.activeGroupId]
if (!group || !group.activeTabId) return null

const activeTab = group.tabs.find((t) => t.id === group.activeTabId)
if (!activeTab) return null

return {
type: activeTab.type,
entityId: activeTab.entityId ?? '',
path: activeTab.path ?? ''
}
}, [state.tabGroups, state.activeGroupId])
}

export default useIsItemActive
35 changes: 0 additions & 35 deletions apps/desktop/src/renderer/src/hooks/use-linking-events.ts

This file was deleted.

Loading
Loading