feat: add knip configuration file and integrate knip for linting; update package.json and package-lock.json for new dependencies; refactor various interfaces to remove export modifiers; delete unused hover-card component

This commit is contained in:
Roberto Musso
2026-02-28 23:44:10 +01:00
parent cdf9a8bf18
commit ee6467a7ac
12 changed files with 492 additions and 70 deletions

View File

@@ -140,7 +140,7 @@ export function AIChatPanel({
// Derived values for home page
const dueCount = dueTodayQuery.data?.length ?? 0;
const userName = userNameQuery.data ?? 'there';
const userName = userNameQuery.data ?? 'Roberto';
return (
<div className="absolute inset-0 z-0 flex flex-col bg-background">

View File

@@ -1,42 +0,0 @@
import * as React from "react"
import { HoverCard as HoverCardPrimitive } from "radix-ui"
import { cn } from "@/lib/utils"
function HoverCard({
...props
}: React.ComponentProps<typeof HoverCardPrimitive.Root>) {
return <HoverCardPrimitive.Root data-slot="hover-card" {...props} />
}
function HoverCardTrigger({
...props
}: React.ComponentProps<typeof HoverCardPrimitive.Trigger>) {
return (
<HoverCardPrimitive.Trigger data-slot="hover-card-trigger" {...props} />
)
}
function HoverCardContent({
className,
align = "center",
sideOffset = 4,
...props
}: React.ComponentProps<typeof HoverCardPrimitive.Content>) {
return (
<HoverCardPrimitive.Portal data-slot="hover-card-portal">
<HoverCardPrimitive.Content
data-slot="hover-card-content"
align={align}
sideOffset={sideOffset}
className={cn(
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
className
)}
{...props}
/>
</HoverCardPrimitive.Portal>
)
}
export { HoverCard, HoverCardTrigger, HoverCardContent }

View File

@@ -2,7 +2,6 @@ import {
createContext,
useContext,
useCallback,
useEffect,
useState,
useRef,
type ReactNode,
@@ -11,7 +10,7 @@ import {
// ---------- Types ----------
export interface AISection {
interface AISection {
id: string; // e.g. "project-tasks", "tasks-list", "timeline-chart"
label: string; // Human-readable, e.g. "Tasks", "Project Timeline"
ref: RefObject<HTMLElement | null>;
@@ -19,7 +18,7 @@ export interface AISection {
anchorMode?: 'top-right' | 'right-margin'; // default: 'top-right'
}
export interface SectionOpenOpts {
interface SectionOpenOpts {
clickY?: number; // For right-margin mode: Y-coordinate of the double-click
}
@@ -152,15 +151,6 @@ export function useFloatingChat(): FloatingChatContextValue {
return ctx;
}
// Convenience hook for pages to register a section
export function useAISection(section: AISection): void {
const { registerSection, unregisterSection } = useFloatingChat();
useEffect(() => {
registerSection(section);
return () => unregisterSection(section.id);
}, [section.id, registerSection, unregisterSection]);
}
// ---------- Provider ----------

View File

@@ -1,7 +1,7 @@
import { useState, useCallback, useRef } from 'react';
import { trpc } from '@/lib/trpc';
export interface ChatMessage {
interface ChatMessage {
id: string;
role: 'user' | 'assistant';
content: string;
@@ -14,7 +14,7 @@ export interface ChatContext {
uiContext?: string;
}
export interface UseAIChatReturn {
interface UseAIChatReturn {
messages: ChatMessage[];
input: string;
setInput: (v: string) => void;
@@ -24,7 +24,7 @@ export interface UseAIChatReturn {
clearMessages: () => void;
}
export interface UseAIChatOptions {
interface UseAIChatOptions {
onSectionTag?: (sectionId: string) => void;
}