[PR #98] [MERGED] fix(skills): keep global sorting across pagination #255

Closed
opened 2026-02-15 17:16:31 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/openclaw/clawhub/pull/98
Author: @CodeBBakGoSu
Created: 2/2/2026
Status: Merged
Merged: 2/14/2026
Merged by: @steipete

Base: mainHead: fix/skill-sorting


📝 Commits (10+)

  • ef8093f fix: initial skill sorting
  • fee4770 chore: update unit test
  • 06046c4 fix: use correct indexes for skill sorting
  • 219b825 chore: cleanup
  • 53183d8 fix(skills): preserve server order for paginated sorting
  • 886237e chore(lint): apply biome formatting fixes
  • f3787b8 chore(convex): bump tsconfig lib to ES2022
  • d27a1a0 fix(skills): add deterministic tie-breaker for search sorting
  • 968e01c Merge branch 'main' into fix/skill-sorting
  • d740a8e Merge origin/main into fix/skill-sorting

📊 Changes

6 files changed (+103 additions, -30 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 convex/skills.ts (+5 -12)
📝 convex/tsconfig.json (+21 -3)
📝 src/__tests__/skills-index-load-more.test.tsx (+0 -3)
📝 src/__tests__/skills-index.test.tsx (+55 -3)
📝 src/routes/skills/index.tsx (+21 -9)

📄 Description

What changed

  • Keep server ordering for the paginated skills list (no client-side re-sort when browsing without a search query)
  • Align listPublicPageV2 default dir with UI semantics (name defaults to asc)

Why

Sorting by stars/installs/downloads should apply to the full dataset, not only within the currently loaded page(s).

Test plan

  • bun run test
  • bun run lint

UI verification (screenshot)

image
  • Visit /skills?sort=stars&dir=desc and confirm the top rows show the highest star counts.

Related: #92

Greptile Overview

Greptile Summary

This PR updates the public skills listing to preserve global sorting across pagination by relying on server-side ordering (instead of re-sorting paginated results on the client). It also extends the Convex listPublicPageV2 query to accept sort/dir parameters and adds new skills indexes to support those sort modes efficiently, plus updates the UI and unit tests to pass the new defaults.

Key touchpoints:

  • convex/schema.ts: adds several by_active_* indexes to filter out soft-deleted skills while sorting.
  • convex/skills.ts: introduces SORT_INDEXES and uses it in listPublicPageV2 with configurable sort/dir.
  • src/routes/skills/index.tsx: passes sort/dir to the paginated query and avoids client-side sorting when not searching.
  • Tests/import ordering: updates expectations and applies formatting tweaks.

Confidence Score: 4/5

  • This PR is generally safe to merge; the main risk is subtle ordering inconsistencies between server pagination and client search sorting for equal-valued stats.
  • Changes are scoped and mostly adjust sort/pagination behavior using new indexes. The only notable concern is mismatched tie-breakers between server-side index ordering and client-side comparators, which can cause confusing reordering when many skills share the same stat values or when switching between search and non-search paths.
  • convex/skills.ts and src/routes/skills/index.tsx (sorting semantics/tie-breakers)

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

Context used:

  • Context from dashboard - AGENTS.md (source)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/openclaw/clawhub/pull/98 **Author:** [@CodeBBakGoSu](https://github.com/CodeBBakGoSu) **Created:** 2/2/2026 **Status:** ✅ Merged **Merged:** 2/14/2026 **Merged by:** [@steipete](https://github.com/steipete) **Base:** `main` ← **Head:** `fix/skill-sorting` --- ### 📝 Commits (10+) - [`ef8093f`](https://github.com/openclaw/clawhub/commit/ef8093f089a6114e95c45b2927c289008f53ae5a) fix: initial skill sorting - [`fee4770`](https://github.com/openclaw/clawhub/commit/fee477051ceffb35b10c1c378364a4af18c345f4) chore: update unit test - [`06046c4`](https://github.com/openclaw/clawhub/commit/06046c4ccb0aa33f2389f77e85d6c492d1108ecb) fix: use correct indexes for skill sorting - [`219b825`](https://github.com/openclaw/clawhub/commit/219b825c6c1a96c2108f16960817b7a75e5b1bbd) chore: cleanup - [`53183d8`](https://github.com/openclaw/clawhub/commit/53183d8127ec27450dae9cf9bbcd9fb15001f678) fix(skills): preserve server order for paginated sorting - [`886237e`](https://github.com/openclaw/clawhub/commit/886237e238565374d387bdf5dd7707d6832c9b88) chore(lint): apply biome formatting fixes - [`f3787b8`](https://github.com/openclaw/clawhub/commit/f3787b86617bbbd02e5c26a13e01b1f46fa96ab6) chore(convex): bump tsconfig lib to ES2022 - [`d27a1a0`](https://github.com/openclaw/clawhub/commit/d27a1a0107f3f6f8ff5a5aa5d2f98bc13659f482) fix(skills): add deterministic tie-breaker for search sorting - [`968e01c`](https://github.com/openclaw/clawhub/commit/968e01c5509462b5ce2ea2e7c27e6ed6e4fd46e2) Merge branch 'main' into fix/skill-sorting - [`d740a8e`](https://github.com/openclaw/clawhub/commit/d740a8e746a02da0f81578609afca1af63ed46f1) Merge origin/main into fix/skill-sorting ### 📊 Changes **6 files changed** (+103 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `convex/skills.ts` (+5 -12) 📝 `convex/tsconfig.json` (+21 -3) 📝 `src/__tests__/skills-index-load-more.test.tsx` (+0 -3) 📝 `src/__tests__/skills-index.test.tsx` (+55 -3) 📝 `src/routes/skills/index.tsx` (+21 -9) </details> ### 📄 Description ## What changed - Keep server ordering for the paginated skills list (no client-side re-sort when browsing without a search query) - Align `listPublicPageV2` default `dir` with UI semantics (`name` defaults to `asc`) ## Why Sorting by stars/installs/downloads should apply to the full dataset, not only within the currently loaded page(s). ## Test plan - bun run test - bun run lint ## UI verification (screenshot) <img width="941" height="1033" alt="image" src="https://github.com/user-attachments/assets/693ac682-3f66-4caf-a83d-b1905c18ab15" /> - Visit `/skills?sort=stars&dir=desc` and confirm the top rows show the highest star counts. Related: #92 <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR updates the public skills listing to preserve global sorting across pagination by relying on server-side ordering (instead of re-sorting paginated results on the client). It also extends the Convex `listPublicPageV2` query to accept `sort`/`dir` parameters and adds new `skills` indexes to support those sort modes efficiently, plus updates the UI and unit tests to pass the new defaults. Key touchpoints: - `convex/schema.ts`: adds several `by_active_*` indexes to filter out soft-deleted skills while sorting. - `convex/skills.ts`: introduces `SORT_INDEXES` and uses it in `listPublicPageV2` with configurable `sort`/`dir`. - `src/routes/skills/index.tsx`: passes `sort`/`dir` to the paginated query and avoids client-side sorting when not searching. - Tests/import ordering: updates expectations and applies formatting tweaks. <h3>Confidence Score: 4/5</h3> - This PR is generally safe to merge; the main risk is subtle ordering inconsistencies between server pagination and client search sorting for equal-valued stats. - Changes are scoped and mostly adjust sort/pagination behavior using new indexes. The only notable concern is mismatched tie-breakers between server-side index ordering and client-side comparators, which can cause confusing reordering when many skills share the same stat values or when switching between search and non-search paths. - convex/skills.ts and src/routes/skills/index.tsx (sorting semantics/tie-breakers) <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> **Context used:** - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=a1d58d20-b4dd-4cbb-973a-9fd7824e1921)) <!-- /greptile_comment --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 17:16:31 -05:00
yindo closed this issue 2026-02-15 17:16:31 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: openclaw/clawhub#255