using ClaudeDo.Data.Models;

namespace ClaudeDo.Data.Filtering;

/// <summary>
/// Strategy that defines which tasks belong to a single list. One implementation
/// per list kind; consumers (counters, list loader) ask the registry for the
/// right strategy and never branch on the list id themselves.
/// </summary>
public interface ITaskListFilter
{
    /// <summary>The list id this filter applies to (e.g. "virtual:queued", "user:abc").</summary>
    string Id { get; }

    /// <summary>True if <paramref name="t"/> is a primary citizen of this list — appears as a row.</summary>
    bool Matches(TaskEntity t);

    /// <summary>True if <paramref name="t"/> should be counted in this list's badge.</summary>
    bool ShouldCount(TaskEntity t);

    /// <summary>
    /// True if <paramref name="t"/> is shown as a contextual row (not a primary citizen,
    /// but appears to host children that match). Default: nothing extra.
    /// </summary>
    bool MatchesAsContext(TaskEntity t, IReadOnlyList<TaskEntity> all) => false;
}
