refactor: remove dead code identified by knip

Delete unused Fab component (superseded by QuickAddFab), unused server
actions and queries (listDashboards, reorderDashboards, deleteCareLog,
canAccessContainer, getOverduePlants, getCareDueSoon, addItemToDefaultList,
reorderItems, getOrCreateDefaultList), unused helpers (getCurrentUser,
BrandWordmark, TopbarSpacer, DEV_LOGIN_COOKIE, no-arg ensureDefault*
wrappers, addListItem re-export), and drop export keyword from five
internal-only functions.

Verified with typecheck, eslint, and production build after each removal.
This commit is contained in:
ginnoir
2026-06-09 15:55:21 -05:00
parent d4ac20f511
commit 944dcdf48f
16 changed files with 6 additions and 226 deletions
-9
View File
@@ -49,12 +49,3 @@ export const { handlers, auth, signIn, signOut } = NextAuth({
},
},
});
export async function getCurrentUser() {
const session = await auth();
if (!session?.user?.id) return null;
const user = await db.query.users.findFirst({
where: (u, { eq }) => eq(u.id, session.user.id),
});
return user ?? null;
}
+1 -1
View File
@@ -7,7 +7,7 @@ import { computePresetLayoutFromMetas } from "./dashboard";
/** Build a layout matching one of the design's three dashboard arrangements
* using the live module registry. Server-only — the registry is empty on
* the client. */
export function computePresetLayout(preset: PresetId): DashboardLayout {
function computePresetLayout(preset: PresetId): DashboardLayout {
const { widgets } = getRegistry();
if (widgets.length === 0) return { version: 1, widgets: [] };
-2
View File
@@ -1,5 +1,3 @@
export const DEV_LOGIN_COOKIE = "authjs.session-token";
if (
process.env.NODE_ENV === "production" &&
process.env.ENABLE_DEV_LOGIN === "true" &&