fix(team): refine task detail dialog
This commit is contained in:
parent
2ddfbf62ee
commit
609f4f8d99
1 changed files with 9 additions and 7 deletions
|
|
@ -71,8 +71,8 @@ import {
|
||||||
} from '@shared/utils/teamTaskState';
|
} from '@shared/utils/teamTaskState';
|
||||||
import { format, formatDistanceToNow } from 'date-fns';
|
import { format, formatDistanceToNow } from 'date-fns';
|
||||||
import {
|
import {
|
||||||
AlignLeft,
|
|
||||||
AlertTriangle,
|
AlertTriangle,
|
||||||
|
AlignLeft,
|
||||||
ArrowLeftFromLine,
|
ArrowLeftFromLine,
|
||||||
ArrowRightFromLine,
|
ArrowRightFromLine,
|
||||||
Check,
|
Check,
|
||||||
|
|
@ -94,9 +94,6 @@ import {
|
||||||
X,
|
X,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
|
|
||||||
const TASK_CHANGES_AUTO_REFRESH_MS = 20_000;
|
|
||||||
const TASK_CHANGES_INITIAL_LOAD_DELAY_MS = 1_500;
|
|
||||||
|
|
||||||
import { SourceMessageAttachments } from '../attachments/SourceMessageAttachments';
|
import { SourceMessageAttachments } from '../attachments/SourceMessageAttachments';
|
||||||
|
|
||||||
import { WorkflowTimeline } from './StatusHistoryTimeline';
|
import { WorkflowTimeline } from './StatusHistoryTimeline';
|
||||||
|
|
@ -114,6 +111,9 @@ import type {
|
||||||
TeamTaskWithKanban,
|
TeamTaskWithKanban,
|
||||||
} from '@shared/types';
|
} from '@shared/types';
|
||||||
|
|
||||||
|
const TASK_CHANGES_AUTO_REFRESH_MS = 20_000;
|
||||||
|
const TASK_CHANGES_INITIAL_LOAD_DELAY_MS = 1_500;
|
||||||
|
|
||||||
interface TaskDetailDialogProps {
|
interface TaskDetailDialogProps {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
loading?: boolean;
|
loading?: boolean;
|
||||||
|
|
@ -303,7 +303,7 @@ export const TaskDetailDialog = ({
|
||||||
unread.add(c.id);
|
unread.add(c.id);
|
||||||
}
|
}
|
||||||
unreadSnapshotRef.current = unread;
|
unreadSnapshotRef.current = unread;
|
||||||
}, [open, teamName, currentTask?.id]); // eslint-disable-line react-hooks/exhaustive-deps
|
}, [open, teamName, currentTask?.id]); // eslint-disable-line react-hooks/exhaustive-deps -- Snapshot should reset only when the dialog opens or task identity changes.
|
||||||
|
|
||||||
// Viewport-based comment read tracking (replaces mark-all-on-mount)
|
// Viewport-based comment read tracking (replaces mark-all-on-mount)
|
||||||
const { registerComment, flush: flushCommentRead } = useViewportCommentRead({
|
const { registerComment, flush: flushCommentRead } = useViewportCommentRead({
|
||||||
|
|
@ -1580,9 +1580,11 @@ const CommentImageThumbnail = ({
|
||||||
return (
|
return (
|
||||||
<Tooltip>
|
<Tooltip>
|
||||||
<TooltipTrigger asChild>
|
<TooltipTrigger asChild>
|
||||||
<div
|
<button
|
||||||
|
type="button"
|
||||||
className="group relative flex size-16 cursor-pointer items-center justify-center overflow-hidden rounded border border-[var(--color-border)] bg-[var(--color-surface)] transition-colors hover:border-[var(--color-border-emphasis)]"
|
className="group relative flex size-16 cursor-pointer items-center justify-center overflow-hidden rounded border border-[var(--color-border)] bg-[var(--color-surface)] transition-colors hover:border-[var(--color-border-emphasis)]"
|
||||||
onClick={() => thumbUrl && onPreview(thumbUrl)}
|
onClick={() => thumbUrl && onPreview(thumbUrl)}
|
||||||
|
aria-label={`Preview ${item.attachment.filename}`}
|
||||||
>
|
>
|
||||||
{thumbUrl ? (
|
{thumbUrl ? (
|
||||||
<img src={thumbUrl} alt={item.attachment.filename} className="size-full object-cover" />
|
<img src={thumbUrl} alt={item.attachment.filename} className="size-full object-cover" />
|
||||||
|
|
@ -1592,7 +1594,7 @@ const CommentImageThumbnail = ({
|
||||||
<div className="absolute inset-x-0 bottom-0 truncate bg-black/60 px-0.5 py-px text-center text-[7px] text-white opacity-0 transition-opacity group-hover:opacity-100">
|
<div className="absolute inset-x-0 bottom-0 truncate bg-black/60 px-0.5 py-px text-center text-[7px] text-white opacity-0 transition-opacity group-hover:opacity-100">
|
||||||
{item.attachment.filename}
|
{item.attachment.filename}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</button>
|
||||||
</TooltipTrigger>
|
</TooltipTrigger>
|
||||||
<TooltipContent side="top" className="max-w-[300px] text-xs">
|
<TooltipContent side="top" className="max-w-[300px] text-xs">
|
||||||
{tooltipText}
|
{tooltipText}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue