0 ? { borderTop: `1px solid ${theme.colors.border}22` } : undefined
- }
- >
- {/* Drop Indicator Line - Before */}
- {showDropIndicatorBefore && (
-
!doc.isMissing && handleDragStart(e, doc.id)}
- onDrag={handleDrag}
- onDragOver={(e) => handleDragOver(e, doc.id, index)}
- onDrop={handleDrop}
- onDragEnd={handleDragEnd}
- className={`flex items-center gap-3 px-3 py-2 transition-all ${
- isBeingDragged ? 'opacity-50' : ''
- } hover:bg-white/5 ${doc.isMissing ? 'opacity-60' : ''}`}
- style={{
- backgroundColor: doc.isMissing ? theme.colors.error + '08' : undefined,
- }}
- >
- {/* Drag Handle */}
-
-
- {/* Document Name - truncates from left to show filename */}
-
- {doc.filename}.md
-
-
- {/* Missing Indicator */}
- {doc.isMissing && (
-
- Missing
-
- )}
-
- {/* Task Count Badge (invisible placeholder for missing docs) */}
- {!doc.isMissing ? (
-
- {loadingTaskCounts
- ? '...'
- : `${docTaskCount} ${docTaskCount === 1 ? 'task' : 'tasks'}`}
-
- ) : (
-
0 tasks
- )}
-
- {/* Reset Toggle Button (invisible placeholder for missing docs) */}
- {!doc.isMissing ? (
- (() => {
- const hasDuplicates =
- documents.filter((d) => d.filename === doc.filename).length > 1;
- const canDisableReset = !hasDuplicates;
-
- const modifierKey = formatMetaKey();
- let tooltipText: string;
- if (doc.resetOnCompletion) {
- if (canDisableReset) {
- tooltipText =
- 'Reset enabled: uncompleted tasks will be re-checked when done. Click to disable.';
- } else {
- tooltipText =
- 'Reset enabled: uncompleted tasks will be re-checked when done. Remove duplicates to disable.';
- }
- } else {
- tooltipText = `Enable reset, or ${modifierKey}+drag to copy`;
- }
-
- return (
-
{
- if (!doc.resetOnCompletion || canDisableReset) {
- handleToggleReset(doc.id);
- }
- }}
- className={`p-1 rounded transition-colors shrink-0 ${
- doc.resetOnCompletion
- ? canDisableReset
- ? 'hover:bg-white/10'
- : 'cursor-not-allowed'
- : 'hover:bg-white/10'
- }`}
- style={{
- backgroundColor: doc.resetOnCompletion
- ? theme.colors.accent + '20'
- : 'transparent',
- color: doc.resetOnCompletion
- ? theme.colors.accent
- : theme.colors.textDim,
- opacity: doc.resetOnCompletion && !canDisableReset ? 0.7 : 1,
- }}
- title={tooltipText}
- >
-
-
- );
- })()
- ) : (
-
-
-
- )}
-
- {/* Duplicate Button (invisible placeholder when not applicable) */}
- {doc.resetOnCompletion && !doc.isMissing ? (
-
handleDuplicateDocument(doc.id)}
- className="p-1 rounded hover:bg-white/10 transition-colors shrink-0"
- style={{ color: theme.colors.textDim }}
- title="Duplicate document"
- >
-
-
- ) : (
-
-
-
- )}
-
- {/* Remove Button */}
-
handleRemoveDocument(doc.id)}
- className="p-1 rounded hover:bg-white/10 transition-colors shrink-0"
- style={{
- color: doc.isMissing ? theme.colors.error : theme.colors.textDim,
- }}
- title={doc.isMissing ? 'Remove missing document' : 'Remove document'}
- >
-
-
-
-
- {/* Drop Indicator Line - After (only for last item) */}
- {showDropIndicatorAfter && (
-