mirror of
https://github.com/christianvidalwolf-prog/CrazeAnalytix.git
synced 2026-08-03 13:05:24 +02:00
Fix: use fixed-position tooltip on TOTALS row to escape overflow container clipping
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
b01401272c
commit
9f8e51e2f3
@@ -95,6 +95,7 @@ const WeeklyGrid: React.FC<WeeklyGridProps & { top50Mode: 'eu' | 'uk' }> = ({
|
||||
const [primaryMetric, setPrimaryMetric] = useState<'units' | 'revenue'>('units');
|
||||
const scrollContainerRef = useRef<HTMLDivElement>(null);
|
||||
const [hoveredTotalWeek, setHoveredTotalWeek] = useState<string | null>(null);
|
||||
const [tooltipPos, setTooltipPos] = useState<{ x: number; y: number } | null>(null);
|
||||
|
||||
// State for Column Filters (SKU, ASIN, Title, Line)
|
||||
const [columnFilters, setColumnFilters] = useState<Record<string, ColumnFilterCondition>>({});
|
||||
@@ -799,8 +800,12 @@ const WeeklyGrid: React.FC<WeeklyGridProps & { top50Mode: 'eu' | 'uk' }> = ({
|
||||
|
||||
return (
|
||||
<th key={week} className="p-3 text-sm font-black text-white text-center border-r border-white/10 relative"
|
||||
onMouseEnter={() => setHoveredTotalWeek(week)}
|
||||
onMouseLeave={() => setHoveredTotalWeek(null)}
|
||||
onMouseEnter={(e) => {
|
||||
const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();
|
||||
setTooltipPos({ x: rect.left + rect.width / 2, y: rect.top });
|
||||
setHoveredTotalWeek(week);
|
||||
}}
|
||||
onMouseLeave={() => { setHoveredTotalWeek(null); setTooltipPos(null); }}
|
||||
>
|
||||
<div className="flex flex-col items-center">
|
||||
{primaryMetric === 'units' ? (
|
||||
@@ -832,8 +837,10 @@ const WeeklyGrid: React.FC<WeeklyGridProps & { top50Mode: 'eu' | 'uk' }> = ({
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{isHovered && (
|
||||
<div className="absolute bottom-full left-1/2 -translate-x-1/2 mb-2 z-50 w-64 bg-slate-900 border border-white/20 rounded-xl shadow-2xl p-3 text-left pointer-events-none">
|
||||
{isHovered && tooltipPos && (
|
||||
<div className="pointer-events-none fixed z-[9999] w-64 bg-slate-900 border border-white/20 rounded-xl shadow-2xl p-3 text-left"
|
||||
style={{ left: tooltipPos.x, top: tooltipPos.y - 8, transform: 'translate(-50%, -100%)' }}
|
||||
>
|
||||
<div className="text-[10px] font-black text-white/50 uppercase tracking-widest mb-2">{week}</div>
|
||||
|
||||
{/* Semana anterior */}
|
||||
|
||||
Reference in New Issue
Block a user