feat(tasks): register section for floating AI chat in TasksPage

This commit is contained in:
Roberto Musso
2026-02-27 23:56:08 +01:00
parent 6cd121fa80
commit 50b69aadbf
2 changed files with 115 additions and 178 deletions

View File

@@ -1,5 +1,6 @@
import { createFileRoute } from '@tanstack/react-router';
import { useState, useCallback, useMemo } from 'react';
import { useState, useCallback, useMemo, useRef, useEffect } from 'react';
import { useFloatingChat } from '@/context/FloatingChatContext';
import {
ClipboardCheck,
ListTodo,
@@ -40,6 +41,14 @@ const ORDER_LABELS: Record<OrderBy, string> = {
};
function TasksPage() {
// Temporary test: register section for floating AI chat
const testRef = useRef<HTMLDivElement>(null);
const { registerSection, unregisterSection } = useFloatingChat();
useEffect(() => {
registerSection({ id: 'test', label: 'Tasks', ref: testRef });
return () => unregisterSection('test');
}, [registerSection, unregisterSection]);
const [search, setSearch] = useState('');
const [debouncedSearch, setDebouncedSearch] = useState('');
const [statusFilter, setStatusFilter] = useState<StatusFilter>('all');
@@ -110,7 +119,7 @@ function TasksPage() {
);
return (
<div className="flex flex-col gap-6 p-6 pe-8 w-full">
<div ref={testRef} data-ai-section="test" className="flex flex-col gap-6 p-6 pe-8 w-full">
{/* Stat Cards */}
<div className="grid grid-cols-4 gap-4">
<Item variant="muted">