Skip to content

Added dropdown-cell support for the data editor#6139

Open
IEC1 wants to merge 3 commits intoreflex-dev:mainfrom
IEC1:IsaiahChin/data-editor-dropdown-cell-support
Open

Added dropdown-cell support for the data editor#6139
IEC1 wants to merge 3 commits intoreflex-dev:mainfrom
IEC1:IsaiahChin/data-editor-dropdown-cell-support

Conversation

@IEC1
Copy link

@IEC1 IEC1 commented Feb 18, 2026

This PR adds support for dropdown-cell from @glideapps/glide-data-grid-cells for the Data Editor.

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

New Feature Submission:

  • Does your submission pass the tests?
  • Have you linted your code locally prior to submission?

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 18, 2026

Greptile Summary

This PR adds dropdown cell support to the DataEditor component by integrating @glideapps/glide-data-grid-cells. The changes add a new "dropdown" case to the formatCell JavaScript helper, register custom cell renderers via a new custom_renderers prop, and add the necessary library dependency and imports.

  • Adds @glideapps/glide-data-grid-cells@6.0.3 as a dependency and imports all custom cell renderers via Object.values(AllCells).filter(x => x?.isMatch)
  • Introduces a custom_renderers prop on DataEditor that is always set to the filtered cell renderer array
  • Adds a "dropdown" case in formatCell that returns a GridCellKind.Custom cell with kind: "dropdown-cell" data, using column.allowedValues for the option list
  • Bug: The dropdown cell hardcodes readonly: false and allowOverlay: true, ignoring the column.editable property that all other cell types respect
  • Consideration: All custom renderers from the cells package are unconditionally loaded for every DataEditor instance, even when no dropdown columns exist

Confidence Score: 3/5

  • This PR introduces useful new functionality but has a logic bug where dropdown cells ignore the editable column property, which should be fixed before merging.
  • Score of 3 reflects that the core feature works but has a clear inconsistency: the dropdown cell type hardcodes readonly: false, breaking the editable contract that all other cell types honor. The unconditional loading of all custom renderers is a secondary concern around bundle size.
  • reflex/.templates/web/utils/helpers/dataeditor.js — the dropdown cell case needs to respect the editable column property like all other cell types.

Important Files Changed

Filename Overview
reflex/.templates/web/utils/helpers/dataeditor.js Adds dropdown cell case to formatCell switch. Logic bug: hardcodes readonly: false and allowOverlay: true, ignoring the editable column property used by all other cell types.
reflex/components/datadisplay/dataeditor.py Adds @glideapps/glide-data-grid-cells dependency, custom_renderers prop (always set to all custom cells), and import/filter logic in custom code block. The unconditional loading of all renderers could impact bundle size for non-dropdown usage.
pyi_hashes.json Updated hash for dataeditor.pyi to reflect the new custom_renderers prop addition. Routine change.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["DataEditor Component\n(dataeditor.py)"] -->|"adds lib_dependency"| B["@glideapps/glide-data-grid-cells"]
    A -->|"add_custom_code()"| C["import * as AllCells\nconst allCells = filter(isMatch)"]
    C -->|"customRenderers prop"| D["DataEditor React Component"]
    
    E["formatCell(value, column)\n(dataeditor.js)"] -->|"column.type"| F{Switch on type}
    F -->|"'int'/'float'"| G["GridCellKind.Number\nreadonly: !editable"]
    F -->|"'str'/'datetime'"| H["GridCellKind.Text\nreadonly: !editable"]
    F -->|"'bool'"| I["GridCellKind.Boolean\nreadonly: !editable"]
    F -->|"'dropdown' (NEW)"| J["GridCellKind.Custom\nreadonly: false ⚠️"]
    J -->|"data.kind"| K["'dropdown-cell'\nallowedValues from column"]
    
    D -->|"getCellContent callback"| E
Loading

Last reviewed commit: ad2a828

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

3 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +370 to +371
# Custom cell renderers
custom_renderers: Var[Any] = Var(_js_expr="allCells")
Copy link
Contributor

Choose a reason for hiding this comment

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

custom_renderers always loads all cell renderers

This prop is unconditionally set to allCells for every DataEditor instance, which means the full @glideapps/glide-data-grid-cells bundle (including all custom cell types — date picker, star rating, range, etc.) is always imported and registered even when no dropdown columns are used. Consider making this opt-in or conditionally set — for example, only inject the allCells import and set custom_renderers when at least one column has type: "dropdown".

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
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.

1 participant

Comments