Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix user pagination and page setting #3056

Merged
merged 1 commit into from
Dec 13, 2024
Merged

Conversation

chitalian
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Dec 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
helicone 🔄 Building (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 5:47am
helicone-bifrost 🔄 Building (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 5:47am
helicone-eu 🔄 Building (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 5:47am

@chitalian chitalian merged commit d3f8bc1 into main Dec 13, 2024
5 of 8 checks passed
@chitalian chitalian deleted the fixed-userpage-pagination branch December 13, 2024 05:47
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.

PR Summary

This PR modifies user pagination and time filtering functionality in the Helicone web application.

  • Added time filter parameter to useUsers hook in /web/services/hooks/users.tsx but count endpoint doesn't use combined filter
  • Switched from prop-based to URL query parameter state management in /web/components/templates/users/usersPageV2.tsx
  • Inconsistency between default sort direction ('asc') and fallback ('desc') in user page sorting
  • Updated page size options and defaults for user table pagination
  • Added useQueryParam hook for URL parameter synchronization

2 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +70 to +73
const [sortDirection, setSortDirection] = useQueryParam(
"sortDirection",
"asc"
);
Copy link

Choose a reason for hiding this comment

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

logic: Default sortDirection is 'asc' but fallback on line 89 uses 'desc'. This inconsistency could cause unexpected sorting behavior.

Comment on lines 93 to 102
const { users, count, from, isLoading, to, refetch } = useUsers(
currentPage,
pageSize,
parseInt(currentPage, 10),
parseInt(pageSize, 10),
sortLeaf,
filterUITreeToFilterNode(
userTableFilters.sort((a, b) => a.label.localeCompare(b.label)),
debouncedAdvancedFilters
)
// timeFilter
);
Copy link

Choose a reason for hiding this comment

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

style: refetch is imported but never used after removing the refetch calls from page change handlers

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.

1 participant