Skip to content

Add text search to the My Entries page - #20

Merged
normanajn merged 1 commit into
mainfrom
feature/user-entry-search
Jun 25, 2026
Merged

normanajn merged 1 commit into
mainfrom
feature/user-entry-search

Conversation

@normanajn

Copy link
Copy Markdown
Collaborator

Adds a simple text search to the My Entries page, addressing #18.

Changes

  • EntryListView.get_queryset applies a q filter across the user's own entries by title, description, or tag name (Q(title__icontains) | Q(description__icontains) | Q(tags__name__icontains), with .distinct() so multi-tag matches aren't duplicated).
  • entries/list.html gains a search input plus Search and Clear buttons; q is preserved through pagination and the empty state is updated.
  • 6 new tests in tests/test_entries.py (title/description/tag matching, own-entries scoping, no-match empty state, no duplicate rows).

Notes

  • Search is a GET filter applied on top of the existing author=request.user queryset, so it can only ever surface the requesting user's own entries, and it composes with the existing project filter.

Closes #18

🤖 Generated with Claude Code

Add a simple search box to the user's My Entries list that filters
their own entries by title, description, or tag name. The search is a
GET filter, so it composes with the existing project filter and
survives pagination. Includes Search and Clear buttons and an updated
empty state.

Closes #18

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 25, 2026 16:04
@normanajn
normanajn merged commit fd8ccce into main Jun 25, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a simple text search on the “My Entries” list so users can filter their own entries using a q query parameter (including matches on title, description, and tag name), addressing issue #18.

Changes:

  • Extend EntryListView.get_queryset() to apply a q filter across title/description/tag name with distinct() to avoid duplicates.
  • Add a search input plus Search/Clear UI, and preserve q through pagination.
  • Add new tests covering title/description/tag matching, own-entry scoping, empty-state messaging, and deduplication.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/test_entries.py Adds search-focused list view tests (matching, scoping, empty state, no duplicates).
apps/entries/views.py Implements the q filter in the list queryset and exposes search_query to the template.
apps/entries/templates/entries/list.html Adds search form controls, preserves query params during pagination, and updates empty state/CTAs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +18 to +21
<label class="block text-xs font-medium text-slate-500 mb-1">Search</label>
<input type="text" name="q" value="{{ search_query }}"
placeholder="Title, description, or tag…"
class="w-full sm:w-64 rounded-md border border-slate-300 px-3 py-1.5 text-sm focus:border-scd-primary focus:ring-1 focus:ring-scd-primary focus:outline-none">
Comment on lines +115 to +121
{% if search_query or selected_project %}No entries match your search.{% else %}No entries yet.{% endif %}
</p>
{% if search_query or selected_project %}
<a href="{% url 'entries:list' %}"
class="inline-block bg-slate-100 hover:bg-slate-200 text-slate-700 text-sm font-medium px-4 py-2 rounded-md transition-colors">
Clear search
</a>
@normanajn
normanajn deleted the feature/user-entry-search branch June 25, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Simple Search Capability for Users

2 participants