Skip to content

feat: add sort and status filter to dashboard article list - #109

Merged
kingRayhan merged 3 commits into
mainfrom
copilot/feat-create-sorter-dashboard-article-list
Apr 4, 2026
Merged

feat: add sort and status filter to dashboard article list#109
kingRayhan merged 3 commits into
mainfrom
copilot/feat-create-sorter-dashboard-article-list

Conversation

CopilotAI commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

Dashboard article list had no sorting or filtering — all articles were returned newest-first with no way to filter by publish status.

Changes

Backend

  • myArticleInput schema — adds sort_by (created_at | title | published_at, default created_at), sort_order (asc | desc, default desc), and status (all | published | draft, default all)
  • myArticles action — applies dynamic orderBy via sqlkit asc/desc and status filter via isNull/isNotNull on published_at; adds asc, isNull, isNotNull to sqlkit imports

Frontend (DashboardArticleList)

  • Adds useState for sortBy, sortOrder, status; all three are included in the TanStack Query queryKey so the list refetches on change
  • Renders a toolbar below the header:
    • Status tabs: All / Published / Draft (segmented button group)
    • Sort field dropdown: Created at / Title / Published at
    • Order toggle: ↑ Ascending / ↓ Descending
  • cancelQueries in both optimistic-update mutations updated to use the full query key
// query key now tracks sort state — changing any control triggers a fresh fetch
queryKey: ["dashboard-articles",sortBy,sortOrder,status]

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh gh issue list (http block)
    • Triggering command: /usr/bin/gh gh issue list --state open (http block)
    • Triggering command: `/usr/bin/gh gh issue comment 108 --body ## Summary

Implemented a sorter/filter toolbar in the dashboard article list as requested in #108.

What Changed

Backend (src/backend/services/inputs/article.input.ts)

  • Extended myArticleInput Zod schema with three new optional fields (all w` (http block)

If you need me to access, download, or install something from one of these locations, you can either:

CopilotAIand others added 2 commits April 4, 2026 15:53
- Add sort_by (title/created_at/published_at), sort_order (asc/desc), and status (all/published/draft) to myArticleInput schema
- Update myArticles action to apply dynamic sorting and status filtering via sqlkit asc/isNull/isNotNull
- Add sorter toolbar to DashboardArticleList with status filter tabs, sort field dropdown, and sort order toggle button
Agent-Logs-Url: https://github.com/techdiary-dev/techdiary.dev/sessions/a0bc19b6-228e-48b9-8d7b-e5422cb0c559
Co-authored-by: kingRayhan <7611746+kingRayhan@users.noreply.github.com>
CopilotAI changed the title [WIP] Add sorter for articles by title, status, and published datefeat: add sort and status filter to dashboard article listApr 4, 2026
CopilotAI requested a review from kingRayhanApril 4, 2026 15:56
@kingRayhan

Copy link
Copy Markdown
Member
Image

The feature is working fine #109, thanks @copilot
CC: @shoaibsharif

CopilotAI requested a review from kingRayhanApril 4, 2026 16:06
@kingRayhan
kingRayhan merged commit 55ea86e into mainApr 4, 2026
1 check passed
@kingRayhan
kingRayhan deleted the copilot/feat-create-sorter-dashboard-article-list branch April 4, 2026 16:54
Sign up for freeto 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.

feat: create a sorter in dashboard article list

2 participants

@kingRayhan