lmnr-ai / lmnr

Laminar - open-source all-in-one platform for engineering AI products. Crate data flywheel for you AI app. Traces, Evals, Datasets, Labels. YC S24.
https://www.lmnr.ai
Apache License 2.0
1.18k stars 59 forks source link

Reset pageNumber to 0 when changing filters #150

Closed dinmukhamedm closed 2 weeks ago

dinmukhamedm commented 3 weeks ago

This is true for any table with [manual] pagination, spans and traces are a good candidate

Reproduction step

Expected behavior

I can see my traces for the last hour

Actual behavior

I see an empty page, because I am in page 3/1

TODO: Reset pageNumber to 0 when filters change. We can be smart here, e.g. do this only if filters change or if the time range decreases. If we merely increase the time range, it probably makes sense to stay on the same page

sarthakvijayvargiya commented 2 weeks ago

@dinmukhamedm Hey! Could we work on this together? I’ll ask for help if I run into any issues.

dinmukhamedm commented 2 weeks ago

Sure @sarthakvijayvargiya let's work together. I gave it another thought, and I think it makes sense to control/parse the page size and page number to/from the URL params right inside the DataTablePagination component. Let me know if you have further questions!

sarthakvijayvargiya commented 2 weeks ago

Thanks for the guidance! I don't have any questions right now, but I’ll reach out if anything comes up.

sarthakvijayvargiya commented 2 weeks ago

Hi @dinmukhamedm to reproduce this issue, should I set up a dummy project and integrate Laminar into it, or is there another way to replicate the bug?

dinmukhamedm commented 2 weeks ago

@sarthakvijayvargiya First off when you spin up laminar locally, you will have to create a Laminar project any way. Then you have two options:

  1. Send traces from a toy python/js project (no need for LLM calls, you could just observe your functions.
  2. Seed the database with a bit of fake data. For this option you will need to
    1. cd frontend && npx drizzle-kit studio
    2. go to https://local.drizzle.studio/ and in the SQL editor run some SQL to insert fake traces and spans.

I will add some SQL fake data to this comment a little bit later today, but let me know if you managed to go with option 1

sarthakvijayvargiya commented 2 weeks ago

I tried above steps - I have started laminar locally , created project.

  1. In first options - Tried to observe function ,but kept getting this error image
  2. image

dinmukhamedm commented 2 weeks ago

Fixed via #208