Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
} from 'solid-js';

const DEBOUNCE_MS = 300;
const MAX_SIMILAR_TASKS = 2;

type DebouncedInput = { title: string; markdown: string };

Expand Down Expand Up @@ -50,7 +51,7 @@ function SimilarTasksInner(props: {
return input.title.trim().length > 0 || input.markdown.trim().length > 0;
};
const results = (): TaskSimilarityResult[] =>
hasInput() ? (similarity.data ?? []) : [];
hasInput() ? (similarity.data ?? []).slice(0, MAX_SIMILAR_TASKS) : [];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate the referenced file and relevant composer usages
git ls-files 'apps/web/src/features/block-md/component/TaskDuplicateList.tsx' \
  'apps/web/src/**' | sed -n '1,20p'

echo '--- outline TaskDuplicateList.tsx ---'
ast-grep outline apps/web/src/features/block-md/component/TaskDuplicateList.tsx --view expanded || true

echo '--- search for MAX_SIMILAR_TASKS and SimilarTasksInner / ComposeTask ---'
rg -n "MAX_SIMILAR_TASKS|SimilarTasksInner|ComposeTask|cC26nhLULXNaULMaaCff7|similarity\.data" apps/web/src -S

Repository: macro-inc/macro

Length of output: 3263


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect file contents around the cited line
wc -l apps/web/src/features/block-md/component/TaskDuplicateList.tsx
sed -n '1,180p' apps/web/src/features/block-md/component/TaskDuplicateList.tsx

Repository: macro-inc/macro

Length of output: 5623


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find any task-specific gating around this feature
rg -n "cC26nhLULXNaULMaaCff7|similarity|duplicate task|duplicate list|two matches|MAX_SIMILAR_TASKS" apps/web/src -S

Repository: macro-inc/macro

Length of output: 1384


Scope the two-result cap to the intended task. TaskDuplicateList.tsx truncates every SimilarTasksInner instance to two matches, and ComposeTask uses this section in the generic composer flow. If this should only apply to one task, gate it upstream or pass task context through here so other tasks keep valid suggestions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/web/src/features/block-md/component/TaskDuplicateList.tsx` at line 54,
Update the duplicate-list flow around TaskDuplicateList and ComposeTask so the
MAX_SIMILAR_TASKS truncation applies only to the intended task, not every
SimilarTasksInner instance. Gate the cap upstream or pass task context into
TaskDuplicateList, while preserving the full valid suggestions for other tasks.

const ids = () => results().map((result) => result.taskId);

// Hydrate full soup entities (status, owner, assignees, …) for the matches so
Expand Down
Loading