Skip to content

feat: Add row number to data browser #2737

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

Open
wants to merge 8 commits into
base: alpha
Choose a base branch
from

Conversation

dblythy
Copy link
Member

@dblythy dblythy commented Apr 9, 2025

New Pull Request Checklist

Issue Description

Closes: #2484

Approach

TODOs before merging

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

Summary by CodeRabbit

  • New Features

    • Added visible row numbers to each row in the data browser for easier reference.
  • Style

    • Improved layout and alignment of row numbers and checkboxes for better readability.
    • Ensured row numbers remain visible when scrolling horizontally.
    • Adjusted spacing and alignment of checkbox elements for consistency.
  • Bug Fixes

    • Corrected style property naming for horizontal overflow to improve compatibility.
  • Enhancements

    • Incorporated pagination offset into row numbering for accurate indexing.

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 row number feat: Add row number Apr 9, 2025
Copy link

parse-github-assistant bot commented Apr 9, 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 Apr 9, 2025

Uffizzi Ephemeral Environment deployment-62613

⌚ Updated Apr 09, 2025, 11:41 UTC

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

📄 View Application Logs etc.

What is Uffizzi? Learn more

@mtrezza mtrezza closed this Apr 13, 2025
@mtrezza mtrezza reopened this Apr 13, 2025
Copy link

uffizzi-cloud bot commented Apr 13, 2025

Uffizzi Ephemeral Environment deployment-62726

⌚ Updated Apr 13, 2025, 14:29 UTC

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

📄 View Application Logs etc.

What is Uffizzi? Learn more

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.

Looks good, could you please:

  • consider pagination when calculating the row number, e.g. the first row number should the skip value + 1
  • dynamically adapt the width of the number column to the number text width

@parseplatformorg
Copy link
Contributor

parseplatformorg commented Apr 26, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

Copy link

coderabbitai bot commented Apr 28, 2025

Walkthrough

The changes introduce a row number column to the data browser interface. A new span element displaying the row number is added to each row in the BrowserRow component, styled with a new .rowNumber CSS class to ensure it remains visible and properly aligned. The row index calculation is updated to account for pagination offsets. The overall row width is increased to accommodate the new column, and minor style and structure adjustments are made to maintain consistency and alignment across the interface.

Changes

Files / Areas Changed Summary
src/components/BrowserRow/BrowserRow.react.js Added a span to display the row number at the start of each row in the table.
src/dashboard/Data/Browser/BrowserTable.react.js Updated row index calculation to include pagination offset; increased row width by 30px; fixed inline style key.
src/dashboard/Data/Browser/Browser.scss Added .rowNumber CSS class for sticky, styled row number column.
src/components/DataBrowserHeaderBar/DataBrowserHeaderBar.scss Adjusted .check class width, background, and padding for better alignment with new row number column.
src/dashboard/Data/Browser/Browser.react.js Passed skip prop to DataBrowser to support correct row number calculation with pagination.
src/dashboard/Data/Browser/BrowserToolbar.react.js Added an empty div after a menu item in the "Script" menu (no functional change).

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Browser as Browser.react.js
  participant Table as BrowserTable.react.js
  participant Row as BrowserRow.react.js

  User->>Browser: Interacts with Data Browser (pagination, scroll)
  Browser->>Table: Renders Data Table (passes skip prop)
  Table->>Row: Renders each BrowserRow (passes row + skip)
  Row->>Row: Displays (row + 1) in sticky row number column
Loading

Assessment against linked issues

Objective Addressed Explanation
Add a column at the beginning that shows the row number and is always visible (#2484)

Suggested labels

state:released-alpha


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 798c5bf and b3da107.

📒 Files selected for processing (1)
  • src/dashboard/Data/Browser/Browser.scss (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/dashboard/Data/Browser/Browser.scss
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Docker linux/amd64

🪧 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.

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 docstrings to generate docstrings for this 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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/dashboard/Data/Browser/BrowserToolbar.react.js (1)

437-437: Empty div element without clear purpose

This empty <div/> doesn't seem to serve any functional purpose. Consider removing it or adding a comment explaining its need if it's intended as a placeholder or for layout purposes.

-        <div/>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 62d7aec and 798c5bf.

📒 Files selected for processing (6)
  • src/components/BrowserRow/BrowserRow.react.js (1 hunks)
  • src/components/DataBrowserHeaderBar/DataBrowserHeaderBar.scss (1 hunks)
  • src/dashboard/Data/Browser/Browser.react.js (1 hunks)
  • src/dashboard/Data/Browser/Browser.scss (1 hunks)
  • src/dashboard/Data/Browser/BrowserTable.react.js (4 hunks)
  • src/dashboard/Data/Browser/BrowserToolbar.react.js (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Docker linux/amd64
🔇 Additional comments (7)
src/dashboard/Data/Browser/Browser.scss (1)

113-129: Well-implemented sticky row number styling!

The new .rowNumber class is well-designed with sticky positioning ensuring row numbers remain visible during horizontal scrolling. The style is consistent with existing patterns while adding necessary features for this specific use case.

src/components/DataBrowserHeaderBar/DataBrowserHeaderBar.scss (1)

55-57: Appropriate header styling adjustment

These changes correctly adjust the width and padding to accommodate the new row number column, ensuring proper alignment between header and data rows.

src/components/BrowserRow/BrowserRow.react.js (1)

74-74: Good implementation of row numbering

The row number display is implemented cleanly, with proper 1-indexed conversion for user-friendly display.

Please verify that the row prop accounts for pagination offsets to ensure row numbers are continuous across pages.

src/dashboard/Data/Browser/Browser.react.js (1)

2106-2106: Pagination offset now properly passed to DataBrowser

This change adds the current pagination offset to the DataBrowser component, allowing child components to calculate accurate row numbers that account for pagination.

src/dashboard/Data/Browser/BrowserTable.react.js (3)

127-127: Row width increased to accommodate row number column

The additional 30 pixels provides space for the new row number column being added to the data browser interface.


159-159: Row index now accounts for pagination

The row number for edit clone rows now includes the pagination offset (skip), ensuring consistent row numbering across pages.


332-332: Row index now accounts for pagination

The row number for data rows now includes the pagination offset (skip), ensuring consistent row numbering across pages.

@mtrezza mtrezza changed the title feat: Add row number feat: Add row number @coderabbitai Apr 28, 2025
@mtrezza mtrezza changed the title feat: Add row number @coderabbitai feat: Add row number to data browser Apr 28, 2025
@mtrezza mtrezza closed this Apr 28, 2025
@mtrezza mtrezza reopened this Apr 28, 2025
@parse-community parse-community deleted a comment from coderabbitai bot Apr 28, 2025
@parse-community parse-community deleted a comment from coderabbitai bot Apr 28, 2025
Copy link

uffizzi-cloud bot commented Apr 28, 2025

Uffizzi Ephemeral Environment deployment-63199

⌚ Updated Apr 28, 2025, 01:37 UTC

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

📄 View Application Logs etc.

What is Uffizzi? Learn more

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.

The column number width doesn't auto-resize, it is too wide for short numbers and too narrow for long numbers:

image image

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.

Add row number to data browser
3 participants