Repository navigation
fix(tasks): limit similar task suggestions - #4799
ehayes2000 merged 1 commit into
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe similar tasks component introduces a maximum of two displayed similarity matches and applies that limit when the search input is non-empty. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with 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.
Inline comments:
In `@apps/web/src/features/block-md/component/TaskDuplicateList.tsx`:
- 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.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: b936cce1-37a4-4c92-915a-e22c067e0a45
📒 Files selected for processing (1)
apps/web/src/features/block-md/component/TaskDuplicateList.tsx
| }; | ||
| const results = (): TaskSimilarityResult[] => | ||
| hasInput() ? (similarity.data ?? []) : []; | ||
| hasInput() ? (similarity.data ?? []).slice(0, MAX_SIMILAR_TASKS) : []; |
There was a problem hiding this comment.
🎯 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 -SRepository: 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.tsxRepository: 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 -SRepository: 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.
Limits the task creation modal to the top two similar task suggestions for task cC26nhLULXNaULMaaCff7.