feat(dashboard): add pagination, server-side search#1480
feat(dashboard): add pagination, server-side search#1480gora050 wants to merge 9 commits intoopenclaw:mainfrom
Conversation
|
@gora050 is attempting to deploy a commit to the 0xBuns Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryThis PR adds server-side pagination to the Publisher Dashboard's skills list, replacing the old Key changes
Issues found
Confidence Score: 4/5Safe to merge with minor fixes — no data loss or security risk, but two edge-case correctness issues should be addressed before the feature is considered complete. The core pagination implementation is solid: the soft-delete filter runs inside Convex before pagination, so cursor integrity is maintained. The two remaining findings are both P2 edge cases (confusing 'No skills yet' + 'Load More' co-appearance, and silently dropped moderated skills on the owner's own dashboard), but they affect correctness of the dashboard view in real (if rare) scenarios, warranting a score of 4 rather than 5. src/routes/dashboard.tsx (empty-state / Load More coordination) and convex/skills.ts (toDashboardPage hidden-skill visibility for owners). Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/routes/dashboard.tsx
Line: 208-214
Comment:
**"Load More" can appear alongside the "No skills yet" empty state**
`skills.length === 0` is used to pick between the empty-state and the list, but `skillsStatus === "CanLoadMore"` is checked separately—outside that branch. If every item in the first page is filtered out by `toDashboardPage` (e.g. moderator-suspended skills for the owner, or non-public skills for a non-owner viewer), `paginatedSkills` will be empty while `usePaginatedQuery` still reports `CanLoadMore`. The result is the "No skills yet" message rendered above the "Load More" button simultaneously, which is confusing and implies there is nothing to load.
Guard the "Load More" / "LoadingMore" rows on `skills.length > 0`, or show them unconditionally outside the empty-state branch:
```suggestion
{skills.length === 0 && skillsStatus !== "CanLoadMore" ? (
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: convex/skills.ts
Line: 2263-2295
Comment:
**`toDashboardPage` silently drops owner-visible skills with non-`pending.scan` hidden status**
When `isOwnDashboard` is `true`, `toDashboardPage` shows a skill only if `toPublicSkill` succeeds (active status) OR `moderationReason === "pending.scan"`. Any other non-public state—e.g. `moderationStatus: "suspended"`, `"removed"`, or a future `"pending.human-review"` reason—will silently fall through to `return null` and be excluded from the owner's dashboard view.
This means an owner could lose visibility into why certain skills are absent. The original `api.skills.list` had the same blind spot, but `listDashboardPaginated` is explicitly described as a fuller owner view ("hidden skill versions remain visible here while checks are pending"), so the intent seems to be to expose more, not less.
Consider surfacing all non-deleted skills to their owner regardless of moderation state, or at minimum mapping every moderation status into a labelled entry rather than silently dropping it:
```ts
// inside isOwnDashboard branch — replace the isPending guard:
return {
_id: skill._id,
// ...fields...
pendingReview: skill.moderationStatus !== "active",
moderationStatus: skill.moderationStatus,
moderationReason: skill.moderationReason,
};
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (2): Last reviewed commit: "tests" | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 026b2929f9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 79d04b45d4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…, fix pagination filtering
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 89fcb1b600
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
|
Originally this PR also had dashboard search (server-side full-text by name/description). During review it became clear the whole search setup needs fixing — same issues exist in public /skills?q= (500-row cap on lexical fallback, zero-vector skills don’t show up in vector search). So instead of hacking a dashboard-only fix, I cut this PR down to just pagination. Will handle search properly in a follow-up. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d9531413d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const result = await ctx.db | ||
| .query("skills") | ||
| .withIndex("by_owner_publisher", (q) => q.eq("ownerPublisherId", ownerPublisherId)) |
There was a problem hiding this comment.
Include linked-user legacy skills in publisher pagination
listDashboardPaginated only paginates by_owner_publisher, but the existing skills.list behavior for personal publishers explicitly merges linked-user legacy rows (ownerPublisherId unset) so pre-backfill skills stay visible. This new path drops that fallback, so requests using ownerPublisherId can silently miss legacy personal skills and loadMore will never recover them because they are on a different index path.
Useful? React with 👍 / 👎.
| const result = await ctx.db | ||
| .query("skills") | ||
| .withIndex("by_owner_publisher", (q) => q.eq("ownerPublisherId", ownerPublisherId)) | ||
| .filter((q) => q.eq(q.field("softDeletedAt"), undefined)) |
There was a problem hiding this comment.
Avoid filtering soft-deletes after owner index scans
Both paginated branches call .filter(q => q.eq(q.field("softDeletedAt"), undefined)) after by_owner/by_owner_publisher, which forces Convex to read through deleted rows inside each owner partition before serving a page. For owners with many soft-deleted skills this can significantly inflate document reads and can hit read limits; this path should paginate on composite active-owner indexes instead of post-index filters.
Useful? React with 👍 / 👎.
Summary
export-1775137075662.mp4
(AI Assisted)
Changes
listDashboardPaginatedquery using Convex.paginate()for incremental loading of publisher skillsTest plan
/dashboardwith a publisher that has many skills — initial load shows 50, "Load More" fetches more