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

#7684: adds error details for multiple selectors and no selectors found errors #7752

Merged

Conversation

grahamlangford
Copy link
Collaborator

@grahamlangford grahamlangford commented Feb 28, 2024

What does this PR do?

Discussion

  • Currently have the Multiple and No Elements Found Detail views as duplicated files in case we want to change the styling between the two in any way.
  • Will combine into a single Detail component if we're happy to keep the designs the same for each.

Demo

https://www.loom.com/share/3838c3b3bf644851bae7266df3f68b32

Checklist

  • Add tests
  • New files added to src/tsconfig.strictNullChecks.json (if possible)
  • Designate a primary reviewer @twschiller

@grahamlangford grahamlangford linked an issue Feb 28, 2024 that may be closed by this pull request
@grahamlangford grahamlangford self-assigned this Feb 28, 2024
@twschiller twschiller changed the title adds error details for multiple selectors and no selectors found errors #7684: adds error details for multiple selectors and no selectors found errors Feb 28, 2024
Copy link

codecov bot commented Feb 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.14%. Comparing base (19ea4eb) to head (a3aecd2).

❗ Current head a3aecd2 differs from pull request most recent head 384cfd8. Consider uploading reports for the commit 384cfd8 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7752   +/-   ##
=======================================
  Coverage   72.13%   72.14%           
=======================================
  Files        1268     1269    +1     
  Lines       39753    39765   +12     
  Branches     7373     7375    +2     
=======================================
+ Hits        28676    28687   +11     
- Misses      11077    11078    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

import { type MultipleElementsFoundError } from "@/errors/businessErrors";
import styles from "./ErrorDetail.module.scss";

const MultipleElementsFoundErrorDetail: React.FunctionComponent<{
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like you could use a single component that takes either a MultipleElementsFoundError or NoElementsFoundError because you're relying on the same property?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed. I should've opened this as a draft and called it out. I kept them separate in case there were any design concerns where they would end up different.

Copy link
Contributor

@twschiller twschiller left a comment

Choose a reason for hiding this comment

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

See comment on reusing the error detail component: https://github.com/pixiebrix/pixiebrix-extension/pull/7752/files#r1506105859

Copy link

When the PR is merged, the first loom link found on this PR will be posted to #sprint-demo on Slack. Do not edit this comment manually.

@twschiller twschiller added this to the 1.8.10 milestone Feb 28, 2024
@twschiller twschiller added the user experience Improve the user experience (UX) label Feb 28, 2024
Copy link

@BrandonPxBx BrandonPxBx left a comment

Choose a reason for hiding this comment

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

Discussed with @grahamlangford

We should take a more holistic look at error messaging at a later date

@grahamlangford grahamlangford enabled auto-merge (squash) February 28, 2024 15:48
@grahamlangford grahamlangford merged commit 0ee8f0a into main Feb 28, 2024
16 checks passed
@grahamlangford grahamlangford deleted the 7684-report-selector-in-error-detail-in-page-editor branch February 28, 2024 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user experience Improve the user experience (UX)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Report selector in error detail in Page Editor
3 participants