Skip to content
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

feat(dashboard): BulkEditor Boolean cell behaviour #8418

Merged
merged 9 commits into from
Aug 13, 2024

Conversation

kasperkristensen
Copy link
Contributor

@kasperkristensen kasperkristensen commented Aug 2, 2024

What

  • Part two of bulk editor improvements, mainly focussed on adding special behaviours for the Boolean cell.

Changes to the Boolean cell

  • Boolean cells no longer require a double click or "Enter" key press before being interactive.
  • Boolean cells now invert when focused and the user hits "Space".
  • If a range of boolean cells are selected hitting "Space" will do the following:
    • If all fields are either true or false then invert the values.
    • If some fields are true and others are false, then set all fields to true.
  • Hitting "Enter" on a Boolean cell will invert its value, and then move focus to the next row. This is not the same behaviour, as you would find in a spreadsheet like Google Sheets. Their hitting enter shows the underlying text value, e.g. "FALSE". We don't have a underlying text value, that we allow users to edit, so instead I opted for the described behaviour, which allows the user to toggle cells in quick succession.

Changes to scroll behaviour

  • We now attempt to scroll to the next row/column if possible. This overscroll provides a more smooth experience, as it allows the virtualizer to load the next couple of rows/columns even if the cell we are currently scrolling to is at the edge of the screen.

Changes to how selection and dragSelection is calculated

  • The useEffect's that were used to update the selection / drag selection on updates to anchor, rangeEnd, and dragEnd have been removed in favour of utils that a cell can call to check if it is in either selection.

Clean up of query selector use

  • A new hook useGridQueryTool has been added that exposes a couple of utils for getting a cell container or cell input HTML element.

Other

  • Adds prop-types dependency to project. This should prevent an error being thrown about the dependency missing when running the dashboard in development. This is might temporary, as the current FocusTrap solution is not perfect and needs to be improved. Not sure yet, if the desired effect can be achieved with focus-trap-react, but if not we will remove the dependency and prop-types.

Closes CC-268

Copy link

vercel bot commented Aug 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
medusa-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 12, 2024 2:09pm
6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Aug 12, 2024 2:09pm
api-reference-v2 ⬜️ Ignored (Inspect) Visit Preview Aug 12, 2024 2:09pm
docs-ui ⬜️ Ignored (Inspect) Visit Preview Aug 12, 2024 2:09pm
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Aug 12, 2024 2:09pm
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Aug 12, 2024 2:09pm
resources-docs ⬜️ Ignored (Inspect) Visit Preview Aug 12, 2024 2:09pm

Copy link

changeset-bot bot commented Aug 2, 2024

⚠️ No Changeset found

Latest commit: 51a4615

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@kasperkristensen kasperkristensen changed the title feat(dashboard): Bulk Editor improvements feat(dashboard): BulkEditor Boolean cell behaviour Aug 2, 2024
@kasperkristensen
Copy link
Contributor Author

@shahednasser I have added the prop-types dependency to dashboard, so when this gets merged we should check if we can remove it from the starter 👍

@olivermrbl
Copy link
Contributor

I accidentally dragged horizontally and got this error:
CleanShot 2024-08-06 at 09 57 56

@kasperkristensen
Copy link
Contributor Author

I accidentally dragged horizontally and got this error: CleanShot 2024-08-06 at 09 57 56

Should be fixed now 👍

@olivermrbl olivermrbl merged commit b2250ed into develop Aug 13, 2024
23 checks passed
@olivermrbl olivermrbl deleted the feat/bulk-editor-improvements-part-two branch August 13, 2024 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants