Skip to content

Add search inside code snippets across all tasks 馃攳#537

Description

@anoopcodehack

Add search inside code snippets across all tasks 馃攳

File: client/src/pages/Dashboard.jsx

Search only finds task titles 馃拃
Can't search inside code snippets fr!!

Fix: extend search to include snippets:
const filteredTasks = tasks.filter(t => {
const titleMatch = t.title
.toLowerCase()
.includes(searchQuery.toLowerCase())
const snippetMatch = t.snippets?.some(s =>
s.code.toLowerCase()
.includes(searchQuery.toLowerCase())
)
return titleMatch || snippetMatch
})

// show snippet match indicator on card:
{task.snippets?.some(s =>
s.code.toLowerCase().includes(searchQuery)
) && (

</> snippet match

)}

~10 lines! No backend needed 馃幆

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions