Skip to content

Conversation

@rknoche6
Copy link

@rknoche6 rknoche6 commented Jan 31, 2026

  • Added countPublicSkills query to convex/skills.ts
  • Updated SkillsIndex to fetch and display the count
  • Fixed missing undici dependency for e2e tests
  • Applied biome formatting
Screenshot 2026-01-31 at 17 33 31

Greptile Overview

Greptile Summary

This PR adds a new Convex query (countPublicSkills) and wires it into the /skills route to display a total count in the page header. It also adds undici as a dev dependency (and updates bun.lock) to fix missing dependency issues in e2e tests, and applies a small Biome-driven import reordering in src/lib/og.ts.

Main integration point is src/routes/skills/index.tsx, which now calls useQuery(api.skills.countPublicSkills) alongside the existing paginated public skills query to show the total.

Confidence Score: 3/5

  • This PR is likely safe to merge, but the new count query can become a scalability bottleneck as data grows.
  • UI change is small and dependency addition is straightforward, but countPublicSkills currently loads all active skills into memory to count them, which can degrade performance and potentially hit Convex query limits on larger datasets since it’s fetched on every /skills page load.
  • convex/skills.ts (countPublicSkills implementation)

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

Context used:

  • Context from dashboard - AGENTS.md (source)

@vercel
Copy link
Contributor

vercel bot commented Jan 31, 2026

@rknoche is attempting to deploy a commit to the Amantus Machina Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

convex/skills.ts Outdated
Comment on lines 744 to 751
export const countPublicSkills = query({
args: {},
handler: async (ctx) => {
const skills = await ctx.db
.query('skills')
.withIndex('by_active_updated', (q) => q.eq('softDeletedAt', undefined))
.collect()
return skills.length
Copy link

Choose a reason for hiding this comment

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

[P1] countPublicSkills does a full .collect() and then returns skills.length, which will scan and materialize every active skill doc. On larger datasets this will be slow and can hit Convex limits, especially since /skills mounts it unconditionally via useQuery. Prefer a count/index-driven approach (e.g., maintain an activeSkillsCount in a singleton doc updated on create/soft-delete) rather than fetching all docs just to count them.

Prompt To Fix With AI
This is a comment left during a code review.
Path: convex/skills.ts
Line: 744:751

Comment:
[P1] `countPublicSkills` does a full `.collect()` and then returns `skills.length`, which will scan and materialize *every* active skill doc. On larger datasets this will be slow and can hit Convex limits, especially since `/skills` mounts it unconditionally via `useQuery`. Prefer a count/index-driven approach (e.g., maintain an `activeSkillsCount` in a singleton doc updated on create/soft-delete) rather than fetching all docs just to count them.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines 228 to 231
<h1 className="section-title" style={{ marginBottom: 8 }}>
Skills
Skills{' '}
{totalSkills !== undefined && <span style={{ opacity: 0.5 }}>{totalSkills}</span>}
</h1>
Copy link

Choose a reason for hiding this comment

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

[P3] The header currently renders Skills{' '}{totalSkills...} which shows a bare number with no delimiter/label. This can read as part of the title and may be confusing for screen readers. Consider formatting as e.g. Skills (123) or adding an aria-label/visually-hidden label for the count.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/routes/skills/index.tsx
Line: 228:231

Comment:
[P3] The header currently renders `Skills{' '}{totalSkills...}` which shows a bare number with no delimiter/label. This can read as part of the title and may be confusing for screen readers. Consider formatting as e.g. `Skills (123)` or adding an `aria-label`/visually-hidden label for the count.

How can I resolve this? If you propose a fix, please make it concise.

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.

2 participants