Skip to content

feat: Add expandable preview for arrays of pointers in data browser - #3534

Open
Albert1603 wants to merge 2 commits into
parse-community:alphafrom
Albert1603:feat/pointer-array-preview
Open

Albert1603 wants to merge 2 commits into
parse-community:alphafrom
Albert1603:feat/pointer-array-preview

Conversation

@Albert1603

@Albert1603 Albert1603 commented Dec 2, 2026 •

Copy link
Copy Markdown

Pull Request

Issue

Closes #275

In the data browser, an Array cell that holds several Pointers only makes the first one usable. The other Pointers sit in a list that scrolls inside the 20 px high cell. If the first element is a Pointer but a later one is not, the cell throws Invalid type found in pointer array. If the first element is not a Pointer, the Pointers in the array are not linked at all.

A previous attempt, #3260, kept the list inside the cell and was closed.

Approach

The row height stays fixed. A cell whose array contains at least one Pointer now shows:

  • the first valid Pointer as a pill, with the same navigation as before;
  • a +N button with the number of remaining items.

The +N button opens a popover, rendered through the existing Popover component, that lists every item in its original order:

  • Pointers are buttons that open the target object;
  • other values (objects, nested arrays, primitives, null, encoded Parse types such as Date) are shown read-only with their type and a truncated JSON value.

Arrays without any Pointer keep their JSON representation.

Popover behavior:

  • It closes on Escape, on the close button, on an outside click, and when another preview is opened. Focus returns to the +N button on Escape and on the close button.
  • It follows its cell while the table scrolls or the window resizes, and closes when the cell leaves the visible area.
  • Keys pressed inside the popover do not reach the data browser keyboard shortcuts, so Backspace or Delete cannot clear the selected cell. The same applies to Enter and Space on the +N button, which would otherwise start editing the cell.
  • Clicks, double clicks and context menu events inside the popover do not reach the cell.

Differences from #3260:

  • The list is in a portal-backed popover instead of scrolling inside the virtualized row.
  • Mixed arrays are covered by dedicated tests.
  • Cmd+Click to open a Pointer in a new tab is not part of this PR.

Other changes:

  • BrowserCell.scss: removed the .pointerList styles, replaced by the new component, and the unused .hasMore and .removePadding rules.
  • Tests in PointerArrayPreview.test.js run against the real Popover in jsdom and cover mixed arrays, focus handling, keyboard isolation and positioning; BrowserCell.test.js covers mixed arrays and arrays without Pointers.

Before / after

pe-1950-pointer-array-preview.mp4

Tasks

  • Add tests

Summary by CodeRabbit

  • New Features
    • Array fields containing pointers now show a compact preview with an option to view every item, including its index, type, and value.
    • Select a pointer in the expanded list to open its object. Mixed arrays display without errors.
  • Bug Fixes
    • Arrays without pointers continue to appear in their JSON representation, and array contents remain available to copy.

Albert1603 and others added 2 commits December 2, 2026 12:42
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Close other open previews when a preview is expanded
- Restore focus to the trigger only on Escape or the close button
- Keep keys pressed in the popover, and Enter or Space on the trigger,
  away from the data browser keyboard shortcuts
- Keep the popover attached to its cell on scroll and resize, and close
  it when the cell leaves the visible area
- Keep context menu and double click in the popover away from the cell
- Label encoded Parse types and use singular counts
- Test against the real Popover instead of a mock

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@parse-github-assistant

Copy link
Copy Markdown

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

Tip

  • Keep pull requests small. Large PRs will be rejected. Break complex features into smaller, incremental PRs.
  • Use Test Driven Development. Write failing tests before implementing functionality. Ensure tests pass.
  • Group code into logical blocks. Add a short comment before each block to explain its purpose.
  • We offer conceptual guidance. Coding is up to you. PRs must be merge-ready for human review.
  • Our review focuses on concept, not quality. PRs with code issues will be rejected. Use an AI agent.
  • Human review time is precious. Avoid review ping-pong. Inspect and test your AI-generated code.

Note

Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect.

Caution

Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement. Our CI and AI review are safeguards, not development tools. If many issues are flagged, rethink your development approach. Invest more effort in planning and design rather than using review cycles to fix low-quality code.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

BrowserCell now detects pointer values anywhere in an array and displays a dedicated preview when pointer navigation is available. The preview shows the first pointer and can open an indexed dialog for all array values. The dialog supports pointer navigation, dismissal, focus handling, and viewport-aware positioning.

Changes: Pointer array preview

Layer / File(s) Summary
Array detection and preview rendering
src/components/BrowserCell/BrowserCell.react.js, src/components/BrowserCell/BrowserCell.scss, src/components/BrowserCell/PointerArrayPreview.react.js, src/components/BrowserCell/PointerArrayPreview.scss, src/lib/tests/BrowserCell.test.js, src/lib/tests/PointerArrayPreview.test.js
BrowserCell renders PointerArrayPreview when an array contains a pointer and a pointer-click handler is available. Other arrays render as JSON, and the array’s JSON string remains the copyable value. The preview shows the first pointer and can open an indexed list of array values. Tests cover mixed and generic arrays, pointer validation, and preview content.
Dialog interactions and positioning
src/components/BrowserCell/PointerArrayPreview.react.js, src/components/BrowserCell/PointerArrayPreview.scss, src/lib/tests/PointerArrayPreview.test.js
The dialog handles pointer selection, dismissal, focus restoration, and keyboard and event isolation. It repositions on scroll and resize, and closes when its anchor leaves view. Tests cover these interactions and positioning behavior.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Severity of issue fixed: Low

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant BrowserCell
  participant PointerArrayPreview
  participant onPointerClick
  BrowserCell->>PointerArrayPreview: Pass array values and pointer-click handler
  User->>PointerArrayPreview: Open dialog and select pointer row
  PointerArrayPreview->>onPointerClick: Pass selected Parse object
Loading

Suggested reviewers: mtrezza, sadakchap

Merge Risk: Minimal · up to f83db

Arrays containing pointers now show the first pointer with a +N button that opens a list of all items. The change is limited to data browser cell rendering and is easy to revert. The only known gap is a minor edge case where the popover can stay open after a resize clips its cell, until the next scroll or resize.

Pre-merge checks: Passed 6

Check name Status Explanation
Title check Passed The title begins with the required prefix "feat:" and the first letter after the prefix is capitalized ("Add"). It clearly describes the main change: an expandable preview for arrays of pointers in th…
Linked Issues check Passed [#275] The only directly linked issue asks that Pointers inside arrays render as links to their referenced objects, as standalone Pointers do. The change set meets this requirement:
- `BrowserCell.rea…
Out of Scope Changes check Passed All listed changes relate to the Pointer array preview required by #275:
- BrowserCell.react.js: replaces the first-element pointer check and inline Pill rendering with PointerArrayPreview. This…
Description check Passed The description follows the repository template. It has the Pull Request boilerplate, an Issue section that links #275, a detailed Approach section, and a checked "Add tests" task. The Approach covers…
Security Check Passed The security check passes. I reviewed the full PR range (PR #3534, parse-community/parse-dashboard, author Albert1603, base alpha). The changed files are BrowserCell.react.js, BrowserCell.scss, the ne…
Engage In Review Feedback Passed The check requires that the contributor engage with review feedback and not ignore or resolve it without discussion and a fix or a retraction. The supplied review context states: "No CodeRabbit review…
Full details: Title check

Explanation

The title begins with the required prefix "feat:" and the first letter after the prefix is capitalized ("Add"). It clearly describes the main change: an expandable preview for arrays of pointers in the data browser, which matches the PointerArrayPreview component and BrowserCell changes.

Full details: Linked Issues check

Explanation

[#275] The only directly linked issue asks that Pointers inside arrays render as links to their referenced objects, as standalone Pointers do. The change set meets this requirement:

  • BrowserCell.react.js now renders PointerArrayPreview for any array that contains at least one pointer value, when onPointerClick is a function. The previous first-element check and the per-element throw on mixed arrays are removed.
  • PointerArrayPreview.react.js shows the first valid Pointer as a Pill with navigation. A +N button opens a Popover that lists every item in original order. Pointer items are buttons that call onPointerClick with the target object. This gives every Pointer in the array a link to its referenced object.
  • PointerArrayPreview.test.js and BrowserCell.test.js cover mixed arrays and arrays without Pointers, which supports the coding requirement.

The issue does not require a specific layout. The popover design is a valid way to satisfy the request. No unmet coding requirement is identified. Non-coding items in the PR description, such as the attached before/after video, do not apply. The assessment relies on the whole-PR summary and the diff summary. No source file was inspected directly, so the exact wiring of onPointerClick in the data browser is inferred from the summary.

Full details: Out of Scope Changes check

Explanation

All listed changes relate to the Pointer array preview required by #275:

  • BrowserCell.react.js: replaces the first-element pointer check and inline Pill rendering with PointerArrayPreview. This is the core change.
  • PointerArrayPreview.react.js and PointerArrayPreview.scss: new component and styles for the pill, +N button and popover. The popover behavior (keyboard isolation, focus handling, positioning, closing on scroll out) supports the preview. It does not add unrelated features.
  • BrowserCell.scss: removes .pointerList, which the new component replaces, and the unused .hasMore and .removePadding rules. This cleanup follows from the replacement.
  • BrowserCell.test.js and PointerArrayPreview.test.js: tests for the changed behavior.

The PR states that Cmd+Click is not included. That omission does not add out-of-scope code. No unrelated change is demonstrated.

Full details: Description check

Explanation

The description follows the repository template. It has the Pull Request boilerplate, an Issue section that links #275, a detailed Approach section, and a checked "Add tests" task. The Approach covers the UI behavior, popover interactions, keyboard isolation, and differences from #3260. The "Add changes to documentation" task is unchecked and not addressed. The description does not report test execution results, but the template does not require them.

Full details: Security Check

Explanation

The security check passes. I reviewed the full PR range (PR #3534, parse-community/parse-dashboard, author Albert1603, base alpha). The changed files are BrowserCell.react.js, BrowserCell.scss, the new PointerArrayPreview.react.js and .scss, and two test files. Evidence: - No dangerouslySetInnerHTML, innerHTML, eval, new Function, document.write, postMessage, or similar sink appears in the added lines. A search of the full diff found no matches for these patterns. - Pointer data (className, objectId, and array values) renders only as React text nodes, for example inside &lt;code&gt; and &lt;span&gt;. React escapes these values. Values are converted with JSON.stringify and truncated. They are not parsed as HTML or executed. - Template literals in aria-label and class strings only build labels from counts and the pointer fields. They do not create markup. - Pointer clicks call the existing onPointerClick with a new Parse.Object built from className and objectId. This matches the pre-existing pointer behavior and adds no new URL, href, or window.open sink. - No new network calls, storage access, or credential handling were added. - The only @import in the SCSS diff loads the repository's own globals stylesheet. No url(), expression, or -moz-binding appears. - The new event handlers only stop propagation and manage focus. They do not widen access to data. No pattern in the stated failure conditions is present in the changed code.

Full details: Engage In Review Feedback

Explanation

The check requires that the contributor engage with review feedback and not ignore or resolve it without discussion and a fix or a retraction. The supplied review context states: "No CodeRabbit review threads were returned." Zero review threads exist, so no feedback was ignored or resolved. The check is therefore satisfied with no violation. The posted-comment metadata is sufficient to decide this criterion, so I did not inspect the code. I also did not check whether comments were posted outside the returned threads. The context states it covers the returned threads only, but nothing in it suggests other threads exist.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6d526442-459f-4592-b6d1-4f769b828d21
Commits

Reviewing files that changed from the base of the PR and between 8bc693e and f83db7f.

Files selected for processing: 6

  • src/components/BrowserCell/BrowserCell.react.js
  • src/components/BrowserCell/BrowserCell.scss
  • src/components/BrowserCell/PointerArrayPreview.react.js
  • src/components/BrowserCell/PointerArrayPreview.scss
  • src/lib/tests/BrowserCell.test.js
  • src/lib/tests/PointerArrayPreview.test.js
Files with no reviewable changes: 1

  • src/components/BrowserCell/BrowserCell.scss

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

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.

Arrays of Pointers dont render correctly

1 participant