Skip to content

fix: Data browser table shows loading indicator when info panel is loading #2782

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 2 commits into from
May 3, 2025

Conversation

mtrezza
Copy link
Member

@mtrezza mtrezza commented May 3, 2025

New Pull Request Checklist

Issue Description

Closes: #2781

Approach

It seems that in #2768 the isLoading param was mistaken for the data table loading indicator but it controls the info panel loading indicator. Removed that added logic, because the also added

this.setState({
  data: null,
})

seems to be enough to fix #2718 which was the original intention.

Summary by CodeRabbit

  • Refactor
    • Updated loading state management for the aggregation/info panel to use a more specific indicator, improving clarity in the user interface.
    • Adjusted related component properties and methods to align with the new loading state naming.
    • Modified data loading indicators in the header bar to directly reflect data presence rather than a loading flag.

Copy link

parse-github-assistant bot commented May 3, 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

coderabbitai bot commented May 3, 2025

📝 Walkthrough

Walkthrough

The changes focus on clarifying and scoping the loading state management in the data browser and aggregation/info panel components. The generic isLoading state is renamed and refactored to isLoadingInfoPanel to specifically represent the loading state of the info panel, rather than the entire data browser. This includes updating state variables, method names, and props throughout relevant components. Additionally, the condition for determining if data is loaded in the header bar is changed to depend directly on the presence of data, not the loading state. No logic beyond these naming and scoping adjustments is altered.

Changes

File(s) Change Summary
src/components/AggregationPanel/AggregationPanel.js Renamed isLoading to isLoadingInfoPanel for clarity; updated conditional rendering and memoization accordingly. No logic changes.
src/dashboard/Data/Browser/Browser.react.js Refactored loading state from isLoading to isLoadingInfoPanel; updated state, setters, method names, and all references. Removed use of generic loading state in unrelated methods. Updated prop passing to child components.
src/dashboard/Data/Browser/BrowserTable.react.js Updated prop for header bar's data loaded status from !isLoading to !!data. Reorganized imports for grouping, with no functional impact.
src/dashboard/Data/Browser/DataBrowser.react.js Replaced calls to setLoading(false) with setLoadingInfoPanel(false) in two methods. No changes to logic or control flow.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DataBrowser
    participant AggregationPanel

    User->>DataBrowser: Clicks on a cell
    DataBrowser->>AggregationPanel: Requests info panel data
    AggregationPanel->>AggregationPanel: Set isLoadingInfoPanel = true
    AggregationPanel-->>DataBrowser: Info panel loading state updated
    AggregationPanel->>AggregationPanel: Fetches data
    AggregationPanel->>AggregationPanel: Set isLoadingInfoPanel = false
    AggregationPanel-->>DataBrowser: Info panel loading complete
Loading

Assessment against linked issues

Objective Addressed Explanation
Rename isLoading and setIsLoading to indicate info panel loading state (#2781)
Ensure data browser rows do not show loading when info panel is loading (#2781)
Update all related references and props to use the new loading state names (#2781)

📜 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 1f08792 and e63c958.

📒 Files selected for processing (4)
  • src/components/AggregationPanel/AggregationPanel.js (2 hunks)
  • src/dashboard/Data/Browser/Browser.react.js (7 hunks)
  • src/dashboard/Data/Browser/BrowserTable.react.js (2 hunks)
  • src/dashboard/Data/Browser/DataBrowser.react.js (2 hunks)
🧰 Additional context used
🪛 ESLint
src/dashboard/Data/Browser/BrowserTable.react.js

[error] 9-9: 'Button' is defined but never used.

(no-unused-vars)


[error] 10-10: 'DataBrowserHeaderBar' is defined but never used.

(no-unused-vars)


[error] 11-11: 'EmptyState' is defined but never used.

(no-unused-vars)


[error] 12-12: 'Icon' is defined but never used.

(no-unused-vars)


[error] 15-15: 'Editor' is defined but never used.

(no-unused-vars)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Docker linux/amd64
🔇 Additional comments (11)
src/dashboard/Data/Browser/DataBrowser.react.js (2)

195-195: Correctly renamed method to clarify loading state scope.

This change properly updates the method call to setLoadingInfoPanel() to accurately reflect that this loading state controls the info panel rather than the data table. This is a direct fix for the issue described in the PR objectives.


590-590: Renamed method matches the renamed state variable.

Properly updated to use the more descriptive setLoadingInfoPanel() method which clarifies that this loading state is specific to the info panel, not the data browser rows.

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

563-563: Key fix: Changed loading state determination to check for data presence.

This is the crucial change that fixes the issue. By changing from !this.props.isLoading to !!this.props.data, the data browser loading state now correctly depends on whether data exists rather than the info panel's loading state. This directly resolves the issue where rows appeared loading when only the info panel was loading.

src/components/AggregationPanel/AggregationPanel.js (2)

41-41: Renamed variable to clarify its purpose.

Renaming isLoading to isLoadingInfoPanel makes the variable's purpose more clear and consistent with changes in other files. This helps prevent future misinterpretations of what this loading state controls.


184-184: Updated conditional rendering to use renamed variable.

This change updates the JSX conditional to use the renamed isLoadingInfoPanel variable, maintaining consistency with the variable rename above.

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

114-114: Renamed state property to better reflect its purpose.

Changed from isLoading to isLoadingInfoPanel to clarify that this state controls specifically the info panel's loading indicator, not the data table rows. This is part of the systematic renaming throughout the PR.


133-133: Updated method binding to match renamed method.

The binding is updated to use the renamed method, maintaining consistency throughout the component.


258-262: Renamed setter method to be more specific.

Changed from setLoading to setLoadingInfoPanel to make it clear that this method sets the loading state specifically for the info panel. This helps prevent misinterpretation of what this loading state controls.


270-303: Updated loading state management in fetchAggregationPanelData.

All references to the loading state in this method now use the renamed isLoadingInfoPanel state property. This ensures consistency with the new naming convention across the component.

🧰 Tools
🪛 Biome (1.9.4)

[error] 285-285: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


1121-1121: Updated loading state reset in updateOrdering method.

Changed from isLoading to isLoadingInfoPanel to maintain consistency with the renamed state property throughout the component.


2098-2099: Updated props passed to DataBrowser component.

Changed from isLoading/setLoading to isLoadingInfoPanel/setLoadingInfoPanel to pass the renamed state and methods to the DataBrowser component. This ensures the changes propagate correctly throughout the component tree.


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

@parseplatformorg
Copy link
Contributor

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

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

@mtrezza mtrezza changed the title fix: Data browser rows appear loading when info panel is loading fix: Data browser table shows loading indicator when info panel is loading May 3, 2025
@mtrezza mtrezza merged commit da57e5e into parse-community:alpha May 3, 2025
9 of 11 checks passed
@mtrezza mtrezza deleted the fix/loading-indicator branch May 3, 2025 01:20
parseplatformorg pushed a commit that referenced this pull request May 3, 2025
## [7.1.1-alpha.2](7.1.1-alpha.1...7.1.1-alpha.2) (2025-05-03)

### Bug Fixes

* Data browser table shows loading indicator when info panel is loading ([#2782](#2782)) ([da57e5e](da57e5e))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 7.1.1-alpha.2

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label May 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released-alpha Released as alpha version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Data browser rows appear loading when info panel is loading No loading indicator when navigating pages
2 participants