Skip to content

feat: Add pagination to data browser #2659

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

Merged
merged 21 commits into from
Apr 6, 2025

Conversation

dblythy
Copy link
Member

@dblythy dblythy commented Feb 28, 2025

New Pull Request Checklist

Issue Description

Closes: #2571

Approach

TODOs before merging

  • Add tests
  • Add changes to documentation (guides, repository pages, in-code descriptions)

Copy link

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant bot changed the title feat: add paging feat: Add paging Feb 28, 2025
Copy link

parse-github-assistant bot commented Feb 28, 2025

🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review.

Copy link

uffizzi-cloud bot commented Feb 28, 2025

Uffizzi Ephemeral Environment deployment-61441

⌚ Updated Feb 28, 2025, 14:54 UTC

☁️ https://app.uffizzi.com/github.com/parse-community/parse-dashboard/pull/2659

📄 View Application Logs etc.

What is Uffizzi? Learn more

@dblythy dblythy requested a review from a team March 2, 2025 06:55
@mtrezza mtrezza changed the title feat: Add paging feat: Add paging to data browser Mar 3, 2025
@mtrezza mtrezza changed the title feat: Add paging to data browser feat: Add pagination to data browser Mar 3, 2025
Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

Great feature!

  •  There are the vars const MAX_ROWS = 200; and const MAX_ROWS_FETCHED = 200; which set a hard limit to 200 rows. I think these need to be dynamic now that the number of rows per page can be set manually. For example, if we add a new value like 500 to the list of {[10, 20, 50, 100, 200, 500].map((size) , there should be 500 rows rendered. I think query.limit(MAX_ROWS_FETCHED); essentially makes the dashboard fetch 200 rows, but if the rows/page value is lower, less rows get displayed, so the dashboard may be fetching rows that are not even shown?
  •  When clicking on the next / previous button, the data browser should jump to the top. Otherwise, especially when clicking on "next", the user'd have to scroll up to continue seeing data that is sorted by a date for example.
  •  Instead of adding an empty space to the top of the BrowserFooter, add a light gray line and ensure the bar is the same hight as the bottom bar in the menu column on the left. Also reduce size of next/previous buttons.
  •  The number of items per page should be set dashboard wide and remembered across sessions. I assume dashboard already has a data store for that. Let's do this: after install, dashboard has a default rows/page of 100. If the user changes the value, that value is stored in the data store and used as default rows/page value for all newly opened dashboard tabs and sessions. In other words, changing the value in any tab simply sets that value as the new default for all newly opened tabs.
  • Reset current page when changing class or applying filter. For example, currently, when on page 2 and then navigating to a class that has only 1 page, no objects are displayed because page 2 does not exist.
  • Adjust font size

@dblythy
Copy link
Member Author

dblythy commented Mar 4, 2025

What do you mean by

Instead of adding an empty space to the top of the BrowserFooter, add a light gray line and ensure the bar is the same hight as the bottom bar in the menu column on the left. Also reduce size of next/previous buttons.

@mtrezza mtrezza closed this Mar 6, 2025
@mtrezza mtrezza reopened this Mar 6, 2025
Copy link

uffizzi-cloud bot commented Mar 6, 2025

Uffizzi Ephemeral Environment deployment-61596

⌚ Updated Mar 06, 2025, 00:08 UTC

☁️ https://app.uffizzi.com/github.com/parse-community/parse-dashboard/pull/2659

📄 View Application Logs etc.

What is Uffizzi? Learn more

@mtrezza
Copy link
Member

mtrezza commented Mar 6, 2025

I was referring to the height difference between the top edge of the new FooterBar for pagination and the existing menu bar on the left side, see red lines in screenshot. I also meant that there is no visible separation between the new footer bar and the data cells, so maybe add a light gray line for the top corner, or add a light gray background color, see green circle in screenshot

image

Btw, there's also a new issue since the last commits where the pagination buttons are disabled.

@dblythy
Copy link
Member Author

dblythy commented Mar 18, 2025

Btw, there's also a new issue since the last commits where the pagination buttons are disabled.

What do you mean? From my testing they only disable when there isn't enough data

@mtrezza
Copy link
Member

mtrezza commented Mar 18, 2025

Yes, I have observed the buttons disabled even though there was more data. I was able to reproduce the issue several times. Have there been any changes in the recent commits that could have caused this? I haven't observed that when I wrote the previous feedback.

@dblythy
Copy link
Member Author

dblythy commented Mar 18, 2025

Screenshot 2025-03-18 at 8 35 11 pm

If you don't mind, could you possibly provide some replication steps and/or a screenshot? I've been unable to replicate the bug

@mtrezza
Copy link
Member

mtrezza commented Mar 18, 2025

Sure, let me try

@dblythy
Copy link
Member Author

dblythy commented Mar 23, 2025

@mtrezza let me know how you go when you get the chance 😊

@mtrezza
Copy link
Member

mtrezza commented Mar 23, 2025

Sure, I'll take a look in a bit...

Copy link

uffizzi-cloud bot commented Mar 23, 2025

Uffizzi Ephemeral Environment deployment-62155

⌚ Updated Mar 23, 2025, 14:21 UTC

☁️ https://app.uffizzi.com/github.com/parse-community/parse-dashboard/pull/2659

📄 View Application Logs etc.

What is Uffizzi? Learn more

@mtrezza
Copy link
Member

mtrezza commented Mar 23, 2025

I was able to reproduce.

  1. Open Uffizi
  2. Create class "Test".
  3. Run the following to the JS API console:
    const promises = [];
      for (let i = 0; i<100; i++) {
        const myObj = new Parse.Object('Test');
          for (let f = 0; f<30; f++) {
            myObj.set(`field${f}`, 'Hello World!')
          }
        promises.push(myObj.save());
      }
      await Promise.all(promises);
    
  4. Navigate to "Test" class.
  5. The buttons are disabled, the page values show "1 / 0".

I think that is because the total number of records in the class is also determined to be "0", as shown next to the class name. After refreshing the browser tab, the records counter updates to the correct value and paging works. I understand that the paging is depending on that counter value, that's fine. If the number of total records in a class did not update also before this PR, i.e. the bug was not introduced by this PR, then we can ignore it in this PR.

And could you please fix the merge conflicts?

Screen.Recording.2025-03-23.at.15.56.24.mov

@mtrezza mtrezza closed this Mar 24, 2025
@mtrezza mtrezza reopened this Mar 24, 2025
@mtrezza
Copy link
Member

mtrezza commented Mar 24, 2025

@dblythy could you please fix the lint issues, and when this is ready, could you please request a review?

Copy link

uffizzi-cloud bot commented Mar 24, 2025

Uffizzi Ephemeral Environment deployment-62182

⌚ Updated Mar 24, 2025, 14:18 UTC

☁️ https://app.uffizzi.com/github.com/parse-community/parse-dashboard/pull/2659

📄 View Application Logs etc.

What is Uffizzi? Learn more

@mtrezza mtrezza closed this Mar 27, 2025
@mtrezza mtrezza reopened this Mar 27, 2025
Copy link

uffizzi-cloud bot commented Mar 27, 2025

Uffizzi Ephemeral Environment deployment-62253

⌚ Updated Mar 27, 2025, 01:11 UTC

☁️ https://app.uffizzi.com/github.com/parse-community/parse-dashboard/pull/2659

📄 View Application Logs etc.

What is Uffizzi? Learn more

@dblythy dblythy requested a review from a team March 31, 2025 07:44
@mtrezza mtrezza merged commit a3c8a11 into parse-community:alpha Apr 6, 2025
9 of 10 checks passed
parseplatformorg pushed a commit that referenced this pull request Apr 6, 2025
# [7.1.0-alpha.1](7.0.1-alpha.1...7.1.0-alpha.1) (2025-04-06)

### Features

* Add pagination to data browser ([#2659](#2659)) ([a3c8a11](a3c8a11))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 7.1.0-alpha.1

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Apr 6, 2025
parseplatformorg pushed a commit that referenced this pull request May 1, 2025
# [7.1.0](7.0.0...7.1.0) (2025-05-01)

### Bug Fixes

* Clicking on pointer in data browser when using pagination does not reset to first page ([#2767](#2767)) ([ab512e5](ab512e5))
* Dashboard crashes on login due to `passport` upgrade ([#2758](#2758)) ([ee74321](ee74321))
* Dashboard crashes when selecting app ([#2747](#2747)) ([8b0cfea](8b0cfea))
* Data browser filters "key exists" and "key does not exist" not working ([#2760](#2760)) ([0691b3c](0691b3c))
* Data browser filters "key exists" and "key does not exist" not working ([#2762](#2762)) ([099eca3](099eca3))
* Data loading indicator not showing when using pagination ([#2768](#2768)) ([62d7aec](62d7aec))
* Improperly aligned unfolding sub-items in context menu in data browser  ([#2713](#2713)) ([189c817](189c817))
* Logout bar layout not aligned with data browser navigation bar ([#2720](#2720)) ([01a2a1c](01a2a1c))
* Navigation bar in data browser is transparent and partly covers info panel ([#2717](#2717)) ([60b38a5](60b38a5))
* Obsolete, long-running data fetch request overrides displayed data of newer fetch request in the data browser ([#2715](#2715)) ([31668eb](31668eb))

### Features

* Add pagination to data browser ([#2659](#2659)) ([a3c8a11](a3c8a11))
* Allow row selection in data browser by dragging mouse outside of selection box column ([#2716](#2716)) ([7c0f607](7c0f607))
* Display filter list in data browser sorted alphabetically ([#2761](#2761)) ([0209a0d](0209a0d))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 7.1.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label May 1, 2025
Copy link

coderabbitai bot commented May 1, 2025

Warning

Rate limit exceeded

@parseplatformorg has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 24 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 35fc746 and 226d558.

📒 Files selected for processing (7)
  • src/dashboard/Data/Browser/Browser.react.js (14 hunks)
  • src/dashboard/Data/Browser/Browser.scss (1 hunks)
  • src/dashboard/Data/Browser/BrowserFooter.react.js (1 hunks)
  • src/dashboard/Data/Browser/BrowserFooter.scss (1 hunks)
  • src/dashboard/Data/Browser/BrowserTable.react.js (3 hunks)
  • src/dashboard/Data/Browser/EditRowDialog.react.js (2 hunks)
  • src/dashboard/Data/Browser/ObjectPickerDialog.react.js (4 hunks)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-alpha Released as alpha version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add page size and current page index to data browser
3 participants