Add tooltips (#744)

This commit is contained in:
Chris 2025-12-28 12:03:50 +02:00 committed by GitHub
parent 2c68643dce
commit 3f37113a2c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 36 additions and 16 deletions

View file

@ -849,15 +849,17 @@ router.get('/task/:uid/next-iterations', async (req, res) => {
return res.status(400).json({ error: 'Invalid UID' });
}
const task = await taskRepository.findByUidAndUser(
req.params.uid,
req.currentUser.id
);
const task = await taskRepository.findByUid(req.params.uid);
if (!task) {
return res.status(404).json({ error: 'Task not found' });
}
// Verify user owns this task
if (task.user_id !== req.currentUser.id) {
return res.status(403).json({ error: 'Access denied' });
}
if (!task.recurrence_type || task.recurrence_type === 'none') {
return res.json({ iterations: [] });
}

View file

@ -138,12 +138,6 @@ const RecurrenceDisplay: React.FC<RecurrenceDisplayProps> = ({
return null;
}
console.log('RecurrenceDisplay rendering:', {
recurrenceType,
recurrenceWeekdays,
recurrenceInterval,
});
return (
<div className={`${compact ? 'space-y-2' : 'space-y-3'}`}>
{/* Main recurrence info */}

View file

@ -184,10 +184,20 @@ const TaskDetails: React.FC = () => {
};
const handleRecurrenceChange = (field: string, value: any) => {
setRecurrenceForm((prev) => ({
...prev,
[field]: value,
}));
setRecurrenceForm((prev) => {
const updated = { ...prev, [field]: value };
// Set default values when switching to monthly recurrence
if (
field === 'recurrence_type' &&
value === 'monthly' &&
!prev.recurrence_month_day
) {
updated.recurrence_month_day = new Date().getDate();
}
return updated;
});
};
const handleSaveRecurrence = async () => {

View file

@ -398,7 +398,14 @@ const TaskHeader: React.FC<TaskHeaderProps> = ({
)}
{task.recurrence_type &&
task.recurrence_type !== 'none' && (
<div className="flex items-center">
<div
className="flex items-center"
title={
task.due_date
? `${t('next', 'Next')}: ${formatDueDate(task.due_date)}`
: undefined
}
>
<ArrowPathIcon className="h-3 w-3 mr-1" />
<span>
{formatRecurrence(
@ -560,7 +567,14 @@ const TaskHeader: React.FC<TaskHeaderProps> = ({
)}
{task.recurrence_type &&
task.recurrence_type !== 'none' && (
<div className="flex items-center">
<div
className="flex items-center"
title={
task.due_date
? `${t('next', 'Next')}: ${formatDueDate(task.due_date)}`
: undefined
}
>
<ArrowPathIcon className="h-3 w-3 mr-1" />
<span>
{formatRecurrence(