Fix payee action buttons layout and chart tooltip hover highlight
Place edit and delete buttons side by side in payees table using flex. Debounce chart highlight clear to persist during tooltip hover transitions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -336,23 +336,34 @@ const spendingChartSeries = computed(() =>
|
||||
spending.value?.categories.map(c => c.amount) ?? []
|
||||
)
|
||||
|
||||
let chartLeaveTimer: ReturnType<typeof setTimeout> | null = null
|
||||
|
||||
function setChartHighlight(categoryName: string | null) {
|
||||
if (chartLeaveTimer) { clearTimeout(chartLeaveTimer); chartLeaveTimer = null }
|
||||
if (categoryName) {
|
||||
highlightedCategory.value = categoryName
|
||||
} else {
|
||||
chartLeaveTimer = setTimeout(() => { highlightedCategory.value = null }, 100)
|
||||
}
|
||||
}
|
||||
|
||||
const spendingChartOptions = computed(() => ({
|
||||
chart: {
|
||||
type: 'donut' as const,
|
||||
events: {
|
||||
dataPointMouseEnter: (_e: any, _ctx: any, config: any) => {
|
||||
const labels = spending.value?.categories.map(c => c.categoryName) ?? []
|
||||
highlightedCategory.value = labels[config.dataPointIndex] ?? null
|
||||
setChartHighlight(labels[config.dataPointIndex] ?? null)
|
||||
},
|
||||
dataPointMouseLeave: () => {
|
||||
highlightedCategory.value = null
|
||||
setChartHighlight(null)
|
||||
},
|
||||
legendMouseOver: (_ctx: any, _opts: any, config: any) => {
|
||||
const labels = spending.value?.categories.map(c => c.categoryName) ?? []
|
||||
highlightedCategory.value = labels[config.seriesIndex] ?? null
|
||||
setChartHighlight(labels[config.seriesIndex] ?? null)
|
||||
},
|
||||
legendMouseOut: () => {
|
||||
highlightedCategory.value = null
|
||||
setChartHighlight(null)
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user